summaryrefslogtreecommitdiffstats
path: root/src/H5HF.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-05 22:47:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-05 22:47:56 (GMT)
commit93170b425a30c328c3db0183d8870c6e535c9d7c (patch)
treeb329e021fddcf8544e8f928eae0401eac8796752 /src/H5HF.c
parentf0ecd713070b869c0d89d2ff0c991ade04852177 (diff)
downloadhdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.zip
hdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.tar.gz
hdf5-93170b425a30c328c3db0183d8870c6e535c9d7c.tar.bz2
[svn-r18716] Description:
Bring r18715 from metadata journaling merging branch to trunk: Changes to further align trunk with state of metadata journaling branch. 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/H5HF.c')
-rw-r--r--src/H5HF.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/src/H5HF.c b/src/H5HF.c
index 3d90369..cc38f2a 100644
--- a/src/H5HF.c
+++ b/src/H5HF.c
@@ -152,7 +152,6 @@ 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 */
@@ -175,13 +174,9 @@ 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, &cache_udata, H5AC_WRITE)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to load fractal heap header")
+ if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header")
/* Point fractal heap wrapper at header and bump it's ref count */
fh->hdr = hdr;
@@ -228,7 +223,6 @@ 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)
@@ -239,16 +233,12 @@ 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, &cache_udata, H5AC_READ)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load fractal heap header")
+ if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header")
#ifdef QAK
HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fspace);
#endif /* QAK */
@@ -793,7 +783,6 @@ 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 */
@@ -866,13 +855,9 @@ 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, &cache_udata, H5AC_WRITE)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header")
+ if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC_WRITE)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/* Set the shared heap header's file context for this operation */
hdr->f = fh->f;
@@ -907,7 +892,6 @@ 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 */
- H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5HF_delete, FAIL)
@@ -918,16 +902,12 @@ 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, &cache_udata, H5AC_WRITE)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap header")
+ if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE)))
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header")
/* Check for files using shared heap header */
if(hdr->file_rc)