summaryrefslogtreecommitdiffstats
path: root/src/H5B2.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-27 13:10:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-27 13:10:28 (GMT)
commit037c318770490c07f23e30af26353b68dbf712c0 (patch)
treee1fb9a5233047824bc1405e099e8f85f2e8faf4b /src/H5B2.c
parent6a183ca20ce41b70feae9a52a4e04913d276be34 (diff)
downloadhdf5-037c318770490c07f23e30af26353b68dbf712c0.zip
hdf5-037c318770490c07f23e30af26353b68dbf712c0.tar.gz
hdf5-037c318770490c07f23e30af26353b68dbf712c0.tar.bz2
[svn-r18910] Description:
Remove 'size' parameter from H5AC2_set()/H5C2_insert_entry(), to align better with trunk. Use the 'image_len' cache client callback to retrieve the size of an inserted entry. Also, add flags to the cache client class structure, to indicate several client behaviors: speculative loads & compressed storage on disk (which were previously dependent on the 'image_len' callback only being used to detect size changes during load (deserialize) operations). Tested on: 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/H5B2.c')
-rw-r--r--src/H5B2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5B2.c b/src/H5B2.c
index 0bbd7b8..dd182fb 100644
--- a/src/H5B2.c
+++ b/src/H5B2.c
@@ -124,6 +124,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
/* Assign internal information */
HDmemset(&bt2->cache_info, 0, sizeof(H5AC_info_t));
+ bt2->hdr_size = H5B2_HEADER_SIZE(f);
bt2->root.addr = HADDR_UNDEF;
bt2->root.node_nrec = 0;
bt2->root.all_nrec = 0;
@@ -133,11 +134,11 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create shared B-tree info")
/* Allocate space for the header on disk */
- if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)H5B2_HEADER_SIZE(f))))
+ if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)bt2->hdr_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree header")
/* Cache the new B-tree node */
- if(H5AC_set(f, dxpl_id, H5AC_BT2_HDR, *addr_p, (size_t)H5B2_HEADER_SIZE(f), bt2, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_set(f, dxpl_id, H5AC_BT2_HDR, *addr_p, bt2, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree header to cache")
done:
@@ -1029,7 +1030,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr,
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes")
/* Release space for B-tree node on disk */
- if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5B2_HEADER_SIZE(f))<0)
+ if(H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)bt2->hdr_size) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree header info")
done:
@@ -1282,7 +1283,7 @@ H5B2_iterate_size(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t add
HDassert(shared);
/* Add size of header to B-tree metadata total */
- *btree_size += H5B2_HEADER_SIZE(f);
+ *btree_size += bt2->hdr_size;
/* Make copy of the root node pointer */
root_ptr = bt2->root;