summaryrefslogtreecommitdiffstats
path: root/src/H5HF.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5HF.c')
-rw-r--r--src/H5HF.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/H5HF.c b/src/H5HF.c
index 18e1cdb..3d90369 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -152,6 +152,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam)
{
H5HF_t *fh = NULL; /* Pointer to new fractal heap */
H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
haddr_t fh_addr; /* Heap header address */
H5HF_t *ret_value; /* Return value */
@@ -174,8 +175,12 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
if(NULL == (fh = H5FL_MALLOC(H5HF_t)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for fractal heap info")
+ /* Set up userdata for protect call */
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+
/* Lock the heap header into memory */
- if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load fractal heap header")
/* Point fractal heap wrapper at header and bump it's ref count */
@@ -223,6 +228,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr)
{
H5HF_t *fh = NULL; /* Pointer to new fractal heap */
H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
H5HF_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5HF_open, NULL)
@@ -233,11 +239,15 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr)
HDassert(f);
HDassert(H5F_addr_defined(fh_addr));
+ /* Set up userdata for protect call */
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+
/* Load the heap header into memory */
#ifdef QAK
HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr);
#endif /* QAK */
- if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_READ)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load fractal heap header")
#ifdef QAK
HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fspace);
@@ -783,6 +793,7 @@ done:
herr_t
H5HF_close(H5HF_t *fh, hid_t dxpl_id)
{
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */
haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */
herr_t ret_value = SUCCEED; /* Return value */
@@ -855,8 +866,12 @@ HDfprintf(stderr, "%s; After iterator reset fh->hdr->rc = %Zu\n", FUNC, fh->hdr-
if(pending_delete) {
H5HF_hdr_t *hdr; /* Another pointer to fractal heap header */
+ /* Set up userdata for protect call */
+ cache_udata.f = fh->f;
+ cache_udata.dxpl_id = dxpl_id;
+
/* Lock the heap header into memory */
- if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(fh->f, dxpl_id, H5AC_FHEAP_HDR, heap_addr, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(fh->f, dxpl_id, H5AC_FHEAP_HDR, heap_addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header")
/* Set the shared heap header's file context for this operation */
@@ -892,7 +907,8 @@ herr_t
H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr)
{
H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */
- herr_t ret_value = SUCCEED;
+ H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5HF_delete, FAIL)
@@ -902,11 +918,15 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr)
HDassert(f);
HDassert(H5F_addr_defined(fh_addr));
+ /* Set up userdata for protect call */
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+
/* Lock the heap header into memory */
#ifdef QAK
HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr);
#endif /* QAK */
- if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header")
/* Check for files using shared heap header */