summaryrefslogtreecommitdiffstats
path: root/src/H5SMcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-01 16:45:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-01 16:45:27 (GMT)
commit71a9d507255366be01c25e458ac4c953d4481f45 (patch)
tree511f2662e8cc85010434af4a64812da147848317 /src/H5SMcache.c
parent1bc79f977be67f734a44fd237be6f05b5fb25f53 (diff)
downloadhdf5-71a9d507255366be01c25e458ac4c953d4481f45.zip
hdf5-71a9d507255366be01c25e458ac4c953d4481f45.tar.gz
hdf5-71a9d507255366be01c25e458ac4c953d4481f45.tar.bz2
[svn-r17943] Description:
Finish refactoring v2 B-trees so that they can have client callback context provided to the encode/decode callbacks. 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 (smirom) 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-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
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 9048b9f..1380e71 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -462,6 +462,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 */
@@ -512,8 +513,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 */
@@ -580,6 +582,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 */
@@ -606,9 +609,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);