summaryrefslogtreecommitdiffstats
path: root/src/H5FS.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-27 20:27:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-27 20:27:13 (GMT)
commit9f90e06bd0b400f5b5d9631eb680c00da3199894 (patch)
treea707a89c16689e8dee5eb927ffacd7ec5a7de91d /src/H5FS.c
parent2f5164b1047a705e81fff46f1b8107426cbcc61b (diff)
downloadhdf5-9f90e06bd0b400f5b5d9631eb680c00da3199894.zip
hdf5-9f90e06bd0b400f5b5d9631eb680c00da3199894.tar.gz
hdf5-9f90e06bd0b400f5b5d9631eb680c00da3199894.tar.bz2
[svn-r18917] Description:
Bring r18911 (plus some adaptions to match the code on the trunk) from the metadata journaling "merging" branch to the trunk: More general changes to align trunk with eventual changes from metadata journaling branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FS.c')
-rw-r--r--src/H5FS.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5FS.c b/src/H5FS.c
index 459b16f..84ecce8 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -123,7 +123,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl
/*
* Allocate free space structure
*/
- if(NULL == (fspace = H5FS_new(nclasses, classes, cls_init_udata)))
+ if(NULL == (fspace = H5FS_new(f, nclasses, classes, cls_init_udata)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for free space free list")
/* Initialize creation information for free space manager */
@@ -139,7 +139,7 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl
/* Check if the free space tracker is supposed to be persistant */
if(fs_addr) {
/* Allocate space for the free space header */
- if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)H5FS_HEADER_SIZE(f))))
+ if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header")
/* Cache the new free space header (pinned) */
@@ -515,7 +515,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va
*-------------------------------------------------------------------------
*/
H5FS_t *
-H5FS_new(size_t nclasses, const H5FS_section_class_t *classes[],
+H5FS_new(const H5F_t *f, size_t nclasses, const H5FS_section_class_t *classes[],
void *cls_init_udata)
{
H5FS_t *fspace = NULL; /* Free space manager */
@@ -560,6 +560,7 @@ H5FS_new(size_t nclasses, const H5FS_section_class_t *classes[],
/* Initialize non-zero information for new free space manager */
fspace->addr = HADDR_UNDEF;
+ fspace->hdr_size = H5FS_HEADER_SIZE(f);
fspace->sect_addr = HADDR_UNDEF;
/* Set return value */
@@ -606,7 +607,7 @@ H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size)
HDassert(meta_size);
/* Get the free space size info */
- *meta_size += H5FS_HEADER_SIZE(f) + (fspace->sinfo ? fspace->sect_size : fspace->alloc_sect_size);
+ *meta_size += fspace->hdr_size + (fspace->sinfo ? fspace->sect_size : fspace->alloc_sect_size);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5FS_size() */