diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-05-15 02:00:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-05-15 02:00:27 (GMT) |
commit | 71bc00a0b50e803a7d4076c6f2249fa1c2c3670e (patch) | |
tree | 0d6c10185306a9e1b6e7eac31d9f57f61401184b /src | |
parent | 668be45b5678fc38c58fbb657c04b557c7baffe7 (diff) | |
download | hdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.zip hdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.tar.gz hdf5-71bc00a0b50e803a7d4076c6f2249fa1c2c3670e.tar.bz2 |
[svn-r27076] Description:
Clean up H5FA 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
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FA.c | 20 | ||||
-rw-r--r-- | src/H5FAcache.c | 15 | ||||
-rw-r--r-- | src/H5FAdbg.c | 10 | ||||
-rw-r--r-- | src/H5FAdblock.c | 30 | ||||
-rw-r--r-- | src/H5FAhdr.c | 66 | ||||
-rw-r--r-- | src/H5FApkg.h | 14 |
6 files changed, 107 insertions, 48 deletions
@@ -141,7 +141,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info") /* Lock the array header into memory */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Point fixed array wrapper at header and bump it's ref count */ @@ -161,7 +161,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") if(!ret_value) if(fa && H5FA_close(fa, dxpl_id) < 0) @@ -201,7 +201,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for pending array deletion */ @@ -229,7 +229,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); CATCH - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") if(!ret_value) if(fa && H5FA_close(fa, dxpl_id) < 0) @@ -351,7 +351,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx); #endif /* H5FA_DEBUG */ /* Create the data block */ - hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty, hdr->cparam.nelmts); + hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty); if(!H5F_addr_defined(hdr->dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block") } /* end if */ @@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: fixed array data block address not defined!\n", FUNC, idx HDassert(idx < hdr->cparam.nelmts); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paging data block */ @@ -467,7 +467,7 @@ HDfprintf(stderr, "%s: Index %Hu\n", FUNC, idx); else { /* Get the data block */ HDassert(H5F_addr_defined(hdr->dblk_addr)); - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, hdr->stats.nelmts, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paged data block */ @@ -592,7 +592,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Lock the array header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(fa->f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, NULL, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC_WRITE))) H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header") /* Set the shared array header's file context for this operation */ @@ -655,7 +655,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) #ifdef H5FA_DEBUG HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); #endif /* H5FA_DEBUG */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, H5AC_WRITE))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for files using shared array header */ @@ -674,7 +674,7 @@ HDfprintf(stderr, "%s: fa_addr = %a\n", FUNC, fa_addr); CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PRIV) /* end H5FA_delete() */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index cb156db..2f07cd6 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -16,6 +16,8 @@ /*------------------------------------------------------------------------- * * Created: H5FAcache.c + * Jul 2 2009 + * Quincey Koziol <koziol@hdfgroup.org> * * Purpose: Implement fixed array metadata cache methods. * @@ -41,7 +43,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -517,10 +519,10 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Sanity check */ HDassert(f); HDassert(H5F_addr_defined(addr)); - HDassert(udata && udata->hdr && udata->nelmts > 0); + HDassert(udata && udata->hdr); /* Allocate the fixed array data block */ - if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr, udata->nelmts))) + if(NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") /* Set the fixed array data block's information */ @@ -575,9 +577,9 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(!dblock->npages) { /* Decode elements in data block */ /* Convert from raw elements on disk into native elements in memory */ - if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->nelmts, udata->hdr->cb_ctx) < 0) + if((udata->hdr->cparam.cls->decode)(p, dblock->elmts, (size_t)udata->hdr->stats.nelmts, udata->hdr->cb_ctx) < 0) H5E_THROW(H5E_CANTDECODE, "can't decode fixed array data elements") - p += (udata->nelmts * udata->hdr->cparam.raw_elmt_size); + p += (udata->hdr->stats.nelmts * udata->hdr->cparam.raw_elmt_size); } /* end if */ /* Sanity check */ @@ -868,9 +870,6 @@ H5FA__cache_dblk_page_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(udata && udata->hdr && udata->nelmts > 0); -#ifdef QAK -HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); -#endif /* QAK */ /* Allocate the fixed array data block page */ if(NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts))) diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index eb5e32e..d5239d3 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -117,7 +117,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Print opening message */ @@ -150,7 +150,7 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_debug() */ @@ -198,11 +198,11 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, dbg_ctx, H5AC_READ))) + if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, hdr->cparam.nelmts, H5AC_READ))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC_READ))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -280,7 +280,7 @@ CATCH H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FARRAY_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__dblock_debug() */ diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 9efc2bc..e6e0e74 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -102,14 +102,14 @@ H5FL_BLK_DEFINE(fa_page_init); */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, -H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) +H5FA__dblock_alloc(H5FA_hdr_t *hdr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* fixed array data block */ /* Check arguments */ HDassert(hdr); - HDassert(nelmts > 0); + HDassert(hdr->cparam.nelmts > 0); /* Allocate memory for the data block */ if(NULL == (dblock = H5FL_CALLOC(H5FA_dblock_t))) @@ -124,9 +124,9 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) dblock->dblk_page_nelmts = (size_t)1 << hdr->cparam.max_dblk_page_nelmts_bits; /* Check if this data block should be paged */ - if(nelmts > dblock->dblk_page_nelmts) { + if(hdr->cparam.nelmts > dblock->dblk_page_nelmts) { /* Compute number of pages */ - hsize_t npages = ((nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts; + hsize_t npages = ((hdr->cparam.nelmts + dblock->dblk_page_nelmts) - 1) / dblock->dblk_page_nelmts; /* Safely assign the number of pages */ H5_CHECKED_ASSIGN(dblock->npages, size_t, npages, hsize_t); @@ -146,10 +146,10 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts)) dblock->dblk_page_size = (dblock->dblk_page_nelmts * hdr->cparam.raw_elmt_size) + H5FA_SIZEOF_CHKSUM; /* Compute the # of elements on last page */ - if(0 == nelmts % dblock->dblk_page_nelmts) + if(0 == hdr->cparam.nelmts % dblock->dblk_page_nelmts) dblock->last_page_nelmts = dblock->dblk_page_nelmts; else - dblock->last_page_nelmts = (size_t)(nelmts % dblock->dblk_page_nelmts); + dblock->last_page_nelmts = (size_t)(hdr->cparam.nelmts % dblock->dblk_page_nelmts); } /* end if */ else { hsize_t dblk_size = hdr->cparam.nelmts * hdr->cparam.cls->nat_elmt_size; @@ -186,24 +186,22 @@ END_FUNC(PKG) /* end H5FA__dblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty, - hsize_t nelmts)) +H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* fixed array data block */ haddr_t dblock_addr; /* fixed array data block address */ #ifdef H5FA_DEBUG -HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, nelmts); +HDfprintf(stderr, "%s: Called, hdr->stats.nelmts = %Zu, nelmts = %Zu\n", FUNC, hdr->stats.nelmts, hdr->cparam.nelmts); #endif /* H5FA_DEBUG */ /* Sanity check */ HDassert(hdr); HDassert(hdr_dirty); - HDassert(nelmts > 0); /* Allocate the data block */ - if(NULL == (dblock = H5FA__dblock_alloc(hdr, nelmts))) + if(NULL == (dblock = H5FA__dblock_alloc(hdr))) H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array data block") /* Set size of data block on disk */ @@ -265,7 +263,7 @@ END_FUNC(PKG) /* end H5FA__dblock_create() */ BEGIN_FUNC(PKG, ERR, H5FA_dblock_t *, NULL, NULL, H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - hsize_t dblk_nelmts, H5AC_protect_t rw)) + H5AC_protect_t rw)) /* Local variables */ H5FA_dblock_cache_ud_t udata; /* Information needed for loading data block */ @@ -277,11 +275,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(dblk_addr)); - HDassert(dblk_nelmts); /* Set up user data */ udata.hdr = hdr; - udata.nelmts = dblk_nelmts; /* Protect the data block */ if(NULL == (ret_value = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, rw))) @@ -340,8 +336,7 @@ END_FUNC(PKG) /* end H5FA__dblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, - hsize_t dblk_nelmts)) +H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -353,10 +348,9 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Sanity check */ HDassert(hdr); HDassert(H5F_addr_defined(dblk_addr)); - HDassert(dblk_nelmts > 0); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, dblk_nelmts, H5AC_WRITE))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC_WRITE))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if data block is paged */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 23a554a..5970ff0 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -393,6 +393,70 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ /*------------------------------------------------------------------------- + * Function: H5FA__hdr_protect + * + * Purpose: Convenience wrapper around protecting fixed array header + * + * Return: Non-NULL pointer to index block on success/NULL on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 12 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +H5FA_hdr_t *, NULL, NULL, +H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, + H5AC_protect_t rw)) + + /* Local variables */ + + /* Sanity check */ + HDassert(f); + HDassert(H5F_addr_defined(fa_addr)); + + /* Protect the header */ + if(NULL == (ret_value = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, ctx_udata, rw))) + H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) + +CATCH + +END_FUNC(PKG) /* end H5FA__hdr_protect() */ + + +/*------------------------------------------------------------------------- + * Function: H5FA__hdr_unprotect + * + * Purpose: Convenience wrapper around unprotecting fixed array header + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 12 2013 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PKG, ERR, +herr_t, SUCCEED, FAIL, +H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) + + /* Local variables */ + + /* Sanity check */ + HDassert(hdr); + + /* Unprotect the header */ + if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array hdr, address = %llu", (unsigned long long)hdr->addr) + +CATCH + +END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ + + +/*------------------------------------------------------------------------- * Function: H5FA__hdr_delete * * Purpose: Delete a fixed array, starting with the header @@ -436,7 +500,7 @@ HDfprintf(stderr, "%s: hdr->dblk_addr = %a\n", FUNC, hdr->dblk_addr); #endif /* H5FA_DEBUG */ /* Delete Fixed Array Data block */ - if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr, hdr->cparam.nelmts) < 0) + if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block") } /* end if */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 20d30c3..7101f0b 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -199,13 +199,12 @@ struct H5FA_t { /* Info needed for loading data block */ typedef struct H5FA_dblock_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ - hsize_t nelmts; /* Number of elements in data block */ } H5FA_dblock_cache_ud_t; /* Info needed for loading data block page */ typedef struct H5FA_dblk_page_cache_ud_t { H5FA_hdr_t *hdr; /* Shared fixed array information */ - size_t nelmts; /* Number of elements in data block page */ + size_t nelmts; /* Number of elements in data block page */ } H5FA_dblk_page_cache_ud_t; @@ -244,19 +243,22 @@ H5_DLL herr_t H5FA__hdr_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr); H5_DLL size_t H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr); H5_DLL herr_t H5FA__hdr_modified(H5FA_hdr_t *hdr); +H5_DLL H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, + void *ctx_udata, H5AC_protect_t rw); +H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5FA__hdr_dest(H5FA_hdr_t *hdr); /* Data block routines */ -H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr, hsize_t nelmts); -H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty, hsize_t nelmts); +H5_DLL H5FA_dblock_t *H5FA__dblock_alloc(H5FA_hdr_t *hdr); +H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty); H5_DLL unsigned H5FA__dblock_sblk_idx(const H5FA_hdr_t *hdr, hsize_t idx); H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, hsize_t dblk_nelmts, H5AC_protect_t rw); + haddr_t dblk_addr, H5AC_protect_t rw); H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags); H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_addr, hsize_t dblk_nelmts); + haddr_t dblk_addr); H5_DLL herr_t H5FA__dblock_dest(H5FA_dblock_t *dblock); /* Data block page routines */ |