summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/H5B.c8
-rw-r--r--src/H5B2dbg.c10
-rw-r--r--src/H5B2pkg.h2
-rw-r--r--src/H5B2test.c33
-rw-r--r--src/H5FS.c6
-rw-r--r--src/H5FSpkg.h8
-rw-r--r--src/H5FSsection.c10
-rw-r--r--src/H5Fint.c76
-rw-r--r--src/H5Gdeprec.c2
-rw-r--r--src/H5Gloc.c8
-rw-r--r--src/H5Gnode.c3
-rw-r--r--src/H5Gprivate.h2
-rw-r--r--src/H5I.c110
-rw-r--r--src/H5Ipkg.h2
-rw-r--r--src/H5Itest.c42
-rw-r--r--src/H5MF.c199
-rw-r--r--src/H5MFaggr.c261
-rw-r--r--src/H5MFdbg.c25
-rw-r--r--src/H5MFpkg.h24
-rw-r--r--src/H5MFsection.c345
-rw-r--r--src/H5O.c143
-rw-r--r--src/H5Odeprec.c332
-rw-r--r--src/H5Oint.c180
-rw-r--r--src/H5Opkg.h6
-rw-r--r--src/H5Oprivate.h3
-rw-r--r--src/H5Opublic.h40
-rw-r--r--src/H5PB.c34
-rw-r--r--src/H5R.c16
-rw-r--r--src/H5Rdeprec.c2
-rw-r--r--src/H5Rint.c17
-rw-r--r--src/H5Rpkg.h5
-rw-r--r--src/H5vers.txt5
-rw-r--r--src/Makefile.am2
34 files changed, 1131 insertions, 831 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9ff70f9..9a1f545 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -450,6 +450,7 @@ set (H5O_SOURCES
${HDF5_SRC_DIR}/H5Ocont.c
${HDF5_SRC_DIR}/H5Ocopy.c
${HDF5_SRC_DIR}/H5Odbg.c
+ ${HDF5_SRC_DIR}/H5Odeprec.c
${HDF5_SRC_DIR}/H5Odrvinfo.c
${HDF5_SRC_DIR}/H5Odtype.c
${HDF5_SRC_DIR}/H5Oefl.c
diff --git a/src/H5B.c b/src/H5B.c
index fe09b42..1f19d7b 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -245,7 +245,7 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*
NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node")
if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "file allocation failed for B-tree root node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "file allocation failed for B-tree root node")
/*
* Cache the new B-tree node.
@@ -320,7 +320,7 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, udata)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
HDassert(shared);
@@ -332,7 +332,7 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata)
cache_udata.type = type;
cache_udata.rc_shared = rc_shared;
if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node")
rt = bt->nchildren;
while(lt < rt && cmp) {
@@ -1300,7 +1300,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level,
if((int)(ret_value = H5B__remove_helper(f, bt->child[idx], type,
level + 1, H5B_NKEY(bt, shared, idx)/*out*/,
lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/,
- rt_key_changed/*out*/)) < 0)
+ rt_key_changed/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree")
} else if(type->remove) {
/*
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index c4f56e5..0e3ebd5 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -109,7 +109,7 @@ H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Load the B-tree header */
if(NULL == (hdr = H5B2__hdr_protect(f, addr, f, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header")
/* Set file pointer for this B-tree operation */
hdr->f = f;
@@ -208,7 +208,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Load the B-tree header */
if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load v2 B-tree header")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load v2 B-tree header")
/* Set file pointer for this B-tree operation */
hdr->f = f;
@@ -220,7 +220,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
node_ptr.addr = addr;
H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned)
if(NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node")
/* Print opening message */
HDfprintf(stream, "%*sv2 B-tree Internal Node...\n", indent, "");
@@ -320,7 +320,7 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
/* Load the B-tree header */
if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header")
/* Set file pointer for this B-tree operation */
hdr->f = f;
@@ -332,7 +332,7 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
node_ptr.addr = addr;
H5_CHECKED_ASSIGN(node_ptr.node_nrec, uint16_t, nrec, unsigned)
if(NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node")
/* Print opening message */
HDfprintf(stream, "%*sv2 B-tree Leaf Node...\n", indent, "");
diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h
index 552cebb..27229f1 100644
--- a/src/H5B2pkg.h
+++ b/src/H5B2pkg.h
@@ -467,7 +467,7 @@ H5_DLL herr_t H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf,
/* Testing routines */
#ifdef H5B2_TESTING
-H5_DLL herr_t H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr);
+H5_DLL herr_t H5B2__get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr);
H5_DLL int H5B2__get_node_depth_test(H5B2_t *bt2, void *udata);
H5_DLL herr_t H5B2__get_node_info_test(H5B2_t *bt2, void *udata,
H5B2_node_info_test_t *ninfo);
diff --git a/src/H5B2test.c b/src/H5B2test.c
index 49fe3af..0f4a39c 100644
--- a/src/H5B2test.c
+++ b/src/H5B2test.c
@@ -469,12 +469,11 @@ H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record,
/*-------------------------------------------------------------------------
- * Function: H5B2_get_root_addr_test
+ * Function: H5B2__get_root_addr_test
*
- * Purpose: Retrieve the root node's address
+ * Purpose: Retrieve the root node's address
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Saturday, February 26, 2005
@@ -482,7 +481,7 @@ H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record,
*-------------------------------------------------------------------------
*/
herr_t
-H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr)
+H5B2__get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
@@ -494,16 +493,15 @@ H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr)
*root_addr = bt2->hdr->root.addr;
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5B2_get_root_addr_test() */
+} /* H5B2__get_root_addr_test() */
/*-------------------------------------------------------------------------
- * Function: H5B2__get_node_info_test
+ * Function: H5B2__get_node_info_test
*
- * Purpose: Determine information about a node holding a record in the B-tree
+ * Purpose: Determine information about a node holding a record in the B-tree
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: SUCCEED/FAIL
*
* Programmer: Quincey Koziol
* Thursday, August 31, 2006
@@ -647,15 +645,16 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5B2__get_node_depth_test
+ * Function: H5B2__get_node_depth_test
*
- * Purpose: Determine the depth of a node holding a record in the B-tree
+ * Purpose: Determine the depth of a node holding a record in the B-tree
*
- * Note: Just a simple wrapper around the H5B2__get_node_info_test() routine
+ * Note: Just a simple wrapper around the H5B2__get_node_info_test() routine
*
- * Return: Success: non-negative depth of the node where the record
- * was found
- * Failure: negative
+ * Return: Success: Non-negative depth of the node where the record
+ * was found
+ *
+ * Failure: -1
*
* Programmer: Quincey Koziol
* Saturday, August 26, 2006
@@ -675,7 +674,7 @@ H5B2__get_node_depth_test(H5B2_t *bt2, void *udata)
/* Get information abou the node */
if(H5B2__get_node_info_test(bt2, udata, &ninfo) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info")
+ HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, (-1), "error looking up node info")
/* Set return value */
ret_value = (int)ninfo.depth;
diff --git a/src/H5FS.c b/src/H5FS.c
index ec2dc11..e1a760f 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -1195,14 +1195,14 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count)
*
* Purpose: Verify that the free space manager is mostly sane
*
- * Return: SUCCEED (Can't fail)
+ * Return: void
*
* Programmer: Quincey Koziol
* Jul 17 2006
*
*-------------------------------------------------------------------------
*/
-herr_t
+void
H5FS__assert(const H5FS_t *fspace)
{
FUNC_ENTER_PACKAGE_NOERR
@@ -1228,7 +1228,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->
HDassert(fspace->serial_sect_count > 0 || fspace->ghost_sect_count == 0);
#endif /* QAK */
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI_VOID
} /* end H5FS__assert() */
#endif /* H5FS_DEBUG_ASSERT */
diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h
index 23e1212..a5896ee 100644
--- a/src/H5FSpkg.h
+++ b/src/H5FSpkg.h
@@ -235,10 +235,10 @@ H5_DLL herr_t H5FS__hdr_dest(H5FS_t *hdr);
H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo);
/* Sanity check routines */
-#ifdef H5FS_DEBUG
-H5_DLL herr_t H5FS__assert(const H5FS_t *fspace);
-H5_DLL herr_t H5FS__sect_assert(const H5FS_t *fspace);
-#endif /* H5FS_DEBUG */
+#ifdef H5FS_DEBUG_ASSERT
+H5_DLL void H5FS__assert(const H5FS_t *fspace);
+H5_DLL void H5FS__sect_assert(const H5FS_t *fspace);
+#endif /* H5FS_DEBUG_ASSERT */
/* Testing routines */
#ifdef H5FS_TESTING
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index f0d9f47..11cd722 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -2197,14 +2197,14 @@ done:
*
* Purpose: Verify that the sections managed are mostly sane
*
- * Return: SUCCEED/FAIL
+ * Return: void
*
* Programmer: Quincey Koziol
* Jul 17 2006
*
*-------------------------------------------------------------------------
*/
-herr_t
+void
H5FS__sect_assert(const H5FS_t *fspace)
{
hsize_t separate_obj; /* The number of separate objects managed */
@@ -2256,7 +2256,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fsp
size_t size_ghost_count; /* # of ghost sections of this size */
/* Get section size node */
- fspace_node = H5SL_item(curr_size_node);
+ fspace_node = (H5FS_node_t *)H5SL_item(curr_size_node);
/* Check sections on list */
curr_sect_node = H5SL_first(fspace_node->sect_list);
@@ -2267,7 +2267,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fsp
H5FS_section_info_t *sect; /* Section */
/* Get section node & it's class */
- sect = H5SL_item(curr_sect_node);
+ sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node);
cls = &fspace->sect_cls[sect->type];
#ifdef QAK
HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type);
@@ -2337,7 +2337,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H
if(fspace->sinfo->merge_list)
HDassert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list)));
- FUNC_LEAVE_NOAPI(SUCCEED)
+ FUNC_LEAVE_NOAPI_VOID
} /* end H5FS__sect_assert() */
#endif /* H5FS_DEBUG_ASSERT */
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 49538f4..7d71fbc 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -510,7 +510,7 @@ H5F__build_name(const char *prefix, const char *file_name, char **full_name/*out
/* Compose the full file name */
HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix,
- (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name);
+ ((prefix_len == 0 || H5_CHECK_DELIMITER(prefix[prefix_len - 1])) ? "" : H5_DIR_SEPS), file_name);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1343,8 +1343,8 @@ H5F__dest(H5F_t *f, hbool_t flush)
* Return: Success: Non-NULL, pointer to new file object.
* Failure: NULL
*
- * Programmer: Quincey Koziol
- * December 13, 2017
+ * Programmer: Quincey Koziol
+ * December 13, 2017
*
*-------------------------------------------------------------------------
*/
@@ -1379,8 +1379,8 @@ done:
* Return: Success: Non-NULL, pointer to new file object.
* Failure: NULL
*
- * Programmer: Quincey Koziol
- * December 13, 2017
+ * Programmer: Quincey Koziol
+ * December 13, 2017
*
*-------------------------------------------------------------------------
*/
@@ -1881,8 +1881,8 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing)
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI))
- /* Since we just returned from a call to H5AC_flush(), we just
- * passed through a barrier. Hence we can skip the barrier on
+ /* Since we just returned from a call to H5AC_flush(), we just
+ * passed through a barrier. Hence we can skip the barrier on
* entry to the mpio file driver truncate call below, and the first
* barrier in the following call to flush the cache again.
*/
@@ -1967,8 +1967,8 @@ H5F__flush_real(H5F_t *f)
*
* Return: Non-negative on success / Negative on failure
*
- * Programmer: Quincey Koziol
- * December 13, 2017
+ * Programmer: Quincey Koziol
+ * December 13, 2017
*
*-------------------------------------------------------------------------
*/
@@ -2792,19 +2792,19 @@ H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high)
* metadata entry class changes when the file format low / high
* bounds are changed and an unwritten entry of that class is
* sitting in the metadata cache.
- *
+ *
* If that happens, it's possible that the entry's size could
* become larger, potentially corrupting the file (if the larger
* entry is fully written, overwriting data outside its allocated
* space), or corrupting the entry (if the entry is truncated to
* fit into the allocated space).
- *
+ *
* Although I'm not aware of any metadata with this behavior
* currently, it would be very difficult to guard against and / or
* detect, but if we flush everything here, the format version
* for metadata entries in the cache will be finalized and these
* sorts of problems can be avoided.
- *
+ *
* QAK - April, 2018
*/
if(H5F__flush_real(f) < 0)
@@ -3635,7 +3635,7 @@ done:
herr_t
H5F__format_convert(H5F_t *f)
{
- hbool_t mark_dirty = FALSE; /* Whether to mark the file's superblock dirty */
+ hbool_t mark_dirty = FALSE; /* Whether to mark the file's superblock dirty */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_VOL
@@ -3646,39 +3646,39 @@ H5F__format_convert(H5F_t *f)
/* Check if the superblock should be downgraded */
if(f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) {
- f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST;
- mark_dirty = TRUE;
+ f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST;
+ mark_dirty = TRUE;
} /* end if */
/* Check for persistent freespace manager, which needs to be downgraded */
if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF &&
- f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF &&
- f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF &&
- f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) {
- /* Check to remove free-space manager info message from superblock extension */
- if(H5F_addr_defined(f->shared->sblock->ext_addr))
- if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension")
-
- /* Close freespace manager */
- if(H5MF_try_close(f) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address")
-
- /* Set non-persistent freespace manager */
- f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF;
- f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF;
- f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF;
- f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF;
-
- /* Indicate that the superblock should be marked dirty */
- mark_dirty = TRUE;
+ f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF &&
+ f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF &&
+ f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) {
+ /* Check to remove free-space manager info message from superblock extension */
+ if(H5F_addr_defined(f->shared->sblock->ext_addr))
+ if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension")
+
+ /* Close freespace manager */
+ if(H5MF_try_close(f) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address")
+
+ /* Set non-persistent freespace manager */
+ f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF;
+ f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF;
+ f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF;
+ f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF;
+
+ /* Indicate that the superblock should be marked dirty */
+ mark_dirty = TRUE;
} /* end if */
/* Check if we should mark the superblock dirty */
if(mark_dirty)
- /* Mark superblock as dirty */
- if(H5F_super_dirty(f) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty")
+ /* Mark superblock as dirty */
+ if(H5F_super_dirty(f) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty")
done:
FUNC_LEAVE_NOAPI_VOL(ret_value)
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index fc346f8..f6c6d8f 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -1118,7 +1118,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, c
/* Go retrieve the object information */
/* (don't need index & heap info) */
HDassert(obj_loc);
- if(H5O_get_info(obj_loc->oloc, FALSE, &oinfo) < 0)
+ if(H5O_get_info(obj_loc->oloc, &oinfo, H5O_INFO_BASIC|H5O_INFO_TIME|H5O_INFO_HDR) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info")
/* Get mapped object type */
diff --git a/src/H5Gloc.c b/src/H5Gloc.c
index 7273a89..f5a14a1 100644
--- a/src/H5Gloc.c
+++ b/src/H5Gloc.c
@@ -76,7 +76,7 @@ typedef struct {
/* User data for getting an object's info in a group */
typedef struct {
/* downward */
- hbool_t want_ih_info; /* Whether to retrieve the index & heap info */
+ unsigned fields; /* which fields in H5O_info_t struct to fill in */
/* upward */
H5O_info_t *oinfo; /* Object information to retrieve */
@@ -684,7 +684,7 @@ H5G_loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUS
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist")
/* Query object information */
- if(H5O_get_info(obj_loc->oloc, udata->want_ih_info, udata->oinfo) < 0)
+ if(H5O_get_info(obj_loc->oloc, udata->oinfo, udata->fields) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object info")
done:
@@ -710,7 +710,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5G_loc_info(const H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t *oinfo/*out*/)
+H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo/*out*/, unsigned fields)
{
H5G_loc_info_t udata; /* User data for traversal callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -723,7 +723,7 @@ H5G_loc_info(const H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_i
HDassert(oinfo);
/* Set up user data for locating object */
- udata.want_ih_info = want_ih_info;
+ udata.fields = fields;
udata.oinfo = oinfo;
/* Traverse group hierarchy to locate object */
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 2ae3d538..72b3633 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -1274,7 +1274,8 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr,
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name")
/* Check if the object pointed by the soft link exists in the source file */
- if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo) >= 0) {
+ /* Only basic information is needed */
+ if(H5G_loc_info(&grp_loc, link_name, &oinfo, H5O_INFO_BASIC) >= 0) {
tmp_src_ent.header = oinfo.addr;
src_ent = &tmp_src_ent;
} /* end if */
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 427f14b..95dfef5 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -277,7 +277,7 @@ H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name,
H5G_loc_t *obj_loc/*out*/);
H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name,
- hbool_t want_ih_info, H5O_info_t *oinfo/*out*/);
+ H5O_info_t *oinfo/*out*/, unsigned fields);
H5_DLL herr_t H5G_loc_set_comment(const H5G_loc_t *loc, const char *name,
const char *comment);
H5_DLL ssize_t H5G_loc_get_comment(const H5G_loc_t *loc, const char *name,
diff --git a/src/H5I.c b/src/H5I.c
index 5117394..66082de 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -31,8 +31,8 @@
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free Lists */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
#include "H5Ipkg.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
#include "H5Oprivate.h" /* Object headers */
@@ -738,10 +738,10 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref)
/* Create the struct & its ID */
new_id = H5I_MAKE(type, type_ptr->nextid);
- id_ptr->id = new_id;
- id_ptr->count = 1; /* initial reference count */
- id_ptr->app_count = !!app_ref;
- id_ptr->obj_ptr = object;
+ id_ptr->id = new_id;
+ id_ptr->count = 1; /* initial reference count */
+ id_ptr->app_count = !!app_ref;
+ id_ptr->obj_ptr = object;
/* Insert into the type */
if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0)
@@ -784,6 +784,7 @@ H5I_register_with_id(H5I_type_t type, const void *object, hbool_t app_ref, hid_t
FUNC_ENTER_NOAPI(FAIL)
/* Check arguments */
+ HDassert(object);
/* Make sure ID is not already in use */
if(NULL != (id_ptr = H5I__find_id(id)))
@@ -808,10 +809,10 @@ H5I_register_with_id(H5I_type_t type, const void *object, hbool_t app_ref, hid_t
HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Create the struct & insert requested ID */
- id_ptr->id = id;
- id_ptr->count = 1; /*initial reference count*/
- id_ptr->app_count = !!app_ref;
- id_ptr->obj_ptr = object;
+ id_ptr->id = id;
+ id_ptr->count = 1; /* initial reference count*/
+ id_ptr->app_count = !!app_ref;
+ id_ptr->obj_ptr = object;
/* Insert into the type */
if(H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0)
@@ -862,51 +863,45 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5I_object
+ * Function: H5I_object
*
- * Purpose: Find an object pointer for the specified ID.
+ * Purpose: Find an object pointer for the specified ID.
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
+ * Return: Success: Non-null object pointer associated with the
+ * specified ID
*
- * Programmer: Unknown
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
void *
H5I_object(hid_t id)
{
- H5I_id_info_t *id_ptr; /*ptr to the new atom */
- void *ret_value = NULL; /*return value */
+ H5I_id_info_t *id_ptr; /* Pointer to the new atom */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOERR
/* General lookup of the ID */
if(NULL != (id_ptr = H5I__find_id(id))) {
/* Get the object pointer to return */
- /* (Casting away const OK -QAK) */
- ret_value = (void *)id_ptr->obj_ptr;
- } /* end if */
+ ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5I_object() */
/*-------------------------------------------------------------------------
- * Function: H5Iobject_verify
- *
- * Purpose: Find an object pointer for the specified ID, verifying that
- * its in a particular type. Public interface to
- * H5I_object_verify.
+ * Function: H5Iobject_verify
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
+ * Purpose: Find an object pointer for the specified ID, verifying that
+ * its in a particular type. Public interface to
+ * H5I_object_verify.
*
- * Programmer: Nathaniel Furrer
- * James Laird
- * Friday, April 23, 2004
+ * Return: Success: Non-null object pointer associated with the
+ * specified ID.
+ * Failure: NULL
*
*-------------------------------------------------------------------------
*/
@@ -932,14 +927,14 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5I_object_verify
+ * Function: H5I_object_verify
*
- * Purpose: Find an object pointer for the specified ID, verifying that
- * its in a particular type.
+ * Purpose: Find an object pointer for the specified ID, verifying that
+ * its in a particular type.
*
- * Return: Success: Non-null object pointer associated with the
- * specified ID.
- * Failure: NULL
+ * Return: Success: Non-null object pointer associated with the
+ * specified ID.
+ * Failure: NULL
*
* Programmer: Quincey Koziol
* Wednesday, July 31, 2002
@@ -949,8 +944,8 @@ done:
void *
H5I_object_verify(hid_t id, H5I_type_t id_type)
{
- H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */
- void *ret_value = NULL; /*return value */
+ H5I_id_info_t *id_ptr = NULL; /* Pointer to the new atom */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI_NOERR
@@ -959,9 +954,8 @@ H5I_object_verify(hid_t id, H5I_type_t id_type)
/* Verify that the type of the ID is correct & lookup the ID */
if(id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I__find_id(id))) {
/* Get the object pointer to return */
- /* (Casting away const OK -QAK) */
- ret_value = (void *)id_ptr->obj_ptr;
- } /* end if */
+ ret_value = (void *)id_ptr->obj_ptr; /* (Casting away const OK -QAK) */
+ }
FUNC_LEAVE_NOAPI(ret_value)
} /* H5I_object_verify() */
@@ -1867,8 +1861,8 @@ done:
* function, and then sets return value, based on the result of
* that callback.
*
- * Return: Success: Non-negative on success
- * Failure: Negative
+ * Return: Success: H5_ITER_CONT (0) or H5_ITER_STOP (1)
+ * Failure: H5_ITER_ERROR (-1)
*
*-------------------------------------------------------------------------
*/
@@ -1925,8 +1919,8 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata)
herr_t
H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref)
{
- H5I_id_type_t *type_ptr; /*ptr to the type */
- herr_t ret_value = SUCCEED; /*return value */
+ H5I_id_type_t *type_ptr; /* Pointer to the type */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1941,9 +1935,9 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re
herr_t iter_status; /* Iteration status */
/* Set up iterator user data */
- iter_udata.user_func = func;
- iter_udata.user_udata = udata;
- iter_udata.app_ref = app_ref;
+ iter_udata.user_func = func;
+ iter_udata.user_udata = udata;
+ iter_udata.app_ref = app_ref;
/* Iterate over IDs */
if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0)
@@ -2020,16 +2014,16 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size)
H5G_loc_t loc; /* Object location */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE3("Zs", "ixz", id, name, size);
/* Get object location */
if(H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location")
/* Call internal routine to retrieve object's name */
if((ret_value = H5I__get_name(&loc, name, size)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_API(ret_value)
@@ -2047,15 +2041,15 @@ done:
* Return: Success: The length of the name
* Failure: -1
*
- * Programmer: Quincey Koziol
- * January 9, 2018
+ * Programmer: Quincey Koziol
+ * January 9, 2018
*
*-------------------------------------------------------------------------
*/
static ssize_t
H5I__get_name(const H5G_loc_t *loc, char *name, size_t size)
{
- ssize_t ret_value = FAIL; /* Return value */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_STATIC_VOL
@@ -2064,7 +2058,7 @@ H5I__get_name(const H5G_loc_t *loc, char *name, size_t size)
/* Retrieve object's name */
if((ret_value = H5G_get_name(loc, name, size, NULL)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
done:
FUNC_LEAVE_NOAPI_VOL(ret_value)
@@ -2086,7 +2080,7 @@ done:
hid_t
H5Iget_file_id(hid_t obj_id)
{
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("i", "i", obj_id);
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h
index 16d7d67..2c1d81f 100644
--- a/src/H5Ipkg.h
+++ b/src/H5Ipkg.h
@@ -67,7 +67,7 @@
/* Testing functions */
#ifdef H5I_TESTING
-H5_DLL ssize_t H5I_get_name_test(hid_t id, char *name/*out*/, size_t size,
+H5_DLL ssize_t H5I__get_name_test(hid_t id, char *name/*out*/, size_t size,
hbool_t *cached);
#endif /* H5I_TESTING */
diff --git a/src/H5Itest.c b/src/H5Itest.c
index 426c026..4b54835 100644
--- a/src/H5Itest.c
+++ b/src/H5Itest.c
@@ -28,12 +28,12 @@
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
-#include "H5CXprivate.h" /* API Contexts */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Gprivate.h" /* Groups */
-#include "H5Ipkg.h" /* IDs */
+#include "H5private.h" /* Generic Functions */
+#include "H5ACprivate.h" /* Metadata cache */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Ipkg.h" /* IDs */
/****************/
@@ -63,44 +63,44 @@
/*-------------------------------------------------------------------------
- * Function: H5I_get_name_test
+ * Function: H5I__get_name_test
*
- * Purpose: Testing version of H5Iget_name()
+ * Purpose: Testing version of H5Iget_name()
*
- * Return: Success: The length of name.
- * Failure: -1
+ * Return: Success: The length of name.
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, July 27, 2010
*
*-------------------------------------------------------------------------
*/
ssize_t
-H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached)
+H5I__get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached)
{
- H5G_loc_t loc; /* Object location */
- hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- ssize_t ret_value = -1; /* Return value */
+ H5G_loc_t loc; /* Object location */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ ssize_t ret_value = -1; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_PACKAGE
/* Get object location */
if(H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object location")
/* Set API context */
if(H5CX_push() < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSET, (-1), "can't set API context")
api_ctx_pushed = TRUE;
/* Call internal group routine to retrieve object's name */
if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name")
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't retrieve object name")
done:
if(api_ctx_pushed && H5CX_pop() < 0)
- HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context")
+ HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context")
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5I_get_name_test() */
+} /* end H5I__get_name_test() */
diff --git a/src/H5MF.c b/src/H5MF.c
index 59ee1fc..64e91c8 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -97,6 +97,9 @@ static herr_t H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type);
static herr_t H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type);
static herr_t H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type);
+/* Callbacks */
+static herr_t H5MF__sects_cb(H5FS_section_info_t *_sect, void *_udata);
+
/*********************/
/* Package Variables */
@@ -232,7 +235,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_alloc_to_fs_type
+ * Function: H5MF__alloc_to_fs_type
*
* Purpose: Map "alloc_type" to the free-space manager type
*
@@ -244,9 +247,9 @@ done:
*-------------------------------------------------------------------------
*/
void
-H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type)
+H5MF__alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
HDassert(f);
HDassert(fs_type);
@@ -271,7 +274,7 @@ H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_pag
*fs_type = (H5F_mem_page_t)H5MF_ALLOC_TO_FS_AGGR_TYPE(f, alloc_type);
FUNC_LEAVE_NOAPI_VOID
-} /* end H5MF_alloc_to_fs_type() */
+} /* end H5MF__alloc_to_fs_type() */
/*-------------------------------------------------------------------------
@@ -379,10 +382,10 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type)
H5MF_FSPACE_SECT_CLS_LARGE };
H5FS_create_t fs_create; /* Free space creation parameters */
hsize_t alignment; /* Alignment to use */
- hsize_t threshold; /* Threshold to use */
+ hsize_t threshold; /* Threshold to use */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring; /* Ring of FSM */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5AC_ring_t fsm_ring; /* Ring of FSM */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG)
@@ -509,7 +512,7 @@ static herr_t
H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring; /* Ring of FSM */
+ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */
herr_t ret_value = SUCCEED; /* Return value */
@@ -628,10 +631,10 @@ herr_t
H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring; /* Ring of FSM */
- H5MF_sect_ud_t udata; /* User data for callback */
- H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
+ H5MF_sect_ud_t udata; /* User data for callback */
+ H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG)
@@ -639,7 +642,7 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio
HDassert(fspace);
HDassert(node);
- H5MF_alloc_to_fs_type(f, alloc_type, node->sect_info.size, &fs_type);
+ H5MF__alloc_to_fs_type(f, alloc_type, node->sect_info.size, &fs_type);
/* Construct user data for callbacks */
udata.f = f;
@@ -688,7 +691,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace,
haddr_t *addr)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring; /* Ring of FSM */
+ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
H5MF_free_section_t *node; /* Free space section pointer */
htri_t ret_value = FAIL; /* Whether an existing free list node was found */
@@ -728,7 +731,7 @@ HDfprintf(stderr, "%s: freeing node\n", FUNC);
#endif /* H5MF_ALLOC_DEBUG_MORE */
/* Free section node */
- if(H5MF_sect_free((H5FS_section_info_t *)node) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)node) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
} /* end if */
else {
@@ -776,7 +779,7 @@ haddr_t
H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
{
H5AC_ring_t fsm_ring = H5AC_RING_INV; /* free space manager ring */
- H5AC_ring_t orig_ring; /* Original ring value */
+ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
@@ -797,7 +800,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "tidy of self referential fsm hack failed")
} /* end if */
- H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type);
+ H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
#ifdef H5MF_ALLOC_DEBUG_MORE
HDfprintf(stderr, "%s: Check 1.0\n", FUNC);
@@ -862,7 +865,7 @@ done:
HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
-H5MF_sects_dump(f, stderr);
+H5MF__sects_dump(f, stderr);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
FUNC_LEAVE_NOAPI_TAG(ret_value)
@@ -903,7 +906,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size);
#endif /* H5MF_ALLOC_DEBUG */
- H5MF_alloc_to_fs_type(f, alloc_type, size, &ptype);
+ H5MF__alloc_to_fs_type(f, alloc_type, size, &ptype);
switch(ptype) {
case H5F_MEM_PAGE_GENERIC:
@@ -936,7 +939,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space")
/* Create free space section for the fragment */
- if(NULL == (node = H5MF_sect_new(H5MF_FSPACE_SECT_LARGE, ret_value + size, frag_size)))
+ if(NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_LARGE, ret_value + size, frag_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section")
/* Add the fragment to the large free-space manager */
@@ -967,7 +970,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space")
HDassert(f->shared->fs_man[ptype]);
- if(NULL == (node = H5MF_sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size), (f->shared->fs_page_size - size))))
+ if(NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size), (f->shared->fs_page_size - size))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section")
/* Add the remaining space in the page to the manager */
@@ -997,12 +1000,12 @@ done:
HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
-H5MF_sects_dump(f, stderr);
+H5MF__sects_dump(f, stderr);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
/* Release section node, if allocated and not added to section list or merged */
if(node)
- if(H5MF_sect_free((H5FS_section_info_t *)node) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)node) < 0)
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free section node")
FUNC_LEAVE_NOAPI_TAG(ret_value)
@@ -1110,7 +1113,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed")
} /* end if */
- H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type);
+ H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
@@ -1197,7 +1200,7 @@ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, a
/* Create the free-space section for the freed section */
ctype = H5MF_SECT_CLASS_TYPE(f, size);
- if(NULL == (node = H5MF_sect_new(ctype, addr, size)))
+ if(NULL == (node = H5MF__sect_new(ctype, addr, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section")
/* If size of the freed section is larger than threshold, add it to the free space manager */
@@ -1242,14 +1245,14 @@ done:
/* Release section node, if allocated and not added to section list or merged */
if(node)
- if(H5MF_sect_free((H5FS_section_info_t *)node) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)node) < 0)
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
-H5MF_sects_dump(f, stderr);
+H5MF__sects_dump(f, stderr);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
FUNC_LEAVE_NOAPI_TAG(ret_value)
} /* end H5MF_xfree() */
@@ -1334,7 +1337,7 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r
} /* end if */
/* Get free space type from allocation type */
- H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type);
+ H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
@@ -1365,7 +1368,7 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value);
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
/* Create free space section for the fragment */
- if(NULL == (node = H5MF_sect_new(H5MF_FSPACE_SECT_LARGE, end + extra_requested, frag_size)))
+ if(NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_LARGE, end + extra_requested, frag_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section")
/* Add the fragment to the large-sized free-space manager */
@@ -1436,7 +1439,7 @@ done:
HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
#endif /* H5MF_ALLOC_DEBUG */
#ifdef H5MF_ALLOC_DEBUG_DUMP
-H5MF_sects_dump(f, stderr);
+H5MF__sects_dump(f, stderr);
#endif /* H5MF_ALLOC_DEBUG_DUMP */
FUNC_LEAVE_NOAPI_TAG(ret_value)
@@ -1464,9 +1467,9 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size)
H5MF_sect_ud_t udata; /* User data for callback */
H5FS_section_class_t *sect_cls; /* Section class */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t fsm_ring; /* Ring of FSM */
- H5F_mem_page_t fs_type; /* Free space type */
- htri_t ret_value = FALSE; /* Return value */
+ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of FSM */
+ H5F_mem_page_t fs_type; /* Free space type */
+ htri_t ret_value = FALSE; /* Return value */
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
@@ -1485,7 +1488,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
HDassert(sect_cls);
/* Get free space type from allocation type */
- H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type);
+ H5MF__alloc_to_fs_type(f, alloc_type, size, &fs_type);
/* Set the ring type in the API context */
if(H5MF__fsm_type_is_self_referential(f, fs_type))
@@ -1495,7 +1498,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
H5AC_set_ring(fsm_ring, &orig_ring);
/* Create free-space section for block */
- if(NULL == (node = H5MF_sect_new(sect_cls->type, addr, size)))
+ if(NULL == (node = H5MF__sect_new(sect_cls->type, addr, size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section")
/* Construct user data for callbacks */
@@ -1522,7 +1525,7 @@ done:
H5AC_set_ring(orig_ring, NULL);
/* Free section node allocated */
- if(node && H5MF_sect_free((H5FS_section_info_t *)node) < 0)
+ if(node && H5MF__sect_free((H5FS_section_info_t *)node) < 0)
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
#ifdef H5MF_ALLOC_DEBUG
@@ -1561,10 +1564,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
if(H5F_PAGED_AGGR(f)) {
if((ret_value = H5MF__close_pagefs(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'page' file space")
- } /* end if */
- else
+ }
+ else {
if((ret_value = H5MF__close_aggrfs(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'aggr' file space")
+ }
done:
#ifdef H5MF_ALLOC_DEBUG
@@ -1650,8 +1654,8 @@ herr_t
H5MF_try_close(H5F_t *f)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
@@ -1689,7 +1693,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
/* Set the ring type in the API context. In most cases, we will
* need H5AC_RING_RDFSM, so initialy set the ring in
- * the DXPL to that value. We will alter this later if needed.
+ * the context to that value. We will alter this later if needed.
*/
H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring);
curr_ring = H5AC_RING_RDFSM;
@@ -1706,6 +1710,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring ) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -1727,6 +1732,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -1765,10 +1771,10 @@ static herr_t
H5MF__close_aggrfs(H5F_t *f)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */
H5FD_mem_t type; /* Memory type for iteration */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG)
#ifdef H5MF_ALLOC_DEBUG
@@ -1783,7 +1789,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
/* Set the ring type in the API context. In most cases, we will
* need H5AC_RING_RDFSM, so initialy set the ring in
- * the DXPL to that value. We will alter this later if needed.
+ * the context to that value. We will alter this later if needed.
*/
H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring);
curr_ring = H5AC_RING_RDFSM;
@@ -1842,6 +1848,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -1929,8 +1936,8 @@ static herr_t
H5MF__close_pagefs(H5F_t *f)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */
H5F_mem_page_t ptype; /* Memory type for iteration */
H5O_fsinfo_t fsinfo; /* File space info message */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1950,7 +1957,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
/* Set the ring type in the API context. In most cases, we will
* need H5AC_RING_RDFSM, so initialy set the ring in
- * the DXPL to that value. We will alter this later if needed.
+ * the context to that value. We will alter this later if needed.
*/
H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring);
curr_ring = H5AC_RING_RDFSM;
@@ -2005,6 +2012,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -2102,8 +2110,8 @@ static herr_t
H5MF__close_shrink_eoa(H5F_t *f)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */
H5F_mem_t type;
H5F_mem_page_t ptype; /* Memory type for iteration */
hbool_t eoa_shrank; /* Whether an EOA shrink occurs */
@@ -2139,6 +2147,7 @@ H5MF__close_shrink_eoa(H5F_t *f)
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -2162,6 +2171,7 @@ H5MF__close_shrink_eoa(H5F_t *f)
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -2222,9 +2232,9 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
htri_t fs_started[H5F_MEM_PAGE_NTYPES]; /* Indicate whether the free-space manager has been started */
haddr_t fs_eoa[H5FD_MEM_NTYPES]; /* EAO for each free-space manager */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
@@ -2235,7 +2245,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
/* Set the ring type in the API context. In most cases, we will
* need H5AC_RING_RDFSM, so initialy set the ring in
- * the DXPL to that value. We will alter this later if needed.
+ * the context to that value. We will alter this later if needed.
*/
H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring);
curr_ring = H5AC_RING_RDFSM;
@@ -2256,11 +2266,11 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
if(!H5F_PAGED_AGGR(f)) {
/* Retrieve metadata aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
+ if(H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
/* Retrieve 'small data' aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
+ if(H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
} /* end if */
@@ -2342,7 +2352,8 @@ done:
* Purpose: To retrieve free-space section information for
* paged or non-paged aggregation
*
- * Return: SUCCEED/FAIL
+ * Return: Success: Number of free sections
+ * Failure: -1
*
* Programmer: Vailin Choi; Dec 2012
*
@@ -2352,15 +2363,15 @@ ssize_t
H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info)
{
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */
size_t total_sects = 0; /* Total number of sections */
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 */
- FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
+ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, (-1))
/* check args */
HDassert(f);
@@ -2382,11 +2393,11 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
if(f->shared->first_alloc_dealloc) {
if(H5AC_cache_image_pending(f)) {
if(H5AC_force_cache_image_load(f) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "forced cache image load failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, (-1), "forced cache image load failed")
} /* end if */
else {
if(H5MF_tidy_self_referential_fsm_hack(f) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, (-1), "tidy of self referential fsm hack failed")
} /* end else */
} /* end if */
@@ -2409,7 +2420,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t
/* Set the ring type in the API context. In most cases, we will
* need H5AC_RING_RDFSM, so initialy set the ring in
- * the DXPL to that value. We will alter this later if needed.
+ * the context to that value. We will alter this later if needed.
*/
H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring);
curr_ring = H5AC_RING_RDFSM;
@@ -2431,7 +2442,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, FAIL, "can't open the free space manager")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1), "can't open the free space manager")
HDassert(f->shared->fs_man[ty]);
fs_started = TRUE;
} /* end if */
@@ -2439,7 +2450,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], &sect_udata, &nums) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get section info for the free space manager")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, (-1), "can't get section info for the free space manager")
/* Increment total # of sections */
total_sects += nums;
@@ -2447,7 +2458,7 @@ 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, FAIL, "can't close file free space")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, (-1), "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 */
@@ -2465,7 +2476,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_sects_cb()
+ * Function: H5MF__sects_cb()
*
* Purpose: Iterator callback for each free-space section
* Retrieve address and size into user data
@@ -2478,12 +2489,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sects_cb(H5FS_section_info_t *_sect, void *_udata)
+H5MF__sects_cb(H5FS_section_info_t *_sect, void *_udata)
{
H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect;
H5MF_sect_iter_ud_t *udata = (H5MF_sect_iter_ud_t *)_udata;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
if(udata->sect_idx < udata->sect_count) {
udata->sects[udata->sect_idx].addr = sect->sect_info.addr;
@@ -2492,7 +2503,7 @@ H5MF_sects_cb(H5FS_section_info_t *_sect, void *_udata)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5MF_sects_cb() */
+} /* H5MF__sects_cb() */
/*-------------------------------------------------------------------------
@@ -2513,7 +2524,7 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata,
hsize_t hnums = 0; /* # of sections */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_PACKAGE
/* check args */
HDassert(f);
@@ -2529,7 +2540,7 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata,
/* Check if we should retrieve the section info */
if(sect_udata->sects && *nums > 0)
/* Iterate over all the free space sections of this type, adding them to the user's section info */
- if(H5FS_sect_iterate(f, fspace, H5MF_sects_cb, sect_udata) < 0)
+ if(H5FS_sect_iterate(f, fspace, H5MF__sects_cb, sect_udata) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_BADITER, FAIL, "can't iterate over sections")
done:
@@ -2648,8 +2659,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
H5O_fsinfo_t fsinfo; /* Free space manager info message */
H5FS_stat_t fs_stat; /* Information for free-space manager */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
- H5AC_ring_t curr_ring; /* Current ring value */
- H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */
+ H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */
+ H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
@@ -2744,7 +2755,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
break;
for(mem_type = H5FD_MEM_SUPER; mem_type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5F_mem_t, mem_type)) {
- H5MF_alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
+ H5MF__alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
if(pass_count == 0) { /* this is the first pass */
HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT);
@@ -2781,6 +2792,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -2888,7 +2900,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
break;
for(mem_type = H5FD_MEM_SUPER; mem_type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5F_mem_t, mem_type)) {
- H5MF_alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
+ H5MF__alloc_to_fs_type(f, mem_type, alloc_size, &fsm_type);
if(pass_count == 0) { /* this is the first pass */
HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT);
@@ -2906,6 +2918,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled)
needed_ring = H5AC_RING_MDFSM;
else
needed_ring = H5AC_RING_RDFSM;
+
if(needed_ring != curr_ring) {
H5AC_set_ring(needed_ring, NULL);
curr_ring = needed_ring;
@@ -3136,8 +3149,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
/* should only be called if file is opened R/W */
HDassert(H5F_INTENT(f) & H5F_ACC_RDWR);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT);
HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER);
@@ -3153,8 +3166,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
sm_sinfo_fspace = f->shared->fs_man[sm_fssinfo_fs_type];
if(H5F_PAGED_AGGR(f)) {
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER);
HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES);
@@ -3398,7 +3411,7 @@ H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type)
H5F_mem_page_t lg_fssinfo_fsm;
hbool_t result = FALSE;
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(f);
@@ -3406,12 +3419,12 @@ H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type)
HDassert(fsm_type >= H5F_MEM_PAGE_DEFAULT);
HDassert(fsm_type < H5F_MEM_PAGE_NTYPES);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
if(H5F_PAGED_AGGR(f)) {
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
result = (fsm_type == sm_fshdr_fsm) || (fsm_type == sm_fssinfo_fsm)
|| (fsm_type == lg_fshdr_fsm) || (fsm_type == lg_fssinfo_fsm);
@@ -3460,15 +3473,15 @@ H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace)
HDassert(f->shared);
HDassert(fspace);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm);
if(H5F_PAGED_AGGR(f)) {
H5F_mem_page_t lg_fshdr_fsm;
H5F_mem_page_t lg_fssinfo_fsm;
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fsm);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fsm);
result = (fspace == f->shared->fs_man[sm_fshdr_fsm]) ||
(fspace == f->shared->fs_man[sm_fssinfo_fsm]) ||
@@ -3609,8 +3622,8 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f)
* this -- we can use the regular I/O methods even if
* paged aggregation and page buffering is enabled.
*/
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type);
HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT);
HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER);
@@ -3648,8 +3661,8 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f)
} /* end if */
if(H5F_PAGED_AGGR(f)) {
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_HDR, f->shared->fs_page_size + 1, &lg_fshdr_fs_type);
+ H5MF__alloc_to_fs_type(f, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type);
HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER);
HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES);
diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c
index cd80a10..5ab1834 100644
--- a/src/H5MFaggr.c
+++ b/src/H5MFaggr.c
@@ -59,6 +59,8 @@ static herr_t H5MF__aggr_free(H5F_t *f, H5FD_mem_t type,
H5F_blk_aggr_t *aggr);
static haddr_t H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr,
H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size);
+static herr_t H5MF__aggr_reset(H5F_t *f, H5F_blk_aggr_t *aggr);
+static htri_t H5MF__aggr_can_shrink_eoa(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr);
/*********************/
@@ -179,7 +181,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size);
/*
* If the aggregation feature is enabled for this file and strategy is not H5F_FILE_SPACE_NONE,
* allocate "generic" space and sub-allocate out of that, if possible.
- * Otherwise just allocate through H5F_alloc().
+ * Otherwise just allocate through H5F__alloc().
*/
if((f->shared->feature_flags & aggr->feature_flag) && f->shared->fs_strategy != H5F_FSPACE_STRATEGY_NONE) {
haddr_t aggr_frag_addr = HADDR_UNDEF; /* Address of aggregrator fragment */
@@ -193,18 +195,18 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
#endif /* H5MF_AGGR_DEBUG */
/* Turn off alignment if allocation < threshold */
- alignment = H5F_ALIGNMENT(f);
- if(!((alignment > 1) && (size >= H5F_THRESHOLD(f))))
- alignment = 0; /* no alignment */
+ alignment = H5F_ALIGNMENT(f);
+ if(!((alignment > 1) && (size >= H5F_THRESHOLD(f))))
+ alignment = 0; /* no alignment */
/* Generate fragment if aggregator is mis-aligned */
- if(alignment && H5F_addr_gt(aggr->addr, 0) && (aggr_mis_align = (aggr->addr + H5F_BASE_ADDR(f)) % alignment)) {
- aggr_frag_addr = aggr->addr;
- aggr_frag_size = alignment - aggr_mis_align;
- } /* end if */
+ if(alignment && H5F_addr_gt(aggr->addr, 0) && (aggr_mis_align = (aggr->addr + H5F_BASE_ADDR(f)) % alignment)) {
+ aggr_frag_addr = aggr->addr;
+ aggr_frag_size = alignment - aggr_mis_align;
+ } /* end if */
- alloc_type = aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
- other_alloc_type = other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
+ alloc_type = aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
+ other_alloc_type = other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA ? H5FD_MEM_DEFAULT : H5FD_MEM_DRAW;
/* Check if the space requested is larger than the space left in the block */
if((size + aggr_frag_size) > aggr->size) {
@@ -212,73 +214,74 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz
/* Check if the block asked for is too large for 'normal' aggregator block */
if(size >= aggr->alloc_size) {
- hsize_t ext_size = size + aggr_frag_size;
+ hsize_t ext_size = size + aggr_frag_size;
/* Check for overlapping into file's temporary allocation space */
if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
- if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
- else if (extended) {
- /* aggr->size is unchanged */
- ret_value = aggr->addr + aggr_frag_size;
- aggr->addr += ext_size;
- aggr->tot_size += ext_size;
- } else {
+ if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
+ else if(extended) {
+ /* aggr->size is unchanged */
+ ret_value = aggr->addr + aggr_frag_size;
+ aggr->addr += ext_size;
+ aggr->tot_size += ext_size;
+ }
+ else {
/* Release "other" aggregator, if it exists, is at the end of the allocated space,
* has allocated more than one block and the unallocated space is greater than its
* allocation block size.
*/
- if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
- (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
+ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
+ (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block")
- } /* end if */
+ } /* end if */
/* Allocate space from the VFD (i.e. at the end of the file) */
- if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size, &eoa_frag_addr, &eoa_frag_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
+ if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size, &eoa_frag_addr, &eoa_frag_size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
} /* end else */
} /* end if */
- else {
- hsize_t ext_size = aggr->alloc_size;
+ else {
+ hsize_t ext_size = aggr->alloc_size;
/* Allocate another block */
#ifdef H5MF_AGGR_DEBUG
HDfprintf(stderr, "%s: Allocating block\n", FUNC);
#endif /* H5MF_AGGR_DEBUG */
- if(aggr_frag_size > (ext_size - size))
- ext_size += (aggr_frag_size - (ext_size - size));
+ if(aggr_frag_size > (ext_size - size))
+ ext_size += (aggr_frag_size - (ext_size - size));
/* Check for overlapping into file's temporary allocation space */
if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr))
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space")
- if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
- else if(extended) {
- aggr->addr += aggr_frag_size;
- aggr->size += (ext_size - aggr_frag_size);
- aggr->tot_size += ext_size;
- } /* end else-if */
- else {
+ if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space")
+ else if(extended) {
+ aggr->addr += aggr_frag_size;
+ aggr->size += (ext_size - aggr_frag_size);
+ aggr->tot_size += ext_size;
+ } /* end else-if */
+ else {
haddr_t new_space; /* Address of new space allocated */
/* Release "other" aggregator, if it exists, is at the end of the allocated space,
* has allocated more than one block and the unallocated space is greater than its
* allocation block size.
*/
- if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
- (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
+ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) &&
+ (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) {
if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block")
- } /* end if */
+ } /* end if */
/* Allocate space from the VFD (i.e. at the end of the file) */
- if(HADDR_UNDEF == (new_space = H5F__alloc(f, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
+ if(HADDR_UNDEF == (new_space = H5F__alloc(f, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
/* Return the unused portion of the block to a free list */
if(aggr->size > 0)
@@ -307,32 +310,32 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
} /* end else */
} /* end else */
- /* Allocate space out of the metadata block */
- ret_value = aggr->addr;
- aggr->size -= size;
- aggr->addr += size;
+ /* Allocate space out of the metadata block */
+ ret_value = aggr->addr;
+ aggr->size -= size;
+ aggr->addr += size;
} /* end else */
- /* Freeing any possible fragment due to file allocation */
- if(eoa_frag_size)
- if(H5MF_xfree(f, alloc_type, eoa_frag_addr, eoa_frag_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
+ /* Freeing any possible fragment due to file allocation */
+ if(eoa_frag_size)
+ if(H5MF_xfree(f, alloc_type, eoa_frag_addr, eoa_frag_size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
- /* Freeing any possible fragment due to alignment in the block after extension */
+ /* Freeing any possible fragment due to alignment in the block after extension */
if(extended && aggr_frag_size)
- if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
+ if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
} /* end if */
else {
/* Allocate space out of the block */
- ret_value = aggr->addr + aggr_frag_size;
- aggr->size -= (size + aggr_frag_size);
- aggr->addr += (size + aggr_frag_size);
-
- /* free any possible fragment */
- if(aggr_frag_size)
- if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
+ ret_value = aggr->addr + aggr_frag_size;
+ aggr->size -= (size + aggr_frag_size);
+ aggr->addr += (size + aggr_frag_size);
+
+ /* free any possible fragment */
+ if(aggr_frag_size)
+ if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment")
} /* end else */
} /* end if */
else {
@@ -341,10 +344,10 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC);
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space")
/* Check if fragment was generated */
- if(eoa_frag_size)
+ if(eoa_frag_size)
/* Put fragment on the free list */
- if(H5MF_xfree(f, type, eoa_frag_addr, eoa_frag_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
+ if(H5MF_xfree(f, type, eoa_frag_addr, eoa_frag_size) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment")
} /* end else */
/* Sanity check for overlapping into file's temporary allocation space */
@@ -403,53 +406,53 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr,
/* Check if this aggregator is active */
if(f->shared->feature_flags & aggr->feature_flag) {
/*
- * If the block being tested adjoins the beginning of the aggregator
+ * If the block being tested adjoins the beginning of the aggregator
* block, check if the aggregator can accomodate the extension.
*/
if(H5F_addr_eq(blk_end, aggr->addr)) {
- haddr_t eoa; /* EOA for the file */
-
- /* Get the EOA for the file */
- if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa")
-
- /* If the aggregator is at the end of file: */
- if(H5F_addr_eq(eoa, aggr->addr + aggr->size)) {
- /* If extra_requested is below percentage threshold, extend block into the aggregator. */
- if(extra_requested <= (hsize_t)(EXTEND_THRESHOLD * (float)aggr->size)) {
- aggr->size -= extra_requested;
- aggr->addr += extra_requested;
-
- /* Indicate success */
- HGOTO_DONE(TRUE);
- } /* end if */
- /*
- * If extra_requested is above percentage threshold:
- * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested
- * 2) extend the block into the aggregator
- */
- else {
- hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested;
+ haddr_t eoa; /* EOA for the file */
+
+ /* Get the EOA for the file */
+ if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa")
+
+ /* If the aggregator is at the end of file: */
+ if(H5F_addr_eq(eoa, aggr->addr + aggr->size)) {
+ /* If extra_requested is below percentage threshold, extend block into the aggregator. */
+ if(extra_requested <= (hsize_t)(EXTEND_THRESHOLD * (float)aggr->size)) {
+ aggr->size -= extra_requested;
+ aggr->addr += extra_requested;
+
+ /* Indicate success */
+ HGOTO_DONE(TRUE);
+ } /* end if */
+ /*
+ * If extra_requested is above percentage threshold:
+ * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested
+ * 2) extend the block into the aggregator
+ */
+ else {
+ hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested;
if((ret_value = H5F__try_extend(f, type, (aggr->addr + aggr->size), extra)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
- else if(ret_value == TRUE) {
- /* Shift the aggregator block by the extra requested */
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
+ else if(ret_value == TRUE) {
+ /* Shift the aggregator block by the extra requested */
/* (allocates the space for the extra_requested) */
- aggr->addr += extra_requested;
+ aggr->addr += extra_requested;
- /* Add extra to the aggregator's total allocated amount */
- aggr->tot_size += extra;
+ /* Add extra to the aggregator's total allocated amount */
+ aggr->tot_size += extra;
/* Account for any space added to the aggregator */
/* (either 0 (if extra_requested > aggr->alloc_size) or
* (aggr->alloc_size - extra_requested) -QAK
*/
- aggr->size += extra;
- aggr->size -= extra_requested;
- } /* end else-if */
- } /* end else */
- } /* end if */
+ aggr->size += extra;
+ aggr->size -= extra_requested;
+ } /* end else-if */
+ } /* end else */
+ } /* end if */
else {
/* The aggreator is not at end of file */
/* Check if aggregator has enough internal space to satisfy the extension. */
@@ -461,8 +464,8 @@ H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr,
/* Indicate success */
HGOTO_DONE(TRUE);
} /* end if */
- } /* end else */
- } /* end if */
+ } /* end else */
+ } /* end if */
} /* end if */
done:
@@ -471,7 +474,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_aggr_can_absorb
+ * Function: H5MF__aggr_can_absorb
*
* Purpose: Check if a section adjoins an aggregator block and one can
* absorb the other.
@@ -486,12 +489,12 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
+H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink)
{
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Check args */
HDassert(f);
@@ -506,7 +509,7 @@ H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)
|| H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)) {
#ifdef H5MF_AGGR_DEBUG
-HDfprintf(stderr, "%s: section {%a, %Hu} adjoins aggr = {%a, %Hu}\n", "H5MF_aggr_can_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
+HDfprintf(stderr, "%s: section {%a, %Hu} adjoins aggr = {%a, %Hu}\n", "H5MF__aggr_can_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
#endif /* H5MF_AGGR_DEBUG */
/* Check if aggregator would get too large and should be absorbed into section */
if((aggr->size + sect->sect_info.size) >= aggr->alloc_size)
@@ -521,11 +524,11 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins aggr = {%a, %Hu}\n", "H5MF_aggr
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5MF_aggr_can_absorb() */
+} /* end H5MF__aggr_can_absorb() */
/*-------------------------------------------------------------------------
- * Function: H5MF_aggr_absorb
+ * Function: H5MF__aggr_absorb
*
* Purpose: Absorb a free space section into an aggregator block or
* vice versa.
@@ -539,10 +542,10 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5MF_aggr_absorb(const H5F_t H5_ATTR_UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect,
+H5MF__aggr_absorb(const H5F_t H5_ATTR_UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect,
hbool_t allow_sect_absorb)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Check args */
HDassert(f);
@@ -556,7 +559,7 @@ H5MF_aggr_absorb(const H5F_t H5_ATTR_UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_
/* Check if the section adjoins the beginning or end of the aggregator */
if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) {
#ifdef H5MF_AGGR_DEBUG
-HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
+HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "H5MF__aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
#endif /* H5MF_AGGR_DEBUG */
/* Absorb aggregator onto end of section */
sect->sect_info.size += aggr->size;
@@ -566,7 +569,7 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "
HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr));
#ifdef H5MF_AGGR_DEBUG
-HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
+HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5MF__aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size);
#endif /* H5MF_AGGR_DEBUG */
/* Absorb aggregator onto beginning of section */
sect->sect_info.addr -= aggr->size;
@@ -582,7 +585,7 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5
/* Check if the section adjoins the beginning or end of the aggregator */
if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) {
#ifdef H5MF_AGGR_DEBUG
-HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
+HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "H5MF__aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
#endif /* H5MF_AGGR_DEBUG */
/* Absorb section onto front of aggregator */
aggr->addr -= sect->sect_info.size;
@@ -598,7 +601,7 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "
HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr));
#ifdef H5MF_AGGR_DEBUG
-HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
+HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5MF__aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size);
#endif /* H5MF_AGGR_DEBUG */
/* Absorb section onto end of aggregator */
aggr->size += sect->sect_info.size;
@@ -608,11 +611,11 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5MF_aggr_absorb() */
+} /* end H5MF__aggr_absorb() */
/*-------------------------------------------------------------------------
- * Function: H5MF_aggr_query
+ * Function: H5MF__aggr_query
*
* Purpose: Query a block aggregator's current address & size info
*
@@ -625,10 +628,10 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5
*-------------------------------------------------------------------------
*/
herr_t
-H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr,
+H5MF__aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr,
hsize_t *size)
{
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Check args */
HDassert(f);
@@ -644,7 +647,7 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr,
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5MF_aggr_query() */
+} /* end H5MF__aggr_query() */
/*-------------------------------------------------------------------------
@@ -737,11 +740,11 @@ H5MF_free_aggrs(H5F_t *f)
HDassert(f->shared->lf);
/* Retrieve metadata aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
+ if(H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
/* Retrieve 'small data' aggregator info, if available */
- if(H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
+ if(H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
/* Make certain we release the aggregator that's later in the file first */
@@ -774,7 +777,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_aggr_can_shrink_eoa
+ * Function: H5MF__aggr_can_shrink_eoa
*
* Purpose: Check if the remaining space in the aggregator is at EOA
*
@@ -786,12 +789,12 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_aggr_can_shrink_eoa(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr)
+H5MF__aggr_can_shrink_eoa(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr)
{
haddr_t eoa = HADDR_UNDEF; /* EOA for the file */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -808,7 +811,7 @@ H5MF_aggr_can_shrink_eoa(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_aggr_can_shrink_eoa() */
+} /* H5MF__aggr_can_shrink_eoa() */
/*-------------------------------------------------------------------------
@@ -882,17 +885,17 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f)
HDassert(f);
HDassert(f->shared);
- if((ma_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0)
+ if((ma_status = H5MF__aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
if(ma_status > 0)
- if(H5MF__aggr_free(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+ if(H5MF__aggr_free(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
- if((sda_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr))) < 0)
+ if((sda_status = H5MF__aggr_can_shrink_eoa(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr))) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
if(sda_status > 0)
- if(H5MF__aggr_free(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
+ if(H5MF__aggr_free(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
ret_value = (ma_status || sda_status);
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c
index 592ca87..eedb72e 100644
--- a/src/H5MFdbg.c
+++ b/src/H5MFdbg.c
@@ -67,6 +67,7 @@ typedef struct {
/* Local Prototypes */
/********************/
+static herr_t H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata);
/*********************/
/* Package Variables */
@@ -84,7 +85,7 @@ typedef struct {
/*-------------------------------------------------------------------------
- * Function: H5MF_sects_debug_cb
+ * Function: H5MF__sects_debug_cb
*
* Purpose: Prints debugging info about a free space section for a file
*
@@ -97,13 +98,13 @@ typedef struct {
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
+H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
{
H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect; /* Section to dump info */
H5MF_debug_iter_ud_t *udata = (H5MF_debug_iter_ud_t *)_udata; /* User data for callbacks */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/*
* Check arguments.
@@ -136,7 +137,7 @@ H5MF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5MF_sects_debug_cb() */
+} /* end H5MF__sects_debug_cb() */
/*-------------------------------------------------------------------------
@@ -184,7 +185,7 @@ H5MF_sects_debug(H5F_t *f, haddr_t fs_addr, FILE *stream, int indent, int fwidth
udata.fwidth = fwidth;
/* Iterate over all the free space sections */
- if(H5FS_sect_iterate(f, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0)
+ if(H5FS_sect_iterate(f, f->shared->fs_man[type], H5MF__sects_debug_cb, &udata) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space")
/* Close the free space information */
@@ -201,7 +202,7 @@ done:
#ifdef H5MF_ALLOC_DEBUG_DUMP
/*-------------------------------------------------------------------------
- * Function: H5MF_sects_dump
+ * Function: H5MF__sects_dump
*
* Purpose: Prints debugging info about free space sections for a file.
*
@@ -221,7 +222,7 @@ H5MF_sects_dump(H5F_t *f, FILE *stream)
int fwidth = 50; /* Field width */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL)
+ FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG, FAIL)
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC);
#endif /* H5MF_ALLOC_DEBUG */
@@ -234,7 +235,7 @@ HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC);
/* Retrieve the 'eoa' for the file */
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa);
#endif /* H5MF_ALLOC_DEBUG */
@@ -276,13 +277,13 @@ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa);
hsize_t sda_size = 0; /* Size of "small data aggregator" */
/* Retrieve metadata aggregator info, if available */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: ma_addr = %a, ma_size = %Hu, end of ma = %a\n", FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
/* Retrieve 'small data' aggregator info, if available */
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size);
#ifdef H5MF_ALLOC_DEBUG
HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1));
#endif /* H5MF_ALLOC_DEBUG */
@@ -303,7 +304,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC,
HDfprintf(stream, "%*sSections:\n", indent + 3, "");
/* If there is a free space manager for this type, iterate over them */
- if(f->shared->fs.aggr.fs_man[atype]) {
+ if(f->shared->fs_man[atype]) {
H5MF_debug_iter_ud_t udata; /* User data for callbacks */
/* Prepare user data for section iteration callback */
@@ -327,6 +328,6 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC,
done:
HDfprintf(stderr, "%s: Done dumping file free space sections\n", FUNC);
FUNC_LEAVE_NOAPI_TAG(ret_value)
-} /* end H5MF_sects_dump() */
+} /* end H5MF__sects_dump() */
#endif /* H5MF_ALLOC_DEBUG_DUMP */
diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h
index fbf9ee8..ec4aab4 100644
--- a/src/H5MFpkg.h
+++ b/src/H5MFpkg.h
@@ -12,12 +12,12 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Quincey Koziol <koziol@hdfgroup.org>
- * Tuesday, January 8, 2008
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Tuesday, January 8, 2008
*
- * Purpose: This file contains declarations which are visible only within
- * the H5MF package. Source files outside the H5MF package should
- * include H5MFprivate.h instead.
+ * Purpose: This file contains declarations which are visible only within
+ * the H5MF package. Source files outside the H5MF package should
+ * include H5MFprivate.h instead.
*/
#if !(defined H5MF_FRIEND || defined H5MF_MODULE)
#error "Do not include this file outside the H5MF package!"
@@ -186,24 +186,24 @@ H5_DLL herr_t H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type);
H5_DLL htri_t H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, haddr_t *addr);
H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node);
-H5_DLL herr_t H5MF_sects_dump(H5F_t *f, FILE *stream);
+H5_DLL herr_t H5MF__sects_dump(H5F_t *f, FILE *stream);
-H5_DLL void H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type);
+H5_DLL void H5MF__alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type);
/* 'simple/small/large' section routines */
-H5_DLL H5MF_free_section_t *H5MF_sect_new(unsigned ctype, haddr_t sect_off,
+H5_DLL H5MF_free_section_t *H5MF__sect_new(unsigned ctype, haddr_t sect_off,
hsize_t sect_size);
-H5_DLL herr_t H5MF_sect_free(H5FS_section_info_t *sect);
+H5_DLL herr_t H5MF__sect_free(H5FS_section_info_t *sect);
/* Block aggregator routines */
H5_DLL htri_t H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr,
H5FD_mem_t type, haddr_t abs_blk_end, hsize_t extra_requested);
-H5_DLL htri_t H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
+H5_DLL htri_t H5MF__aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr,
const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink);
-H5_DLL herr_t H5MF_aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr,
+H5_DLL herr_t H5MF__aggr_absorb(const H5F_t *f, H5F_blk_aggr_t *aggr,
H5MF_free_section_t *sect, hbool_t allow_sect_absorb);
-H5_DLL herr_t H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr,
+H5_DLL herr_t H5MF__aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr,
haddr_t *addr, hsize_t *size);
/* Testing routines */
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index fe140a7..3ebc5c8 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -56,44 +56,40 @@
/********************/
/* 'simple/small/large' section callbacks */
-static H5FS_section_info_t *H5MF_sect_deserialize(const H5FS_section_class_t *cls,
+static H5FS_section_info_t *H5MF__sect_deserialize(const H5FS_section_class_t *cls,
const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags);
-static herr_t H5MF_sect_valid(const H5FS_section_class_t *cls,
+static herr_t H5MF__sect_valid(const H5FS_section_class_t *cls,
const H5FS_section_info_t *sect);
-static H5FS_section_info_t *H5MF_sect_split(H5FS_section_info_t *sect,
+static H5FS_section_info_t *H5MF__sect_split(H5FS_section_info_t *sect,
hsize_t frag_size);
/* 'simple' section callbacks */
-static htri_t H5MF_sect_simple_can_merge(const H5FS_section_info_t *sect1,
+static htri_t H5MF__sect_simple_can_merge(const H5FS_section_info_t *sect1,
const H5FS_section_info_t *sect2, void *udata);
-static herr_t H5MF_sect_simple_merge(H5FS_section_info_t **sect1,
+static herr_t H5MF__sect_simple_merge(H5FS_section_info_t **sect1,
H5FS_section_info_t *sect2, void *udata);
-static htri_t H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect,
+static htri_t H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect,
void *udata);
-static herr_t H5MF_sect_simple_shrink(H5FS_section_info_t **_sect,
+static herr_t H5MF__sect_simple_shrink(H5FS_section_info_t **_sect,
void *udata);
/* 'small' section callbacks */
-static herr_t H5MF_sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata);
-static htri_t H5MF_sect_small_can_merge(const H5FS_section_info_t *sect1,
+static herr_t H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata);
+static htri_t H5MF__sect_small_can_merge(const H5FS_section_info_t *sect1,
const H5FS_section_info_t *sect2, void *udata);
-static herr_t H5MF_sect_small_merge(H5FS_section_info_t **sect1,
+static herr_t H5MF__sect_small_merge(H5FS_section_info_t **sect1,
H5FS_section_info_t *sect2, void *udata);
-static htri_t H5MF_sect_small_can_shrink(const H5FS_section_info_t *_sect,
- void *udata);
-static herr_t H5MF_sect_small_shrink(H5FS_section_info_t **_sect,
- void *udata);
/* 'large' section callbacks */
-static htri_t H5MF_sect_large_can_merge(const H5FS_section_info_t *sect1,
+static htri_t H5MF__sect_large_can_merge(const H5FS_section_info_t *sect1,
const H5FS_section_info_t *sect2, void *udata);
-static herr_t H5MF_sect_large_merge(H5FS_section_info_t **sect1,
+static herr_t H5MF__sect_large_merge(H5FS_section_info_t **sect1,
H5FS_section_info_t *sect2, void *udata);
-static htri_t H5MF_sect_large_can_shrink(const H5FS_section_info_t *_sect,
+static htri_t H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect,
void *udata);
-static herr_t H5MF_sect_large_shrink(H5FS_section_info_t **_sect,
+static herr_t H5MF__sect_large_shrink(H5FS_section_info_t **_sect,
void *udata);
/*********************/
@@ -115,14 +111,14 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SIMPLE[1] = {{
/* Object methods */
NULL, /* Add section */
NULL, /* Serialize section */
- H5MF_sect_deserialize, /* Deserialize section */
- H5MF_sect_simple_can_merge, /* Can sections merge? */
- H5MF_sect_simple_merge, /* Merge sections */
- H5MF_sect_simple_can_shrink, /* Can section shrink container?*/
- H5MF_sect_simple_shrink, /* Shrink container w/section */
- H5MF_sect_free, /* Free section */
- H5MF_sect_valid, /* Check validity of section */
- H5MF_sect_split, /* Split section node for alignment */
+ H5MF__sect_deserialize, /* Deserialize section */
+ H5MF__sect_simple_can_merge, /* Can sections merge? */
+ H5MF__sect_simple_merge, /* Merge sections */
+ H5MF__sect_simple_can_shrink, /* Can section shrink container?*/
+ H5MF__sect_simple_shrink, /* Shrink container w/section */
+ H5MF__sect_free, /* Free section */
+ H5MF__sect_valid, /* Check validity of section */
+ H5MF__sect_split, /* Split section node for alignment */
NULL, /* Dump debugging for section */
}};
@@ -139,16 +135,16 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{
NULL, /* Terminate section class */
/* Object methods */
- H5MF_sect_small_add, /* Add section */
+ H5MF__sect_small_add, /* Add section */
NULL, /* Serialize section */
- H5MF_sect_deserialize, /* Deserialize section */
- H5MF_sect_small_can_merge, /* Can sections merge? */
- H5MF_sect_small_merge, /* Merge sections */
- NULL, /* Can section shrink container?*/
- NULL, /* Shrink container w/section */
- H5MF_sect_free, /* Free section */
- H5MF_sect_valid, /* Check validity of section */
- H5MF_sect_split, /* Split section node for alignment */
+ H5MF__sect_deserialize, /* Deserialize section */
+ H5MF__sect_small_can_merge, /* Can sections merge? */
+ H5MF__sect_small_merge, /* Merge sections */
+ NULL, /* Can section shrink container?*/
+ NULL, /* Shrink container w/section */
+ H5MF__sect_free, /* Free section */
+ H5MF__sect_valid, /* Check validity of section */
+ H5MF__sect_split, /* Split section node for alignment */
NULL, /* Dump debugging for section */
}};
@@ -167,14 +163,14 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1] = {{
/* Object methods */
NULL, /* Add section */
NULL, /* Serialize section */
- H5MF_sect_deserialize, /* Deserialize section */
- H5MF_sect_large_can_merge, /* Can sections merge? */
- H5MF_sect_large_merge, /* Merge sections */
- H5MF_sect_large_can_shrink, /* Can section shrink container?*/
- H5MF_sect_large_shrink, /* Shrink container w/section */
- H5MF_sect_free, /* Free section */
- H5MF_sect_valid, /* Check validity of section */
- H5MF_sect_split, /* Split section node for alignment */
+ H5MF__sect_deserialize, /* Deserialize section */
+ H5MF__sect_large_can_merge, /* Can sections merge? */
+ H5MF__sect_large_merge, /* Merge sections */
+ H5MF__sect_large_can_shrink, /* Can section shrink container?*/
+ H5MF__sect_large_shrink, /* Shrink container w/section */
+ H5MF__sect_free, /* Free section */
+ H5MF__sect_valid, /* Check validity of section */
+ H5MF__sect_split, /* Split section node for alignment */
NULL, /* Dump debugging for section */
}};
@@ -196,7 +192,7 @@ H5FL_DEFINE(H5MF_free_section_t);
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_new
+ * Function: H5MF__sect_new
*
* Purpose: Create a new section of "ctype" and return it to the caller
*
@@ -209,12 +205,12 @@ H5FL_DEFINE(H5MF_free_section_t);
*-------------------------------------------------------------------------
*/
H5MF_free_section_t *
-H5MF_sect_new(unsigned ctype, haddr_t sect_off, hsize_t sect_size)
+H5MF__sect_new(unsigned ctype, haddr_t sect_off, hsize_t sect_size)
{
H5MF_free_section_t *sect; /* 'Simple' free space section to add */
H5MF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_PACKAGE
/* Check arguments. */
HDassert(sect_size);
@@ -236,11 +232,11 @@ H5MF_sect_new(unsigned ctype, haddr_t sect_off, hsize_t sect_size)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5MF_sect_new() */
+} /* end H5MF__sect_new() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_free
+ * Function: H5MF__sect_free
*
* Purpose: Free a 'simple/small/large' section node
*
@@ -253,11 +249,11 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5MF_sect_free(H5FS_section_info_t *_sect)
+H5MF__sect_free(H5FS_section_info_t *_sect)
{
H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect; /* File free section */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_PACKAGE_NOERR
/* Check arguments. */
HDassert(sect);
@@ -266,11 +262,11 @@ H5MF_sect_free(H5FS_section_info_t *_sect)
sect = H5FL_FREE(H5MF_free_section_t, sect);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5MF_sect_free() */
+} /* H5MF__sect_free() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_deserialize
+ * Function: H5MF__sect_deserialize
*
* Purpose: Deserialize a buffer into a "live" section
*
@@ -283,14 +279,14 @@ H5MF_sect_free(H5FS_section_info_t *_sect)
*-------------------------------------------------------------------------
*/
static H5FS_section_info_t *
-H5MF_sect_deserialize(const H5FS_section_class_t *cls,
+H5MF__sect_deserialize(const H5FS_section_class_t *cls,
const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr,
hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags)
{
H5MF_free_section_t *sect; /* New section */
H5FS_section_info_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(cls);
@@ -298,7 +294,7 @@ H5MF_sect_deserialize(const H5FS_section_class_t *cls,
HDassert(sect_size);
/* Create free space section for block */
- if(NULL == (sect = H5MF_sect_new(cls->type, sect_addr, sect_size)))
+ if(NULL == (sect = H5MF__sect_new(cls->type, sect_addr, sect_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section")
/* Set return value */
@@ -306,11 +302,11 @@ H5MF_sect_deserialize(const H5FS_section_class_t *cls,
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_deserialize() */
+} /* H5MF__sect_deserialize() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_valid
+ * Function: H5MF__sect_valid
*
* Purpose: Check the validity of a section
*
@@ -323,7 +319,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls,
+H5MF__sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls,
const H5FS_section_info_t
#ifdef NDEBUG
H5_ATTR_UNUSED
@@ -334,17 +330,17 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls,
const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */
#endif /* NDEBUG */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments. */
HDassert(sect);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* H5MF_sect_valid() */
+} /* H5MF__sect_valid() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_split
+ * Function: H5MF__sect_split
*
* Purpose: Split SECT into 2 sections: fragment for alignment & the aligned section
* SECT's addr and size are updated to point to the aligned section
@@ -357,14 +353,14 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls,
*-------------------------------------------------------------------------
*/
static H5FS_section_info_t *
-H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size)
+H5MF__sect_split(H5FS_section_info_t *sect, hsize_t frag_size)
{
H5MF_free_section_t *ret_value = NULL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Allocate space for new section */
- if(NULL == (ret_value = H5MF_sect_new(sect->type, sect->addr, frag_size)))
+ if(NULL == (ret_value = H5MF__sect_new(sect->type, sect->addr, frag_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section")
/* Set new section's info */
@@ -373,14 +369,14 @@ H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size)
done:
FUNC_LEAVE_NOAPI((H5FS_section_info_t *)ret_value)
-} /* end H5MF_sect_split() */
+} /* end H5MF__sect_split() */
/*
* "simple" section callbacks
*/
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_simple_can_merge
+ * Function: H5MF__sect_simple_can_merge
*
* Purpose: Can two sections of this type merge?
*
@@ -395,14 +391,14 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1,
+H5MF__sect_simple_can_merge(const H5FS_section_info_t *_sect1,
const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata)
{
const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */
const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */
htri_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments. */
HDassert(sect1);
@@ -414,11 +410,11 @@ H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1,
ret_value = H5F_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr);
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_simple_can_merge() */
+} /* H5MF__sect_simple_can_merge() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_simple_merge
+ * Function: H5MF__sect_simple_merge
*
* Purpose: Merge two sections of this type
*
@@ -433,14 +429,14 @@ H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1,
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_simple_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
+H5MF__sect_simple_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
void H5_ATTR_UNUSED *_udata)
{
H5MF_free_section_t **sect1 = (H5MF_free_section_t **)_sect1; /* File free section */
H5MF_free_section_t *sect2 = (H5MF_free_section_t *)_sect2; /* File free section */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect1);
@@ -453,16 +449,16 @@ H5MF_sect_simple_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2
(*sect1)->sect_info.size += sect2->sect_info.size;
/* Get rid of second section */
- if(H5MF_sect_free((H5FS_section_info_t *)sect2) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_simple_merge() */
+} /* H5MF__sect_simple_merge() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_simple_can_shrink
+ * Function: H5MF__sect_simple_can_shrink
*
* Purpose: Can this section shrink the container?
*
@@ -475,7 +471,7 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
+H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
{
const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
@@ -483,7 +479,7 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
haddr_t end; /* End of section to extend */
htri_t ret_value = FAIL; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect);
@@ -518,7 +514,7 @@ HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect-
htri_t status; /* Status from aggregator adjoin */
/* See if section can absorb the aggregator & vice versa */
- if((status = H5MF_aggr_can_absorb(udata->f, &(udata->f->shared->meta_aggr), sect, &(udata->shrink))) < 0)
+ if((status = H5MF__aggr_can_absorb(udata->f, &(udata->f->shared->meta_aggr), sect, &(udata->shrink))) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "error merging section with aggregation block")
else if(status > 0) {
/* Set the aggregator to operate on */
@@ -537,7 +533,7 @@ HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins metadata aggregator\n", FUNC,
htri_t status; /* Status from aggregator adjoin */
/* See if section can absorb the aggregator & vice versa */
- if((status = H5MF_aggr_can_absorb(udata->f, &(udata->f->shared->sdata_aggr), sect, &(udata->shrink))) < 0)
+ if((status = H5MF__aggr_can_absorb(udata->f, &(udata->f->shared->sdata_aggr), sect, &(udata->shrink))) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "error merging section with aggregation block")
else if(status > 0) {
/* Set the aggregator to operate on */
@@ -557,11 +553,11 @@ HDfprintf(stderr, "%s: section {%a, %Hu}, adjoins small data aggregator\n", FUNC
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_simple_can_shrink() */
+} /* H5MF__sect_simple_can_shrink() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_simple_shrink
+ * Function: H5MF__sect_simple_shrink
*
* Purpose: Shrink container with section
*
@@ -574,13 +570,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
+H5MF__sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
{
H5MF_free_section_t **sect = (H5MF_free_section_t **)_sect; /* File free section */
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect);
@@ -601,14 +597,14 @@ H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
HDassert(udata->aggr);
/* Absorb the section into the aggregator or vice versa */
- if(H5MF_aggr_absorb(udata->f, udata->aggr, *sect, udata->allow_sect_absorb) < 0)
+ if(H5MF__aggr_absorb(udata->f, udata->aggr, *sect, udata->allow_sect_absorb) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't absorb section into aggregator or vice versa")
} /* end else */
/* Check for freeing section */
if(udata->shrink != H5MF_SHRINK_SECT_ABSORB_AGGR) {
/* Free section */
- if(H5MF_sect_free((H5FS_section_info_t *)*sect) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)*sect) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
/* Mark section as freed, for free space manager */
@@ -617,7 +613,7 @@ H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_simple_shrink() */
+} /* H5MF__sect_simple_shrink() */
/*
* "small" section callbacks
@@ -625,7 +621,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_small_add
+ * Function: H5MF__sect_small_add
*
* Purpose: Perform actions on a small "meta" action before adding it to the free space manager:
* 1) Drop the section if it is at page end and its size <= page end threshold
@@ -640,7 +636,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
+H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
{
H5MF_free_section_t **sect = (H5MF_free_section_t **)_sect; /* Fractal heap free section */
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
@@ -648,7 +644,7 @@ H5MF_sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
hsize_t rem, prem;
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
#ifdef H5MF_ALLOC_DEBUG_MORE
HDfprintf(stderr, "%s: Entering, section {%a, %Hu}\n", FUNC, (*sect)->sect_info.addr, (*sect)->sect_info.size);
@@ -664,7 +660,7 @@ HDfprintf(stderr, "%s: Entering, section {%a, %Hu}\n", FUNC, (*sect)->sect_info.
/* Drop the section if it is at page end and its size is <= pgend threshold */
if(!rem && (*sect)->sect_info.size <= H5F_PGEND_META_THRES(udata->f) && (*flags & H5FS_ADD_RETURNED_SPACE)) {
- if(H5MF_sect_free((H5FS_section_info_t *)(*sect)) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)(*sect)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
*sect = NULL;
*flags &= (unsigned)~H5FS_ADD_RETURNED_SPACE;
@@ -684,122 +680,11 @@ HDfprintf(stderr, "%s: section is adjusted {%a, %Hu}\n", FUNC, (*sect)->sect_inf
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_small_add() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5MF_sect_small_can_shrink
- *
- * Purpose: Can this section shrink the container?
- *
- * Note: A small section is allowed to shrink only at closing.
- *
- * Note: This is unused currently, to maintain the invariant that the
- * file size is always a multiple of the page size.
- *
- * (This function should probably be deleted, or the invariant
- * relaxed)
- *
- * Return: Success: non-negative (TRUE/FALSE)
- * Failure: negative
- *
- * Programmer: Vailin Choi; Dec 2012
- *
- *-------------------------------------------------------------------------
- */
-static htri_t
-H5MF_sect_small_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
-{
- const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */
- H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
- haddr_t eoa; /* End of address space in the file */
- haddr_t end; /* End of section to extend */
- htri_t ret_value = FALSE; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments. */
- HDassert(sect);
- HDassert(udata);
- HDassert(udata->f);
-
- /* Retrieve the end of the file's address space */
- if(HADDR_UNDEF == (eoa = H5FD_get_eoa(udata->f->shared->lf, udata->alloc_type)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
-
- /* Compute address of end of section to check */
- end = sect->sect_info.addr + sect->sect_info.size;
-
- /* Check if the section is exactly at the end of the allocated space in the file */
- if(H5F_addr_eq(end, eoa) && sect->sect_info.size == udata->f->shared->fs_page_size) {
- udata->shrink = H5MF_SHRINK_EOA;
-
-#ifdef H5MF_ALLOC_DEBUG_MORE
-HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect->sect_info.addr, sect->sect_info.size, eoa);
-#endif /* H5MF_ALLOC_DEBUG_MORE */
-
- /* Indicate shrinking can occur */
- HGOTO_DONE(TRUE)
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_small_can_shrink() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5MF_sect_small_shrink
- *
- * Purpose: Shrink container with section
- *
- * Note: This is unused currently, to maintain the invariant that the
- * file size is always a multiple of the page size.
- *
- * (This function should probably be deleted, or the invariant
- * relaxed)
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Vailin Choi; Dec 2012
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5MF_sect_small_shrink(H5FS_section_info_t **_sect, void *_udata)
-{
- H5MF_free_section_t **sect = (H5MF_free_section_t **)_sect; /* File free section */
- H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT
-
- /* Check arguments. */
- HDassert(sect);
- HDassert((*sect)->sect_info.type == H5MF_FSPACE_SECT_SMALL);
- HDassert(udata);
- HDassert(udata->f);
- HDassert(udata->shrink == H5MF_SHRINK_EOA);
- HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR);
-
- /* Release section's space at EOA */
- if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed")
-
- /* Free section */
- if(H5MF_sect_free((H5FS_section_info_t *)*sect) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
-
- /* Mark section as freed, for free space manager */
- *sect = NULL;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_small_shrink() */
+} /* H5MF__sect_small_add() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_small_can_merge
+ * Function: H5MF__sect_small_can_merge
*
* Purpose: Can two sections of this type merge?
*
@@ -814,7 +699,7 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_sect_small_can_merge(const H5FS_section_info_t *_sect1,
+H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1,
const H5FS_section_info_t *_sect2, void *_udata)
{
const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */
@@ -822,7 +707,7 @@ H5MF_sect_small_can_merge(const H5FS_section_info_t *_sect1,
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments. */
HDassert(sect1);
@@ -842,11 +727,11 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_small_can_merge() */
+} /* H5MF__sect_small_can_merge() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_small_merge
+ * Function: H5MF__sect_small_merge
*
* Purpose: Merge two sections of this type
*
@@ -862,7 +747,7 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
+H5MF__sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
void *_udata)
{
H5MF_free_section_t **sect1 = (H5MF_free_section_t **)_sect1; /* File free section */
@@ -870,7 +755,7 @@ H5MF_sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect1);
@@ -894,18 +779,18 @@ H5MF_sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
if(H5PB_remove_entry(udata->f, (*sect1)->sect_info.addr) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section")
- if(H5MF_sect_free((H5FS_section_info_t *)(*sect1)) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)(*sect1)) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
*sect1 = NULL;
} /* end if */
/* Get rid of second section */
- if(H5MF_sect_free((H5FS_section_info_t *)sect2) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_small_merge() */
+} /* H5MF__sect_small_merge() */
/*
* "Large" section callbacks
@@ -913,7 +798,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_large_can_merge (same as H5MF_sect_simple_can_merge)
+ * Function: H5MF__sect_large_can_merge (same as H5MF__sect_simple_can_merge)
*
* Purpose: Can two sections of this type merge?
*
@@ -927,14 +812,14 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_sect_large_can_merge(const H5FS_section_info_t *_sect1,
+H5MF__sect_large_can_merge(const H5FS_section_info_t *_sect1,
const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata)
{
const H5MF_free_section_t *sect1 = (const H5MF_free_section_t *)_sect1; /* File free section */
const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments. */
HDassert(sect1);
@@ -949,11 +834,11 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
#endif /* H5MF_ALLOC_DEBUG_MORE */
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_large_can_merge() */
+} /* H5MF__sect_large_can_merge() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_large_merge (same as H5MF_sect_simple_merge)
+ * Function: H5MF__sect_large_merge (same as H5MF__sect_simple_merge)
*
* Purpose: Merge two sections of this type
*
@@ -967,14 +852,14 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_large_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
+H5MF__sect_large_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
void H5_ATTR_UNUSED *_udata)
{
H5MF_free_section_t **sect1 = (H5MF_free_section_t **)_sect1; /* File free section */
H5MF_free_section_t *sect2 = (H5MF_free_section_t *)_sect2; /* File free section */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect1);
@@ -987,16 +872,16 @@ H5MF_sect_large_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2,
(*sect1)->sect_info.size += sect2->sect_info.size;
/* Get rid of second section */
- if(H5MF_sect_free((H5FS_section_info_t *)sect2) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_large_merge() */
+} /* H5MF__sect_large_merge() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_large_can_shrink
+ * Function: H5MF__sect_large_can_shrink
*
* Purpose: Can this section shrink the container?
*
@@ -1008,7 +893,7 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5MF_sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
+H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
{
const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
@@ -1016,7 +901,7 @@ H5MF_sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
haddr_t end; /* End of section to extend */
htri_t ret_value = FALSE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect);
@@ -1045,11 +930,11 @@ HDfprintf(stderr, "%s: section {%a, %Hu}, shrinks file, eoa = %a\n", FUNC, sect-
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_large_can_shrink() */
+} /* H5MF__sect_large_can_shrink() */
/*-------------------------------------------------------------------------
- * Function: H5MF_sect_large_shrink
+ * Function: H5MF__sect_large_shrink
*
* Purpose: Shrink a large-sized section
*
@@ -1061,14 +946,14 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5MF_sect_large_shrink(H5FS_section_info_t **_sect, void *_udata)
+H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *_udata)
{
H5MF_free_section_t **sect = (H5MF_free_section_t **)_sect; /* File free section */
H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */
hsize_t frag_size = 0; /* Fragment size */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_STATIC
/* Check arguments. */
HDassert(sect);
@@ -1091,7 +976,7 @@ H5MF_sect_large_shrink(H5FS_section_info_t **_sect, void *_udata)
(*sect)->sect_info.size = frag_size;
else {
/* Free section */
- if(H5MF_sect_free((H5FS_section_info_t *)*sect) < 0)
+ if(H5MF__sect_free((H5FS_section_info_t *)*sect) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
/* Mark section as freed, for free space manager */
@@ -1100,5 +985,5 @@ H5MF_sect_large_shrink(H5FS_section_info_t **_sect, void *_udata)
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* H5MF_sect_large_shrink() */
+} /* H5MF__sect_large_shrink() */
diff --git a/src/H5O.c b/src/H5O.c
index f700ac9..c5db814 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -435,63 +435,70 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Oget_info
+ * Function: H5Oget_info2
*
- * Purpose: Retrieve information about an object.
+ * Purpose: Retrieve information about an object.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * NOTE: Add a parameter "fields" to indicate selection of object info.
*
- * Programmer: Quincey Koziol
- * November 21 2006
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Neil Fortner
+ * July 7 2010
*
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info(hid_t loc_id, H5O_info_t *oinfo)
+H5Oget_info2(hid_t loc_id, H5O_info_t *oinfo, unsigned fields)
{
- H5G_loc_t loc; /* Location of group */
+ H5G_loc_t loc; /* Location of group */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE2("e", "i*x", loc_id, oinfo);
+ H5TRACE3("e", "i*xIu", loc_id, oinfo, fields);
/* Check args */
if(H5G_loc(loc_id, &loc) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if(!oinfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+ if(fields & ~H5O_INFO_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields")
/* Retrieve the object's information */
- if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/) < 0)
+ if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Oget_info() */
+} /* end H5Oget_info2() */
-/*-------------------------------------------------------------------------
- * Function: H5Oget_info_by_name
- *
- * Purpose: Retrieve information about an object.
- *
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * November 21 2006
- *
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Function: H5Oget_info_by_name2
+ *
+ * Purpose: Retrieve information about an object.
+ *
+ * NOTE: Add a parameter "fields" to indicate selection of object info.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Neil Fortner
+ * July 7 2010
+ *
+ *-------------------------------------------------------------------------
+ */
herr_t
-H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id)
+H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info_t *oinfo,
+ unsigned fields, hid_t lapl_id)
{
H5G_loc_t loc; /* Location of group */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id);
+ H5TRACE5("e", "i*s*xIui", loc_id, name, oinfo, fields, lapl_id);
/* Check args */
if(H5G_loc(loc_id, &loc) < 0)
@@ -500,44 +507,48 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
if(!oinfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+ if(fields & ~H5O_INFO_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields")
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
/* Retrieve the object's information */
- if(H5O__get_info_by_name(&loc, name, oinfo/*out*/) < 0)
+ if(H5O__get_info_by_name(&loc, name, oinfo/*out*/, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name)
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Oget_info_by_name() */
+} /* end H5Oget_info_by_name2() */
/*-------------------------------------------------------------------------
- * Function: H5Oget_info_by_idx
+ * Function: H5Oget_info_by_idx2
*
- * Purpose: Retrieve information about an object, according to the order
+ * Purpose: Retrieve information about an object, according to the order
* of an index.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * NOTE: Add a parameter "fields" to indicate selection of object info.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
- * November 26 2006
+ * November 26 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id)
+H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields, hid_t lapl_id)
{
H5G_loc_t loc; /* Location of group */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo,
- lapl_id);
+ H5TRACE8("e", "i*sIiIoh*xIui", loc_id, group_name, idx_type, order, n, oinfo,
+ fields, lapl_id);
/* Check args */
if(H5G_loc(loc_id, &loc) < 0)
@@ -550,18 +561,20 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!oinfo)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+ if(fields & ~H5O_INFO_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields")
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
/* Retrieve the object's information */
- if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo) < 0)
+ if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Oget_info_by_idx() */
+} /* end H5Oget_info_by_idx2() */
/*-------------------------------------------------------------------------
@@ -737,9 +750,9 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5Ovisit
+ * Function: H5Ovisit2
*
- * Purpose: Recursively visit an object and all the objects reachable
+ * Purpose: Recursively visit an object and all the objects reachable
* from it. If the starting object is a group, all the objects
* linked to from that group will be visited. Links within
* each group are visited according to the order within the
@@ -755,27 +768,30 @@ done:
* iteration index and iteration order given) will be used to in
* the callback about the object.
*
- * Return: Success: The return value of the first operator that
+ * NOTE: Add a a parameter "fields" to indicate selection of
+ * object info to be retrieved to the callback "op".
+ *
+ * Return: Success: The return value of the first operator that
* returns non-zero, or zero if all members were
* processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
+ * Failure: Negative if something goes wrong within the
* library, or the negative value returned by one
* of the operators.
*
* Programmer: Quincey Koziol
- * November 25 2007
+ * November 25 2007
*
*-------------------------------------------------------------------------
*/
herr_t
-H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
- H5O_iterate_t op, void *op_data)
+H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
+ H5O_iterate_t op, void *op_data, unsigned fields)
{
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data);
+ H5TRACE6("e", "iIiIox*xIu", obj_id, idx_type, order, op, op_data, fields);
/* Check args */
if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
@@ -784,20 +800,22 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
+ if(fields & ~H5O_INFO_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields")
/* Call internal object visitation routine */
- if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data)) < 0)
+ if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data, fields)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Ovisit() */
+} /* end H5Ovisit2() */
/*-------------------------------------------------------------------------
- * Function: H5Ovisit_by_name
+ * Function: H5Ovisit_by_name2
*
- * Purpose: Recursively visit an object and all the objects reachable
+ * Purpose: Recursively visit an object and all the objects reachable
* from it. If the starting object is a group, all the objects
* linked to from that group will be visited. Links within
* each group are visited according to the order within the
@@ -813,28 +831,31 @@ done:
* iteration index and iteration order given) will be used to in
* the callback about the object.
*
- * Return: Success: The return value of the first operator that
+ * NOTE: Add a a parameter "fields" to indicate selection of
+ * object info to be retrieved to the callback "op".
+ *
+ * Return: Success: The return value of the first operator that
* returns non-zero, or zero if all members were
* processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
+ * Failure: Negative if something goes wrong within the
* library, or the negative value returned by one
* of the operators.
*
* Programmer: Quincey Koziol
- * November 24 2007
+ * November 24 2007
*
*-------------------------------------------------------------------------
*/
herr_t
-H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
- H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id)
+H5Ovisit_by_name2(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
+ H5_iter_order_t order, H5O_iterate_t op, void *op_data, unsigned fields, hid_t lapl_id)
{
herr_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
- H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data,
- lapl_id);
+ H5TRACE8("e", "i*sIiIox*xIui", loc_id, obj_name, idx_type, order, op, op_data,
+ fields, lapl_id);
/* Check args */
if(!obj_name || !*obj_name)
@@ -845,18 +866,20 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
if(!op)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
+ if(fields & ~H5O_INFO_ALL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid fields")
/* Verify access property list and set up collective metadata if appropriate */
if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
/* Call internal object visitation routine */
- if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data)) < 0)
+ if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data, fields)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
done:
FUNC_LEAVE_API(ret_value)
-} /* end H5Ovisit_by_name() */
+} /* end H5Ovisit_by_name2() */
/*-------------------------------------------------------------------------
diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c
new file mode 100644
index 0000000..876579d
--- /dev/null
+++ b/src/H5Odeprec.c
@@ -0,0 +1,332 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*-------------------------------------------------------------------------
+ *
+ * Purpose: Deprecated functions from the H5O interface. These
+ * functions are here for compatibility purposes and may be
+ * removed in the future. Applications should switch to the
+ * newer APIs.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#include "H5Omodule.h" /* This source code file is part of the H5O module */
+
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Opkg.h" /* Object headers */
+
+
+/****************/
+/* Local Macros */
+/****************/
+
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Package Typedefs */
+/********************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Oget_info1
+ *
+ * Purpose: Retrieve information about an object.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Oget_info1(hid_t loc_id, H5O_info_t *oinfo)
+{
+ H5G_loc_t loc; /* Location of group */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE2("e", "i*x", loc_id, oinfo);
+
+ /* Check args */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ if(!oinfo)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+
+ /* Retrieve the object's information */
+ if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/, H5O_INFO_ALL) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Oget_info1() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Oget_info_by_name1
+ *
+ * Purpose: Retrieve information about an object.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id)
+{
+ H5G_loc_t loc; /* Location of group */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id);
+
+ /* Check args */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ if(!name || !*name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ if(!oinfo)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Retrieve the object's information */
+ if(H5O__get_info_by_name(&loc, name, oinfo/*out*/, H5O_INFO_ALL) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name)
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Oget_info_by_name1() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Oget_info_by_idx1
+ *
+ * Purpose: Retrieve information about an object, according to the order
+ * of an index.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * November 26 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type,
+ H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id)
+{
+ H5G_loc_t loc; /* Location of group */
+ H5G_loc_t obj_loc; /* Location used to open group */
+ H5G_name_t obj_path; /* Opened object group hier. path */
+ H5O_loc_t obj_oloc; /* Opened object object location */
+ hbool_t loc_found = FALSE; /* Entry at 'name' found */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo,
+ lapl_id);
+
+ /* Check args */
+ if(H5G_loc(loc_id, &loc) < 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ if(!group_name || !*group_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified")
+ if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ if(!oinfo)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Retrieve the object's information */
+ if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo, H5O_INFO_ALL) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object")
+
+done:
+ /* Release the object location */
+ if(loc_found && H5G_loc_free(&obj_loc) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location")
+
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Oget_info_by_idx1() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Ovisit1
+ *
+ * Purpose: Recursively visit an object and all the objects reachable
+ * from it. If the starting object is a group, all the objects
+ * linked to from that group will be visited. Links within
+ * each group are visited according to the order within the
+ * specified index (unless the specified index does not exist for
+ * a particular group, then the "name" index is used).
+ *
+ * NOTE: Soft links and user-defined links are ignored during
+ * this operation.
+ *
+ * NOTE: Each _object_ reachable from the initial group will only
+ * be visited once. If multiple hard links point to the same
+ * object, the first link to the object's path (according to the
+ * iteration index and iteration order given) will be used to in
+ * the callback about the object.
+ *
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
+ *
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
+ *
+ * Programmer: Quincey Koziol
+ * November 25 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
+ H5O_iterate_t op, void *op_data)
+{
+ herr_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data);
+
+ /* Check args */
+ if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ if(!op)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
+
+ /* Call internal object visitation routine */
+ if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data, H5O_INFO_ALL)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Ovisit1() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Ovisit_by_name1
+ *
+ * Purpose: Recursively visit an object and all the objects reachable
+ * from it. If the starting object is a group, all the objects
+ * linked to from that group will be visited. Links within
+ * each group are visited according to the order within the
+ * specified index (unless the specified index does not exist for
+ * a particular group, then the "name" index is used).
+ *
+ * NOTE: Soft links and user-defined links are ignored during
+ * this operation.
+ *
+ * NOTE: Each _object_ reachable from the initial group will only
+ * be visited once. If multiple hard links point to the same
+ * object, the first link to the object's path (according to the
+ * iteration index and iteration order given) will be used to in
+ * the callback about the object.
+ *
+ * Return: Success: The return value of the first operator that
+ * returns non-zero, or zero if all members were
+ * processed with no operator returning non-zero.
+ *
+ * Failure: Negative if something goes wrong within the
+ * library, or the negative value returned by one
+ * of the operators.
+ *
+ * Programmer: Quincey Koziol
+ * November 24 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Ovisit_by_name1(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
+ H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id)
+{
+ herr_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(FAIL)
+ H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data,
+ lapl_id);
+
+ /* Check args */
+ if(!obj_name || !*obj_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
+ if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
+ if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
+ if(!op)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified")
+
+ /* Verify access property list and set up collective metadata if appropriate */
+ if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info")
+
+ /* Call internal object visitation routine */
+ if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data, H5O_INFO_ALL)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Ovisit_by_name1() */
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
diff --git a/src/H5Oint.c b/src/H5Oint.c
index c9e82c0..2752a25 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -61,6 +61,7 @@ typedef struct {
H5SL_t *visited; /* Skip list for tracking visited nodes */
H5O_iterate_t op; /* Application callback */
void *op_data; /* Application's op data */
+ unsigned fields; /* Selection of object info */
} H5O_iter_visit_ud_t;
@@ -2211,20 +2212,22 @@ H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr)
/*-------------------------------------------------------------------------
- * Function: H5O_get_info
+ * Function: H5O_get_info
*
- * Purpose: Retrieve the information for an object
+ * Purpose: Retrieve the information for an object
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Note: Add a parameter "fields" to indicate selection of object info.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
*
- * Programmer: Quincey Koziol
- * November 21 2006
+ * Programmer: Quincey Koziol
+ * November 21 2006
*
*-------------------------------------------------------------------------
*/
herr_t
-H5O_get_info(const H5O_loc_t *loc, hbool_t want_ih_info, H5O_info_t *oinfo)
+H5O_get_info(const H5O_loc_t *loc, H5O_info_t *oinfo, unsigned fields)
{
const H5O_obj_class_t *obj_class; /* Class of object for header */
H5O_t *oh = NULL; /* Object header */
@@ -2240,76 +2243,83 @@ H5O_get_info(const H5O_loc_t *loc, hbool_t want_ih_info, H5O_info_t *oinfo)
if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header")
- /* Reset the object info structure */
- HDmemset(oinfo, 0, sizeof(*oinfo));
-
- /* Retrieve the file's fileno */
- H5F_GET_FILENO(loc->file, oinfo->fileno);
-
- /* Set the object's address */
- oinfo->addr = loc->addr;
-
/* Get class for object */
if(NULL == (obj_class = H5O__obj_class_real(oh)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class")
- /* Retrieve the type of the object */
- oinfo->type = obj_class->type;
+ /* Reset the object info structure */
+ HDmemset(oinfo, 0, sizeof(*oinfo));
- /* Set the object's reference count */
- oinfo->rc = oh->nlink;
+ /* Get basic information, if requested */
+ if(fields & H5O_INFO_BASIC) {
+ /* Retrieve the file's fileno */
+ H5F_GET_FILENO(loc->file, oinfo->fileno);
- /* Get modification time for object */
- if(oh->version > H5O_VERSION_1) {
- oinfo->atime = oh->atime;
- oinfo->mtime = oh->mtime;
- oinfo->ctime = oh->ctime;
- oinfo->btime = oh->btime;
- } /* end if */
- else {
- htri_t exists; /* Flag if header message of interest exists */
+ /* Set the object's address */
+ oinfo->addr = loc->addr;
- /* No information for access & modification fields */
- /* (we stopped updating the "modification time" header message for
- * raw data changes, so the "modification time" header message
- * is closest to the 'change time', in POSIX terms - QAK)
- */
- oinfo->atime = 0;
- oinfo->mtime = 0;
- oinfo->btime = 0;
-
- /* Might be information for modification time */
- if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_ID)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message")
- if(exists > 0) {
- /* Get "old style" modification time info */
- if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_ID, &oinfo->ctime))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message")
+ /* Retrieve the type of the object */
+ oinfo->type = obj_class->type;
+
+ /* Set the object's reference count */
+ oinfo->rc = oh->nlink;
+ }
+
+ /* Get time information, if requested */
+ if(fields & H5O_INFO_TIME) {
+ if(oh->version > H5O_VERSION_1) {
+ oinfo->atime = oh->atime;
+ oinfo->mtime = oh->mtime;
+ oinfo->ctime = oh->ctime;
+ oinfo->btime = oh->btime;
} /* end if */
else {
- /* Check for "new style" modification time info */
- if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_NEW_ID)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message")
- if(exists > 0) {
- /* Get "new style" modification time info */
- if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_NEW_ID, &oinfo->ctime))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message")
+ htri_t exists; /* Flag if header message of interest exists */
+
+ /* No information for access & modification fields */
+ /* (we stopped updating the "modification time" header message for
+ * raw data changes, so the "modification time" header message
+ * is closest to the 'change time', in POSIX terms - QAK)
+ */
+ oinfo->atime = 0;
+ oinfo->mtime = 0;
+ oinfo->btime = 0;
+
+ /* Might be information for modification time */
+ if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_ID)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message")
+ if(exists > 0) {
+ /* Get "old style" modification time info */
+ if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_ID, &oinfo->ctime))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message")
} /* end if */
- else
- oinfo->ctime = 0;
- } /* end else */
- } /* end else */
+ else {
+ /* Check for "new style" modification time info */
+ if((exists = H5O_msg_exists_oh(oh, H5O_MTIME_NEW_ID)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message")
+ if(exists > 0) {
+ /* Get "new style" modification time info */
+ if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_NEW_ID, &oinfo->ctime))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message")
+ } /* end if */
+ else
+ oinfo->ctime = 0;
+ } /* end else */
+ } /* end else */
+ } /* end if */
- /* Get the information for the object header */
- if(H5O__get_hdr_info_real(oh, &oinfo->hdr) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info")
+ /* Get the information for the object header, if requested */
+ if(fields & H5O_INFO_HDR)
+ if(H5O__get_hdr_info_real(oh, &oinfo->hdr) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info")
/* Retrieve # of attributes */
- if(H5O_attr_count_real(loc->file, oh, &oinfo->num_attrs) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count")
+ if(fields & H5O_INFO_NUM_ATTRS)
+ if(H5O_attr_count_real(loc->file, oh, &oinfo->num_attrs) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count")
/* Get B-tree & heap metadata storage size, if requested */
- if(want_ih_info) {
+ if(fields & H5O_INFO_META_SIZE) {
/* Check for 'bh_info' callback for this type of object */
if(obj_class->bh_info)
/* Call the object's class 'bh_info' routine */
@@ -2317,9 +2327,10 @@ H5O_get_info(const H5O_loc_t *loc, hbool_t want_ih_info, H5O_info_t *oinfo)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info")
/* Get B-tree & heap info for any attributes */
- if(oinfo->num_attrs > 0)
+ if(!(fields & H5O_INFO_NUM_ATTRS) || oinfo->num_attrs > 0) {
if(H5O__attr_bh_info(loc->file, oh, &oinfo->meta_size.attr) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute btree & heap info")
+ } /* end if */
} /* end if */
done:
@@ -2338,16 +2349,18 @@ done:
* Note: This routine is needed so that there's a non-API routine
* that can set up VOL / SWMR info (which need a DXPL).
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Note: Add a parameter "fields" to indicate selection of object info.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
- * December 28, 2017
+ * December 28, 2017
*
*-------------------------------------------------------------------------
*/
herr_t
-H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo)
+H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo, unsigned fields)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -2359,7 +2372,7 @@ H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo)
HDassert(oinfo);
/* Retrieve the object's information */
- if(H5G_loc_info(loc, name, TRUE, oinfo/*out*/) < 0)
+ if(H5G_loc_info(loc, name, oinfo/*out*/, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info")
done:
@@ -2376,17 +2389,19 @@ done:
* Note: This routine is needed so that there's a non-API routine
* that can set up VOL / SWMR info (which need a DXPL).
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Note: Add a parameter "fields" to indicate selection of object info.
*
- * Programmer: Quincey Koziol
- * December 28, 2017
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * December 28, 2017
*
*-------------------------------------------------------------------------
*/
herr_t
H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type,
- H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo)
+ H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields)
{
H5G_loc_t obj_loc; /* Location used to open group */
H5G_name_t obj_path; /* Opened object group hier. path */
@@ -2412,7 +2427,7 @@ H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t id
loc_found = TRUE;
/* Retrieve the object's information */
- if(H5O_get_info(obj_loc.oloc, TRUE, oinfo) < 0)
+ if(H5O_get_info(obj_loc.oloc, oinfo, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info")
done:
@@ -2793,7 +2808,7 @@ H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *li
H5O_info_t oinfo; /* Object info */
/* Get the object's info */
- if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0)
+ if(H5O_get_info(&obj_oloc, &oinfo, udata->fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info")
/* Make the application callback */
@@ -2833,7 +2848,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5O__visit
*
- * Purpose: Recursively visit an object and all the objects reachable
+ * Purpose: Recursively visit an object and all the objects reachable
* from it. If the starting object is a group, all the objects
* linked to from that group will be visited. Links within
* each group are visited according to the order within the
@@ -2849,22 +2864,24 @@ done:
* iteration index and iteration order given) will be used to in
* the callback about the object.
*
- * Return: Success: The return value of the first operator that
+ * Note: Add a parameter "fields" to indicate selection of object info.
+ *
+ * Return: Success: The return value of the first operator that
* returns non-zero, or zero if all members were
* processed with no operator returning non-zero.
*
- * Failure: Negative if something goes wrong within the
+ * Failure: Negative if something goes wrong within the
* library, or the negative value returned by one
* of the operators.
*
* Programmer: Quincey Koziol
- * November 24 2007
+ * November 24 2007
*
*-------------------------------------------------------------------------
*/
herr_t
H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
- H5_iter_order_t order, H5O_iterate_t op, void *op_data)
+ H5_iter_order_t order, H5O_iterate_t op, void *op_data, unsigned fields)
{
H5O_iter_visit_ud_t udata; /* User data for callback */
H5G_loc_t loc; /* Location of reference object */
@@ -2896,7 +2913,7 @@ H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
loc_found = TRUE;
/* Get the object's info */
- if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0)
+ if(H5O_get_info(&obj_oloc, &oinfo, fields) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info")
/* Open the object */
@@ -2925,6 +2942,7 @@ H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
udata.start_loc = &start_loc;
udata.op = op;
udata.op_data = op_data;
+ udata.fields = fields;
/* Create skip list to store visited object information */
if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL)
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index f535e50..616f96b 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -567,15 +567,15 @@ H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted);
H5_DLL herr_t H5O__link(const H5O_loc_t *loc, int adjust);
H5_DLL htri_t H5O__exists_by_name(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5O__get_info_by_name(const H5G_loc_t *loc, const char *name,
- H5O_info_t *oinfo);
+ H5O_info_t *oinfo, unsigned fields);
H5_DLL herr_t H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name,
- H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo);
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, unsigned fields);
H5_DLL herr_t H5O__set_comment_by_name(const H5G_loc_t *loc, const char *name,
const char *comment);
H5_DLL ssize_t H5O__get_comment_by_name(const H5G_loc_t *loc, const char *name,
char *comment, size_t bufsize);
H5_DLL herr_t H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
- H5_iter_order_t order, H5O_iterate_t op, void *op_data);
+ H5_iter_order_t order, H5O_iterate_t op, void *op_data, unsigned fields);
H5_DLL herr_t H5O__inc_rc(H5O_t *oh);
H5_DLL herr_t H5O__dec_rc(H5O_t *oh);
H5_DLL herr_t H5O__free(H5O_t *oh);
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 696fd38..10063d5 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -881,8 +881,7 @@ H5_DLL herr_t H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned mesg_id, unsigned mesg_
#endif /* H5O_ENABLE_BOGUS */
H5_DLL herr_t H5O_delete(H5F_t *f, haddr_t addr);
H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, H5O_hdr_info_t *hdr);
-H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hbool_t want_ih_info,
- H5O_info_t *oinfo);
+H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, H5O_info_t *oinfo, unsigned fields);
H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type);
H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, struct H5P_genplist_t *oc_plist);
H5_DLL hid_t H5O_open_name(const H5G_loc_t *loc, const char *name, hbool_t app_ref);
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 8d6dda4..da2910d 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -73,6 +73,17 @@
#define H5O_SHMESG_MAX_NINDEXES 8
#define H5O_SHMESG_MAX_LIST_SIZE 5000
+/* Flags for H5Oget_info.
+ * Theses flags determine which fields will be filled in in the H5O_info_t
+ * struct.
+ */
+#define H5O_INFO_BASIC 0x0001u /* Fill in the fileno, addr, type, and rc fields */
+#define H5O_INFO_TIME 0x0002u /* Fill in the atime, mtime, ctime, and btime fields */
+#define H5O_INFO_NUM_ATTRS 0x0004u /* Fill in the num_attrs field */
+#define H5O_INFO_HDR 0x0008u /* Fill in the hdr field */
+#define H5O_INFO_META_SIZE 0x0010u /* Fill in the meta_size field */
+#define H5O_INFO_ALL (H5O_INFO_BASIC | H5O_INFO_TIME | H5O_INFO_NUM_ATTRS | H5O_INFO_HDR | H5O_INFO_META_SIZE)
+
/*******************/
/* Public Typedefs */
/*******************/
@@ -156,12 +167,12 @@ H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr);
H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id);
H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id);
-H5_DLL herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo);
-H5_DLL herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo,
- hid_t lapl_id);
-H5_DLL herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name,
+H5_DLL herr_t H5Oget_info2(hid_t loc_id, H5O_info_t *oinfo, unsigned fields);
+H5_DLL herr_t H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info_t *oinfo,
+ unsigned fields, hid_t lapl_id);
+H5_DLL herr_t H5Oget_info_by_idx2(hid_t loc_id, const char *group_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo,
- hid_t lapl_id);
+ unsigned fields, hid_t lapl_id);
H5_DLL herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name,
hid_t lcpl_id, hid_t lapl_id);
H5_DLL herr_t H5Oincr_refcount(hid_t object_id);
@@ -174,11 +185,11 @@ H5_DLL herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name,
H5_DLL ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize);
H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name,
char *comment, size_t bufsize, hid_t lapl_id);
-H5_DLL herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
- H5O_iterate_t op, void *op_data);
-H5_DLL herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name,
+H5_DLL herr_t H5Ovisit2(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
+ H5O_iterate_t op, void *op_data, unsigned fields);
+H5_DLL herr_t H5Ovisit_by_name2(hid_t loc_id, const char *obj_name,
H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op,
- void *op_data, hid_t lapl_id);
+ void *op_data, unsigned fields, hid_t lapl_id);
H5_DLL herr_t H5Oclose(hid_t object_id);
H5_DLL herr_t H5Oflush(hid_t obj_id);
H5_DLL herr_t H5Orefresh(hid_t oid);
@@ -205,7 +216,18 @@ typedef struct H5O_stat_t {
} H5O_stat_t;
/* Function prototypes */
+H5_DLL herr_t H5Oget_info1(hid_t loc_id, H5O_info_t *oinfo);
+H5_DLL herr_t H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info_t *oinfo,
+ hid_t lapl_id);
+H5_DLL herr_t H5Oget_info_by_idx1(hid_t loc_id, const char *group_name,
+ H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo,
+ hid_t lapl_id);
+H5_DLL herr_t H5Ovisit1(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
+ H5O_iterate_t op, void *op_data);
+H5_DLL herr_t H5Ovisit_by_name1(hid_t loc_id, const char *obj_name,
+ H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op,
+ void *op_data, hid_t lapl_id);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifdef __cplusplus
diff --git a/src/H5PB.c b/src/H5PB.c
index dab69f4..a325ad1 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -254,23 +254,23 @@ H5PB_print_stats(const H5PB_t *page_buf)
printf("PAGE BUFFER STATISTICS:\n");
- printf("******* METADATA\n");
- printf("\t Total Accesses: %u\n", page_buf->accesses[0]);
- printf("\t Hits: %u\n", page_buf->hits[0]);
- printf("\t Misses: %u\n", page_buf->misses[0]);
- printf("\t Evictions: %u\n", page_buf->evictions[0]);
- printf("\t Bypasses: %u\n", page_buf->bypasses[0]);
- printf("\t Hit Rate = %f%%\n", ((double)page_buf->hits[0]/(page_buf->accesses[0] - page_buf->bypasses[0]))*100);
- printf("*****************\n\n");
-
- printf("******* RAWDATA\n");
- printf("\t Total Accesses: %u\n", page_buf->accesses[1]);
- printf("\t Hits: %u\n", page_buf->hits[1]);
- printf("\t Misses: %u\n", page_buf->misses[1]);
- printf("\t Evictions: %u\n", page_buf->evictions[1]);
- printf("\t Bypasses: %u\n", page_buf->bypasses[1]);
- printf("\t Hit Rate = %f%%\n", ((double)page_buf->hits[1]/(page_buf->accesses[1]-page_buf->bypasses[0]))*100);
- printf("*****************\n\n");
+ HDprintf("******* METADATA\n");
+ HDprintf("\t Total Accesses: %u\n", page_buf->accesses[0]);
+ HDprintf("\t Hits: %u\n", page_buf->hits[0]);
+ HDprintf("\t Misses: %u\n", page_buf->misses[0]);
+ HDprintf("\t Evictions: %u\n", page_buf->evictions[0]);
+ HDprintf("\t Bypasses: %u\n", page_buf->bypasses[0]);
+ HDprintf("\t Hit Rate = %f%%\n", ((double)page_buf->hits[0]/(page_buf->accesses[0] - page_buf->bypasses[0]))*100);
+ HDprintf("*****************\n\n");
+
+ HDprintf("******* RAWDATA\n");
+ HDprintf("\t Total Accesses: %u\n", page_buf->accesses[1]);
+ HDprintf("\t Hits: %u\n", page_buf->hits[1]);
+ HDprintf("\t Misses: %u\n", page_buf->misses[1]);
+ HDprintf("\t Evictions: %u\n", page_buf->evictions[1]);
+ HDprintf("\t Bypasses: %u\n", page_buf->bypasses[1]);
+ HDprintf("\t Hit Rate = %f%%\n", ((double)page_buf->hits[1]/(page_buf->accesses[1]-page_buf->bypasses[0]))*100);
+ HDprintf("*****************\n\n");
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5PB_print_stats */
diff --git a/src/H5R.c b/src/H5R.c
index ab73b59..95abc32 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -141,7 +141,7 @@ done:
void *ref; IN: Reference to open.
RETURNS
- Valid ID on success, Negative on failure
+ Valid ID on success, H5I_INVALID_HID on failure
DESCRIPTION
Given a reference to some object, open that object and return an ID for
that object.
@@ -203,7 +203,7 @@ done:
void *ref; IN: Reference to open.
RETURNS
- Valid ID on success, Negative on failure
+ Valid ID on success, H5I_INVALID_HID on failure
DESCRIPTION
Given a reference to some object, creates a copy of the dataset pointed
to's dataspace and defines a selection in the copy which is the region
@@ -311,7 +311,7 @@ done:
when passing in the size)
RETURNS
- Non-negative length of the path on success, Negative on failure
+ Non-negative length of the path on success, -1 on failure
DESCRIPTION
Given a reference to some object, determine a path to the object
referenced in the file.
@@ -335,23 +335,23 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name,
H5F_t *file; /* File object */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_API(FAIL)
+ FUNC_ENTER_API((-1))
H5TRACE5("Zs", "iRt*x*sz", id, ref_type, _ref, name, size);
/* Check args */
if (H5G_loc(id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not a location")
if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "invalid reference type")
if (_ref == NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "invalid reference pointer")
/* Get the file pointer from the entry */
file = loc.oloc->file;
/* Get name */
if((ret_value = H5R__get_name(file, id, ref_type, _ref, name, size)) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "unable to determine object path")
done:
FUNC_LEAVE_API(ret_value)
diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c
index 2f41f7d..fb62430 100644
--- a/src/H5Rdeprec.c
+++ b/src/H5Rdeprec.c
@@ -141,7 +141,7 @@ done:
* ref IN: Reference to open
*
* Return: Success: Valid HDF5 ID
- * Failure: Negative
+ * Failure: H5I_INVALID_HID
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 02f7778..761ba44 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -587,7 +587,7 @@ done:
H5F_t *file; IN: File the object being dereferenced is within
H5R_type_t ref_type; IN: Type of reference to query
void *ref; IN: Reference to query.
- H5O_type_t *obj_type; OUT: The type of the object, set on success
+ H5O_type_t *obj_type; OUT: The type of the object, set on success
RETURNS
Non-negative on success/Negative on failure
@@ -678,12 +678,12 @@ done:
hid_t lapl_id; IN: LAPL to use for operation
hid_t id; IN: Location ID given for reference
H5R_type_t ref_type; IN: Type of reference
- void *ref; IN: Reference to query.
+ void *_ref; IN: Reference to query.
char *name; OUT: Buffer to place name of object referenced
size_t size; IN: Size of name buffer
RETURNS
- Non-negative length of the path on success, Negative on failure
+ Non-negative length of the path on success, -1 on failure
DESCRIPTION
Given a reference to some object, determine a path to the object
referenced in the file.
@@ -732,7 +732,7 @@ H5R__get_name(H5F_t *f, hid_t id, H5R_type_t ref_type, const void *_ref,
/* Get the dataset region from the heap (allocate inside routine) */
if ((buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL)) == NULL)
- HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, (-1), "Unable to read dataset region information")
/* Get the object oid for the dataset */
p = buf;
@@ -747,22 +747,21 @@ H5R__get_name(H5F_t *f, hid_t id, H5R_type_t ref_type, const void *_ref,
case H5R_BADTYPE:
case H5R_MAXTYPE:
default:
- HDassert("unknown reference type" && 0);
- HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, (-1), "internal error (unknown reference type)")
} /* end switch */
/* Retrieve file ID for name search */
if ((file_id = H5I_get_file_id(id, FALSE)) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't retrieve file ID")
/* Get name, length, etc. */
if ((ret_value = H5G_get_name_by_addr(file_id, &oloc, name, size)) < 0)
- HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't determine name")
+ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, (-1), "can't determine name")
done:
/* Close file ID used for search */
if (file_id > 0 && H5I_dec_ref(file_id) < 0)
- HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID")
+ HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, (-1), "can't decrement ref count of temp ID")
FUNC_LEAVE_NOAPI_VOL(ret_value)
} /* end H5R__get_name() */
diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h
index 49261eb..fbbff50 100644
--- a/src/H5Rpkg.h
+++ b/src/H5Rpkg.h
@@ -26,6 +26,11 @@
#include "H5Rprivate.h"
/* Other private headers needed by this file */
+#include "H5Fprivate.h" /* Files */
+#include "H5Gprivate.h" /* Groups */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Sprivate.h" /* Dataspaces */
+
/**************************/
/* Package Private Macros */
diff --git a/src/H5vers.txt b/src/H5vers.txt
index 0303bf5..914c30e 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -56,6 +56,11 @@ FUNCTION: H5Ewalk; H5E_walk, H5E_error; v10, v18
FUNCTION: H5Fget_info; H5F_info; v18, v110
FUNCTION: H5Gcreate; ; v10, v18
FUNCTION: H5Gopen; ; v10, v18
+FUNCTION: H5Oget_info; ; v18, v112
+FUNCTION: H5Oget_info_by_name; ; v18, v112
+FUNCTION: H5Oget_info_by_idx; ; v18, v112
+FUNCTION: H5Ovisit; ; v18, v112
+FUNCTION: H5Ovisit_by_name; ; v18, v112
FUNCTION: H5Pget_filter; ; v10, v18
FUNCTION: H5Pget_filter_by_id; ; v16, v18
FUNCTION: H5Pinsert; ; v14, v18
diff --git a/src/Makefile.am b/src/Makefile.am
index 21f3966..a0defad 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -80,7 +80,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \
H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
H5MM.c H5MP.c H5MPtest.c \
- H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
+ H5O.c H5Odeprec.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
H5Oattribute.c H5Obogus.c H5Obtreek.c H5Ocache.c H5Ocache_image.c \
H5Ochunk.c \
H5Ocont.c H5Ocopy.c H5Odbg.c H5Odrvinfo.c H5Odtype.c H5Oefl.c \