diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-05 14:45:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-05-05 14:45:57 (GMT) |
commit | 3f3a900177d9464376ea7baf5f989cbfa0e86b0a (patch) | |
tree | 38ed174516c0c65bcbbe4c543c54119bb83d5452 /src/H5HLcache.c | |
parent | f2190dd264fb97dfb699888d20c4ab6c112e45aa (diff) | |
download | hdf5-3f3a900177d9464376ea7baf5f989cbfa0e86b0a.zip hdf5-3f3a900177d9464376ea7baf5f989cbfa0e86b0a.tar.gz hdf5-3f3a900177d9464376ea7baf5f989cbfa0e86b0a.tar.bz2 |
[svn-r18704] Description:
Bring r18702 from trunk to 1.8 branch:
Bring r18672 from metadata journaling "merging" branch to trunk:
Mostly changes to move to only using one 'user data' parameter for
calls to H5AC_protect(), along with some minor reformatting code cleanups.
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 production 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/H5HLcache.c')
-rw-r--r-- | src/H5HLcache.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/H5HLcache.c b/src/H5HLcache.c index b224343..779486d 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -69,15 +69,13 @@ /********************/ /* Metadata cache callbacks */ -static void *H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, - const void *udata1, void *udata2); +static void *H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); static herr_t H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing, unsigned *flags_ptr); static herr_t H5HL_prefix_dest(H5F_t *f, void *thing); static herr_t H5HL_prefix_clear(H5F_t *f, void *thing, hbool_t destroy); static herr_t H5HL_prefix_size(const H5F_t *f, const void *thing, size_t *size_ptr); -static void *H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, - const void *udata1, void *udata2); +static void *H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); static herr_t H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing, unsigned *flags_ptr); static herr_t H5HL_datablock_dest(H5F_t *f, void *thing); @@ -168,7 +166,7 @@ H5HL_fl_deserialize(H5HL_t *heap, hsize_t free_block) /* Decode length of this free block */ H5F_DECODE_LENGTH_LEN(p, fl->size, heap->sizeof_size); - if(fl->offset + fl->size > heap->dblk_size) + if((fl->offset + fl->size) > heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list") /* Append node onto list */ @@ -247,24 +245,22 @@ H5HL_fl_serialize(const H5HL_t *heap) *------------------------------------------------------------------------- */ static void * -H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, - void *_udata) +H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) { - H5HL_t *heap = NULL; /* Local heap */ - H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ - H5HL_cache_prfx_ud_t *udata = (H5HL_cache_prfx_ud_t *)_udata; /* User data for protecting local heap prefix */ + H5HL_t *heap = NULL; /* Local heap */ + H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ + H5HL_cache_prfx_ud_t *udata = (H5HL_cache_prfx_ud_t *)_udata; /* User data for callback */ uint8_t buf[H5HL_SPEC_READ_SIZE]; /* Buffer for decoding */ size_t spec_read_size; /* Size of buffer to speculatively read in */ const uint8_t *p; /* Pointer into decoding buffer */ haddr_t eoa; /* Relative end of file address */ - void *ret_value; /* Return value */ + H5HL_prfx_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_load) /* check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); - HDassert(!udata1); HDassert(udata); HDassert(udata->sizeof_size > 0); HDassert(udata->sizeof_addr > 0); @@ -291,7 +287,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, /* Version */ if(H5HL_VERSION != *p++) - HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong version number in global heap") + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong version number in local heap") /* Reserved */ p += 3; @@ -609,22 +605,21 @@ H5HL_prefix_size(const H5F_t UNUSED *f, const void *thing, size_t *size_ptr) *------------------------------------------------------------------------- */ static void * -H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, - void *_udata) +H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) { - H5HL_dblk_t *dblk = NULL; /* Heap data block deserialized */ - H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for protecting local heap data block */ - void *ret_value; /* Return value */ + H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ + H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ + H5HL_dblk_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_load) /* check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); - HDassert(!udata1); HDassert(udata); HDassert(udata->heap); HDassert(!udata->heap->single_cache_obj); + HDassert(NULL == udata->heap->dblk); /* Allocate space in memory for the heap data block */ if(NULL == (dblk = H5HL_dblk_new(udata->heap))) |