summaryrefslogtreecommitdiffstats
path: root/src/H5FSsection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FSsection.c')
-rw-r--r--src/H5FSsection.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/H5FSsection.c b/src/H5FSsection.c
index bd31b63..7c0ab72 100644
--- a/src/H5FSsection.c
+++ b/src/H5FSsection.c
@@ -206,6 +206,7 @@ done:
static herr_t
H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5AC_protect_t accmode)
{
+ H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_lock)
@@ -231,7 +232,10 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n"
HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info")
/* Re-protect the section info with read-write access */
- if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, H5AC_WRITE)))
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+ cache_udata.fspace = fspace;
+ if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC_WRITE)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections")
/* Switch the access mode we have */
@@ -250,7 +254,10 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n"
HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", FUNC, fspace->sect_addr);
#endif /* H5FS_SINFO_DEBUG */
/* Protect the free space sections */
- if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, NULL, fspace, accmode)))
+ cache_udata.f = f;
+ cache_udata.dxpl_id = dxpl_id;
+ cache_udata.fspace = fspace;
+ if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, accmode)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections")
/* Remember that we protected the section info & the access mode */
@@ -558,7 +565,7 @@ H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls,
/* Increment amount of space required to serialize all sections */
#ifdef QAK
-HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, sinfo->serial_size);
+HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
#endif /* QAK */
fspace->sinfo->serial_size += cls->serial_size;
@@ -620,7 +627,7 @@ H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls)
/* Decrement amount of space required to serialize all sections */
#ifdef QAK
-HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->serial_size);
+HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size);
HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size);
#endif /* QAK */
fspace->sinfo->serial_size -= cls->serial_size;