summaryrefslogtreecommitdiffstats
path: root/src/H5SMcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-01 17:05:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-01 17:05:23 (GMT)
commit90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8 (patch)
treeb2f7787df09c5f036ba1f90a2283ad0c9dcaa179 /src/H5SMcache.c
parente3abb6e11a2dba5e57e1b36b9b4303a0007a5311 (diff)
downloadhdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.zip
hdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.tar.gz
hdf5-90c94ab5d7e86b7573d3d92cf11b14e4fd90dab8.tar.bz2
[svn-r17944] Description:
Bring r17943 from trunk to 1.8 branch: Finish refactoring v2 B-trees so that they can have client callback context provided to the encode/decode callbacks. Tested on: FreeBSD/64 6.3 (liberty) (h5committested on trunk)
Diffstat (limited to 'src/H5SMcache.c')
-rw-r--r--src/H5SMcache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 98c7362..4b879cb 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -460,6 +460,7 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
{
H5SM_list_t *list; /* The SOHM list being read in */
H5SM_index_header_t *header = (H5SM_index_header_t *) udata2; /* Index header for this list */
+ H5SM_bt2_ctx_t ctx; /* Message encoding context */
size_t size; /* Size of SOHM list on disk */
H5WB_t *wb = NULL; /* Wrapped buffer for list index data */
uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */
@@ -510,8 +511,9 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
p += H5_SIZEOF_MAGIC;
/* Read messages into the list array */
+ ctx.sizeof_addr = H5F_SIZEOF_ADDR(f);
for(x = 0; x < header->num_messages; x++) {
- if(H5SM_message_decode(f, p, &(list->messages[x])) < 0)
+ if(H5SM_message_decode(p, &(list->messages[x]), &ctx) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, NULL, "can't decode shared message")
p += H5SM_SOHM_ENTRY_SIZE(f);
} /* end for */
@@ -578,6 +580,7 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis
HDassert(list->header);
if(list->cache_info.is_dirty) {
+ H5SM_bt2_ctx_t ctx; /* Message encoding context */
uint8_t *buf; /* Temporary buffer */
uint8_t *p; /* Pointer into raw data buffer */
size_t size; /* Header size on disk */
@@ -604,9 +607,10 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis
/* Write messages from the messages array to disk */
mesgs_written = 0;
+ ctx.sizeof_addr = H5F_SIZEOF_ADDR(f);
for(x = 0; x < list->header->list_max && mesgs_written < list->header->num_messages; x++) {
if(list->messages[x].location != H5SM_NO_LOC) {
- if(H5SM_message_encode(f, p, &(list->messages[x])) < 0)
+ if(H5SM_message_encode(p, &(list->messages[x]), &ctx) < 0)
HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to write shared message to disk")
p+=H5SM_SOHM_ENTRY_SIZE(f);