diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-04-29 08:04:21 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-04-29 08:04:21 (GMT) |
commit | 01f196b31a03f072b685f998b0805c1f90322c2b (patch) | |
tree | 6e1cae004705ade1c870e4c6612a76b55be3c331 /src/H5FA.c | |
parent | da4b69097756158fdbfcbf52b5b552e2034d263d (diff) | |
parent | b3c5284692093953132c6c8227e0980b670bf4ad (diff) | |
download | hdf5-01f196b31a03f072b685f998b0805c1f90322c2b.zip hdf5-01f196b31a03f072b685f998b0805c1f90322c2b.tar.gz hdf5-01f196b31a03f072b685f998b0805c1f90322c2b.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into merge_hyperslab_updates
Diffstat (limited to 'src/H5FA.c')
-rw-r--r-- | src/H5FA.c | 82 |
1 files changed, 40 insertions, 42 deletions
@@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- @@ -64,8 +62,8 @@ /********************/ /* Local Prototypes */ /********************/ -static H5FA_t *H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, - hbool_t from_open, void *ctx_udata); +static H5FA_t *H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, + void *ctx_udata); /*********************/ @@ -120,7 +118,7 @@ H5FL_BLK_DEFINE(fa_native_elmt); */ BEGIN_FUNC(STATIC, ERR, H5FA_t *, NULL, NULL, -H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx_udata)) +H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array */ @@ -137,7 +135,7 @@ H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Check for pending array deletion */ @@ -161,10 +159,10 @@ H5FA__new(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, hbool_t from_open, void *ctx CATCH - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, 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) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(STATIC) /* end H5FA__new() */ @@ -185,7 +183,7 @@ END_FUNC(STATIC) /* end H5FA__new() */ */ BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL, -H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udata)) +H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array */ @@ -201,11 +199,11 @@ H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udat HDcompile_assert(H5FA_NUM_CLS_ID == NELMTS(H5FA_client_class_g)); /* Create fixed array header */ - if(HADDR_UNDEF == (fa_addr = H5FA__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (fa_addr = H5FA__hdr_create(f, cparam, ctx_udata))) H5E_THROW(H5E_CANTINIT, "can't create fixed array header") /* Allocate and initialize new fixed array wrapper */ - if(NULL == (fa = H5FA__new(f, dxpl_id, fa_addr, FALSE, ctx_udata))) + if(NULL == (fa = H5FA__new(f, fa_addr, FALSE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper") /* Set the return value */ @@ -214,7 +212,7 @@ H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udat CATCH if(!ret_value) - if(fa && H5FA_close(fa, dxpl_id) < 0) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(PRIV) /* end H5FA_create() */ @@ -235,7 +233,7 @@ END_FUNC(PRIV) /* end H5FA_create() */ */ BEGIN_FUNC(PRIV, ERR, H5FA_t *, NULL, NULL, -H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) +H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata)) /* Local variables */ H5FA_t *fa = NULL; /* Pointer to new fixed array wrapper */ @@ -247,7 +245,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) HDassert(H5F_addr_defined(fa_addr)); /* Allocate and initialize new fixed array wrapper */ - if(NULL == (fa = H5FA__new(f, dxpl_id, fa_addr, TRUE, ctx_udata))) + if(NULL == (fa = H5FA__new(f, fa_addr, TRUE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for fixed array wrapper") /* Set the return value */ @@ -256,7 +254,7 @@ H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) CATCH if(!ret_value) - if(fa && H5FA_close(fa, dxpl_id) < 0) + if(fa && H5FA_close(fa) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close fixed array") END_FUNC(PRIV) /* end H5FA_open() */ @@ -337,7 +335,7 @@ END_FUNC(PRIV) /* end H5FA_get_addr() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) +H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for fixed array */ @@ -359,7 +357,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Check if we need to create the fixed array data block */ if(!H5F_addr_defined(hdr->dblk_addr)) { /* Create the data block */ - hdr->dblk_addr = H5FA__dblock_create(hdr, dxpl_id, &hdr_dirty); + hdr->dblk_addr = H5FA__dblock_create(hdr, &hdr_dirty); if(!H5F_addr_defined(hdr->dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create fixed array data block") } /* end if */ @@ -367,7 +365,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) HDassert(idx < hdr->cparam.nelmts); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paging data block */ @@ -399,7 +397,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Check if the page has been created yet */ if(!H5VM_bit_get(dblock->dblk_page_init, page_idx)) { /* Create the data block page */ - if(H5FA__dblk_page_create(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts) < 0) + if(H5FA__dblk_page_create(hdr, dblk_page_addr, dblk_page_nelmts) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in data block */ @@ -408,7 +406,7 @@ H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt)) } /* end if */ /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Set the element in the data block page */ @@ -423,9 +421,9 @@ CATCH H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark fixed array header as modified") /* Release resources */ - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, dblock_cache_flags) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, dblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dxpl_id, dblk_page_cache_flags) < 0) + if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dblk_page_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") END_FUNC(PRIV) /* end H5FA_set() */ @@ -445,7 +443,7 @@ END_FUNC(PRIV) /* end H5FA_set() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) +H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */ @@ -470,7 +468,7 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) else { /* Get the data block */ HDassert(H5F_addr_defined(hdr->dblk_addr)); - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)hdr->dblk_addr) /* Check for paged data block */ @@ -510,7 +508,7 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) dblk_page_nelmts = dblock->dblk_page_nelmts; /* Protect the data block page */ - if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dxpl_id, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblk_page = H5FA__dblk_page_protect(hdr, dblk_page_addr, dblk_page_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Retrieve element from data block */ @@ -520,9 +518,9 @@ H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt)) } /* end else */ CATCH - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") - if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") END_FUNC(PRIV) /* end H5FA_get() */ @@ -542,7 +540,7 @@ END_FUNC(PRIV) /* end H5FA_get() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_close(H5FA_t *fa, hid_t dxpl_id)) +H5FA_close(H5FA_t *fa)) /* Local variables */ hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ @@ -593,7 +591,7 @@ H5FA_close(H5FA_t *fa, hid_t dxpl_id)) /* 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_protect(fa->f, dxpl_id, fa_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5FA__hdr_protect(fa->f, fa_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load fixed array header") /* Set the shared array header's file context for this operation */ @@ -607,7 +605,7 @@ H5FA_close(H5FA_t *fa, hid_t dxpl_id)) H5E_THROW(H5E_CANTDEC, "can't decrement reference count on shared array header") /* Delete array, starting with header (unprotects header) */ - if(H5FA__hdr_delete(hdr, dxpl_id) < 0) + if(H5FA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array") } /* end if */ else { @@ -642,7 +640,7 @@ END_FUNC(PRIV) /* end H5FA_close() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) +H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata)) /* Local variables */ H5FA_hdr_t *hdr = NULL; /* The fixed array header information */ @@ -654,7 +652,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) HDassert(H5F_addr_defined(fa_addr)); /* Lock the array header into memory */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) /* Check for files using shared array header */ @@ -665,7 +663,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) hdr->f = f; /* Delete array now, starting with header (unprotects header) */ - if(H5FA__hdr_delete(hdr, dxpl_id) < 0) + if(H5FA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array") hdr = NULL; } /* end if */ @@ -673,7 +671,7 @@ H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata)) CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5FA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5FA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PRIV) /* end H5FA_delete() */ @@ -696,7 +694,7 @@ END_FUNC(PRIV) /* end H5FA_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata)) +H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; @@ -718,7 +716,7 @@ H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata)) int cb_ret; /* Return value from callback */ /* Get array element */ - if(H5FA_get(fa, dxpl_id, u, elmt) < 0) + if(H5FA_get(fa, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ @@ -751,7 +749,7 @@ END_FUNC(PRIV) /* end H5FA_iterate() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) +H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent)) /* Local variables */ H5FA_hdr_t *hdr = fa->hdr; /* Header for FA */ @@ -776,7 +774,7 @@ H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) hdr->f = fa->f; /* Add the fixed array as a child of the parent (proxy) */ - if(H5AC_proxy_entry_add_child(parent, hdr->f, dxpl_id, hdr->top_proxy) < 0) + if(H5AC_proxy_entry_add_child(parent, hdr->f, hdr->top_proxy) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array as child of proxy") hdr->parent = parent; } /* end if */ |