diff options
author | vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com> | 2021-10-28 03:45:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 03:45:11 (GMT) |
commit | b92c7e58a97bc81a8983da3312dbfe72f6a75745 (patch) | |
tree | 40ce8f08c2ec57a772ce57b3b91da56be21d5334 /src/H5MF.c | |
parent | bb54464d2dcee95032332c44aa4d1ee2438e4be4 (diff) | |
parent | 33630ee54581f7f54e4ecd8e53ec3e94ba13c493 (diff) | |
download | hdf5-b92c7e58a97bc81a8983da3312dbfe72f6a75745.zip hdf5-b92c7e58a97bc81a8983da3312dbfe72f6a75745.tar.gz hdf5-b92c7e58a97bc81a8983da3312dbfe72f6a75745.tar.bz2 |
Merge pull request #43 from vchoi-hdfgroup/feature/vfd_swmr
Feature/vfd swmr
Diffstat (limited to 'src/H5MF.c')
-rw-r--r-- | src/H5MF.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -2463,15 +2463,15 @@ done: * Purpose: To retrieve free-space section information for * paged or non-paged aggregation * - * Return: Success: Number of free sections - * Failure: -1 + * Return: SUCCEED/FAIL * * Programmer: Vailin Choi; Dec 2012 * *------------------------------------------------------------------------- */ -ssize_t -H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info) +herr_t +H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info, + size_t *sect_count) { H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ @@ -2480,9 +2480,9 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t H5MF_sect_iter_ud_t sect_udata; /* User data for callback */ H5F_mem_page_t start_type, end_type; /* Memory types to iterate over */ H5F_mem_page_t ty; /* Memory type for iteration */ - ssize_t ret_value = -1; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, (-1)) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); @@ -2544,7 +2544,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t if (!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) { if (H5MF__open_fstype(f, ty) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1), "can't open the free space manager") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") HDassert(f->shared->fs_man[ty]); fs_started = TRUE; } /* end if */ @@ -2552,7 +2552,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t /* Check if there's free space sections of this type */ if (f->shared->fs_man[ty]) if (H5MF__get_free_sects(f, f->shared->fs_man[ty], §_udata, &nums) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1), + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get section info for the free space manager") /* Increment total # of sections */ @@ -2561,13 +2561,13 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t /* Close the free space manager of this type, if we started it here */ if (fs_started) if (H5MF__close_fstype(f, ty) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, (-1), "can't close file free space") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space") if ((H5F_PAGED_AGGR(f)) && (type != H5FD_MEM_DEFAULT)) ty = (H5F_mem_page_t)(ty + H5FD_MEM_NTYPES - 2); } /* end for */ - /* Set return value */ - ret_value = (ssize_t)total_sects; + /* Set value to return */ + *sect_count = total_sects; done: /* Reset the ring in the API context */ |