summaryrefslogtreecommitdiffstats
path: root/src/H5HLcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5HLcache.c')
-rw-r--r--src/H5HLcache.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 0bccd26..7932651 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);
@@ -170,7 +168,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 */
@@ -249,24 +247,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);
@@ -293,7 +289,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;
@@ -611,22 +607,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)))