summaryrefslogtreecommitdiffstats
path: root/src/H5FS.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-08-14 13:33:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-08-14 13:33:14 (GMT)
commit4dc989f28232245dbc2f52c1330346868099234e (patch)
treed063e00bd62d863f93e3ceed6f810c03c8b410a9 /src/H5FS.c
parentabd36a6f6ed8a19c2253209dd2f2632c1df34a29 (diff)
downloadhdf5-4dc989f28232245dbc2f52c1330346868099234e.zip
hdf5-4dc989f28232245dbc2f52c1330346868099234e.tar.gz
hdf5-4dc989f28232245dbc2f52c1330346868099234e.tar.bz2
[svn-r14083] Description:
Correct problem with fractal heap's free space size usage gathering routine, which was "poisoning the cache" by loading an incorrectly initialized piece of metadata from the file. Tested on: FreeBSD/32 6.2 (duty) Mac OS X/32 6.2 (amazon)
Diffstat (limited to 'src/H5FS.c')
-rw-r--r--src/H5FS.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/H5FS.c b/src/H5FS.c
index e34f176..1b8ef90 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -167,7 +167,7 @@ H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, size_t nclasses,
FUNC_ENTER_NOAPI(H5FS_open, NULL)
#ifdef QAK
-HDfprintf(stderr, "%s: Opening free space manager\n", FUNC);
+HDfprintf(stderr, "%s: Opening free space manager, nclasses = %Zu\n", FUNC, nclasses);
#endif /* QAK */
/* Check arguments. */
@@ -467,40 +467,21 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_size(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, hsize_t *meta_size)
+H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size)
{
- H5FS_t *fspace = NULL; /* Free space header info */
- H5FS_prot_t fs_prot; /* Information for protecting free space manager */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5FS_size, FAIL)
+ FUNC_ENTER_NOAPI_NOFUNC(H5FS_size)
/*
* Check arguments.
*/
HDassert(f);
- HDassert(H5F_addr_defined(fs_addr));
+ HDassert(fspace);
HDassert(meta_size);
- /* Initialize user data for protecting the free space manager */
- fs_prot.nclasses = 0;
- fs_prot.classes = NULL;
- fs_prot.cls_init_udata = NULL;
-
- /*
- * Load the free space header.
- */
- if(NULL == (fspace = H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &fs_prot, NULL, H5AC_READ)))
- HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header")
-
/* Get the free space size info */
*meta_size += H5FS_HEADER_SIZE(f) + fspace->alloc_sect_size;
-done:
- if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0)
- HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header")
-
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FS_size() */
#ifdef H5FS_DEBUG