summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2007-07-13 21:12:25 (GMT)
commitd44b27ddcc66a8ed55f5069eabbf4c287ce1d99a (patch)
treeab22bfaa95add178894e6c649dc4b8aea0d196f4 /src/H5F.c
parent31a2af29ca7aa91fcd47eb018a02ff2e425c5b55 (diff)
downloadhdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.zip
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.gz
hdf5-d44b27ddcc66a8ed55f5069eabbf4c287ce1d99a.tar.bz2
[svn-r13978] purpose:
New feature. Description: Added routines to report on the amount of storage for: 1) 1.6 btree and heap storage info for groups 2) 1.8 btree, fractal heap storage info for groups, attributes and SOHM table 3) btree storage for chunked datasets 4) 1.8 superblock extension size. Platform tested: h5committested.
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 87bb111..ebbc3f2 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -3584,4 +3584,49 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size)
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Fget_name() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5Fget_info
+ * 1. Get storage size for superblock extension if there is one
+ * 2. Get the amount of btree and heap storage for entries
+ * in the SOHM table if there is one.
+ * Consider success when there is no superblock extension and/or SOHM table
+ *
+ * Return: Success: non-negative on success
+ * Failure: Negative
+ *
+ * Programmer: Vailin Choi
+ * July 11, 2007
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Fget_info(hid_t obj_id, H5F_info_t *finfo)
+{
+ H5F_t *f;
+ herr_t ret_value=SUCCEED;
+
+ FUNC_ENTER_API(H5Fget_info, FAIL)
+ HDassert(finfo);
+
+ HDmemset(finfo, 0, sizeof(H5F_info_t));
+ if(H5I_get_type(obj_id) == H5I_FILE ) {
+ if(NULL == (f = H5I_object(obj_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file")
+ else {
+ HDassert(f->shared);
+ if (H5F_addr_defined(f->shared->extension_addr)) {
+ if (H5F_super_ext_info(f, finfo, H5AC_ind_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size")
+ }
+ if(H5F_addr_defined(f->shared->sohm_addr)) {
+ if (H5SM_ih_info(f, finfo, H5AC_ind_dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM btree & heap storage info")
+ }
+ }
+ } else
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid object ID")
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5Fget_info() */