mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
[svn-r27081] Description:
Clean up H5HL interface, to align w/v3 metadata cache changes Tested on: MacOSX/64 10.10.3 (amazon) w/serial & parallel Linux/32 2.6.* (jam) w/serial & parallel
This commit is contained in:
parent
8cc79c0825
commit
2e9d48a551
@ -121,7 +121,7 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5HL_fl_deserialize
|
||||
* Function: H5HL__fl_deserialize
|
||||
*
|
||||
* Purpose: Deserialize the free list for a heap data block
|
||||
*
|
||||
@ -134,13 +134,13 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5HL_fl_deserialize(H5HL_t *heap)
|
||||
H5HL__fl_deserialize(H5HL_t *heap)
|
||||
{
|
||||
H5HL_free_t *fl = NULL, *tail = NULL; /* Heap free block nodes */
|
||||
hsize_t free_block; /* Offset of free block */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
/* check arguments */
|
||||
HDassert(heap);
|
||||
@ -188,11 +188,11 @@ done:
|
||||
fl = H5FL_FREE(H5HL_free_t, fl);
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5HL_fl_deserialize() */
|
||||
} /* end H5HL__fl_deserialize() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5HL_fl_serialize
|
||||
* Function: H5HL__fl_serialize
|
||||
*
|
||||
* Purpose: Serialize the free list for a heap data block
|
||||
*
|
||||
@ -206,11 +206,11 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
H5HL_fl_serialize(const H5HL_t *heap)
|
||||
H5HL__fl_serialize(const H5HL_t *heap)
|
||||
{
|
||||
H5HL_free_t *fl; /* Pointer to heap free list node */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
||||
FUNC_ENTER_STATIC_NOERR
|
||||
|
||||
/* check arguments */
|
||||
HDassert(heap);
|
||||
@ -231,7 +231,7 @@ H5HL_fl_serialize(const H5HL_t *heap)
|
||||
} /* end for */
|
||||
|
||||
FUNC_LEAVE_NOAPI_VOID
|
||||
} /* end H5HL_fl_serialize() */
|
||||
} /* end H5HL__fl_serialize() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -315,7 +315,8 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
|
||||
|
||||
/* Free list head */
|
||||
H5F_DECODE_LENGTH_LEN(p, heap->free_block, udata->sizeof_size);
|
||||
if(heap->free_block != H5HL_FREE_NULL && heap->free_block >= heap->dblk_size)
|
||||
|
||||
if((heap->free_block != H5HL_FREE_NULL) && (heap->free_block >= heap->dblk_size))
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list")
|
||||
|
||||
/* Heap data address */
|
||||
@ -349,7 +350,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
|
||||
} /* end else */
|
||||
|
||||
/* Build free list */
|
||||
if(H5HL_fl_deserialize(heap) < 0)
|
||||
if(H5HL__fl_deserialize(heap) < 0)
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list")
|
||||
} /* end if */
|
||||
else
|
||||
@ -455,7 +456,7 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
|
||||
} /* end if */
|
||||
|
||||
/* Serialize the free list into the heap data's image */
|
||||
H5HL_fl_serialize(heap);
|
||||
H5HL__fl_serialize(heap);
|
||||
|
||||
/* Copy the heap data block into the cache image */
|
||||
HDmemcpy(p, heap->dblk_image, heap->dblk_size);
|
||||
@ -634,7 +635,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
/* check arguments */
|
||||
/* Check arguments */
|
||||
HDassert(f);
|
||||
HDassert(H5F_addr_defined(addr));
|
||||
HDassert(udata);
|
||||
@ -657,7 +658,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap data block")
|
||||
|
||||
/* Build free list */
|
||||
if(H5HL_fl_deserialize(udata->heap) < 0)
|
||||
if(H5HL__fl_deserialize(udata->heap) < 0)
|
||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list")
|
||||
} /* end if */
|
||||
|
||||
@ -714,7 +715,7 @@ H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr,
|
||||
heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL;
|
||||
|
||||
/* Serialize the free list into the heap data's image */
|
||||
H5HL_fl_serialize(heap);
|
||||
H5HL__fl_serialize(heap);
|
||||
|
||||
/* Write the data block to the file */
|
||||
if(H5F_block_write(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0)
|
||||
@ -754,7 +755,7 @@ H5HL_datablock_dest(H5F_t *f, void *_thing)
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
/* check arguments */
|
||||
/* Check arguments */
|
||||
HDassert(dblk);
|
||||
HDassert(dblk->heap);
|
||||
HDassert(!dblk->heap->single_cache_obj);
|
||||
@ -804,7 +805,7 @@ H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy)
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT
|
||||
|
||||
/* check arguments */
|
||||
/* Check arguments */
|
||||
HDassert(dblk);
|
||||
|
||||
/* Mark local heap data block as clean */
|
||||
|
@ -114,8 +114,8 @@ struct H5HL_dblk_t {
|
||||
|
||||
/* Struct for heap prefix */
|
||||
struct H5HL_prfx_t {
|
||||
H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */
|
||||
/* first field in structure */
|
||||
H5AC_info_t cache_info; /* Information for H5AC cache functions, */
|
||||
/* _must_ be first field in structure */
|
||||
H5HL_t *heap; /* Pointer to heap for prefix */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user