From 4a17aff4085ad6ee265b95730aca3f493056dec8 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 15 Mar 2018 16:54:30 -0500 Subject: Add API context interface and use it throughout the library. --- MANIFEST | 3 + examples/h5_elink_unix2win.c | 2 +- examples/h5_extlink.c | 8 +- fortran/src/H5Lf.c | 169 - fortran/src/H5Lff.F90 | 286 -- java/src/hdf/hdf5lib/H5.java | 16 - src/H5.c | 14 +- src/H5A.c | 467 +-- src/H5AC.c | 331 +- src/H5ACmpio.c | 61 +- src/H5ACpkg.h | 4 +- src/H5ACprivate.h | 62 +- src/H5ACproxy_entry.c | 5 +- src/H5Abtree2.c | 6 +- src/H5Adense.c | 355 +-- src/H5Adeprec.c | 106 +- src/H5Aint.c | 980 ++++-- src/H5Apkg.h | 157 +- src/H5Aprivate.h | 6 +- src/H5Atest.c | 26 +- src/H5B.c | 224 +- src/H5B2.c | 146 +- src/H5B2dbg.c | 26 +- src/H5B2hdr.c | 29 +- src/H5B2int.c | 194 +- src/H5B2internal.c | 172 +- src/H5B2leaf.c | 84 +- src/H5B2pkg.h | 148 +- src/H5B2private.h | 45 +- src/H5B2stat.c | 4 +- src/H5B2test.c | 29 +- src/H5Bdbg.c | 16 +- src/H5Bpkg.h | 3 +- src/H5Bprivate.h | 46 +- src/H5C.c | 669 ++-- src/H5CX.c | 3308 ++++++++++++++++++++ src/H5CXmodule.h | 33 + src/H5CXprivate.h | 142 + src/H5Cepoch.c | 12 +- src/H5Cimage.c | 75 +- src/H5Cmpio.c | 139 +- src/H5Cpkg.h | 30 +- src/H5Cprefetched.c | 16 +- src/H5Cprivate.h | 57 +- src/H5Ctag.c | 42 +- src/H5D.c | 247 +- src/H5Dbtree.c | 66 +- src/H5Dbtree2.c | 61 +- src/H5Dchunk.c | 493 ++- src/H5Dcompact.c | 38 +- src/H5Dcontig.c | 113 +- src/H5Ddbg.c | 10 +- src/H5Ddeprec.c | 192 +- src/H5Dearray.c | 81 +- src/H5Defl.c | 4 +- src/H5Dfarray.c | 82 +- src/H5Dfill.c | 47 +- src/H5Dint.c | 727 ++--- src/H5Dio.c | 481 +-- src/H5Dlayout.c | 64 +- src/H5Dmpio.c | 432 +-- src/H5Dnone.c | 8 +- src/H5Doh.c | 81 +- src/H5Dpkg.h | 176 +- src/H5Dprivate.h | 32 +- src/H5Dpublic.h | 4 +- src/H5Dscatgath.c | 131 +- src/H5Dselect.c | 11 +- src/H5Dsingle.c | 14 +- src/H5Dvirtual.c | 226 +- src/H5EA.c | 95 +- src/H5EAcache.c | 4 +- src/H5EAdbg.c | 56 +- src/H5EAdblkpage.c | 20 +- src/H5EAdblock.c | 36 +- src/H5EAhdr.c | 27 +- src/H5EAiblock.c | 32 +- src/H5EApkg.h | 62 +- src/H5EAprivate.h | 18 +- src/H5EAsblock.c | 32 +- src/H5EAtest.c | 4 +- src/H5Eprivate.h | 8 +- src/H5F.c | 483 ++- src/H5FA.c | 72 +- src/H5FAcache.c | 4 +- src/H5FAdbg.c | 30 +- src/H5FAdblkpage.c | 19 +- src/H5FAdblock.c | 31 +- src/H5FAhdr.c | 28 +- src/H5FApkg.h | 41 +- src/H5FAprivate.h | 18 +- src/H5FAtest.c | 5 +- src/H5FD.c | 114 +- src/H5FDfamily.c | 8 +- src/H5FDint.c | 110 +- src/H5FDmpi.c | 47 +- src/H5FDmpio.c | 68 +- src/H5FDpkg.h | 8 +- src/H5FDprivate.h | 46 +- src/H5FDspace.c | 36 +- src/H5FO.c | 4 +- src/H5FOprivate.h | 2 +- src/H5FS.c | 74 +- src/H5FScache.c | 62 +- src/H5FSdbg.c | 18 +- src/H5FSpkg.h | 5 +- src/H5FSprivate.h | 63 +- src/H5FSsection.c | 116 +- src/H5Faccum.c | 153 +- src/H5Fcwfs.c | 6 +- src/H5Fdeprec.c | 25 +- src/H5Fefc.c | 131 +- src/H5Fint.c | 691 +++- src/H5Fio.c | 70 +- src/H5Fmount.c | 86 +- src/H5Fmpi.c | 31 +- src/H5Fpkg.h | 73 +- src/H5Fprivate.h | 38 +- src/H5Fquery.c | 2 +- src/H5Fspace.c | 34 +- src/H5Fsuper.c | 280 +- src/H5Ftest.c | 15 +- src/H5G.c | 253 +- src/H5Gbtree2.c | 7 +- src/H5Gcompact.c | 63 +- src/H5Gdense.c | 231 +- src/H5Gdeprec.c | 754 +++-- src/H5Gent.c | 26 +- src/H5Gint.c | 464 ++- src/H5Glink.c | 5 +- src/H5Gloc.c | 106 +- src/H5Gname.c | 19 +- src/H5Gnode.c | 131 +- src/H5Gobj.c | 225 +- src/H5Goh.c | 116 +- src/H5Gpkg.h | 161 +- src/H5Gprivate.h | 58 +- src/H5Groot.c | 16 +- src/H5Gstab.c | 160 +- src/H5Gtest.c | 181 +- src/H5Gtraverse.c | 192 +- src/H5HF.c | 77 +- src/H5HFbtree2.c | 8 +- src/H5HFcache.c | 222 +- src/H5HFdbg.c | 63 +- src/H5HFdblock.c | 144 +- src/H5HFhdr.c | 109 +- src/H5HFhuge.c | 162 +- src/H5HFiblock.c | 662 ++-- src/H5HFiter.c | 18 +- src/H5HFman.c | 105 +- src/H5HFpkg.h | 181 +- src/H5HFprivate.h | 39 +- src/H5HFsection.c | 755 ++--- src/H5HFspace.c | 125 +- src/H5HFstat.c | 12 +- src/H5HG.c | 106 +- src/H5HGdbg.c | 7 +- src/H5HGpkg.h | 2 +- src/H5HGprivate.h | 15 +- src/H5HL.c | 68 +- src/H5HLdbg.c | 4 +- src/H5HLdblk.c | 10 +- src/H5HLpkg.h | 2 +- src/H5HLprivate.h | 18 +- src/H5I.c | 62 +- src/H5Itest.c | 12 +- src/H5L.c | 1377 +++++--- src/H5Lexternal.c | 132 +- src/H5Lpkg.h | 9 +- src/H5Lprivate.h | 33 +- src/H5Lpublic.h | 21 +- src/H5MF.c | 810 ++--- src/H5MFaggr.c | 74 +- src/H5MFdbg.c | 22 +- src/H5MFpkg.h | 13 +- src/H5MFprivate.h | 38 +- src/H5MFsection.c | 21 +- src/H5O.c | 321 +- src/H5Oainfo.c | 108 +- src/H5Oalloc.c | 219 +- src/H5Oattr.c | 147 +- src/H5Oattribute.c | 393 ++- src/H5Obogus.c | 36 +- src/H5Obtreek.c | 20 +- src/H5Ocache.c | 68 +- src/H5Ocache_image.c | 25 +- src/H5Ochunk.c | 106 +- src/H5Ocont.c | 50 +- src/H5Ocopy.c | 322 +- src/H5Odbg.c | 20 +- src/H5Odrvinfo.c | 32 +- src/H5Odtype.c | 99 +- src/H5Oefl.c | 66 +- src/H5Ofill.c | 106 +- src/H5Oflush.c | 208 +- src/H5Ofsinfo.c | 35 +- src/H5Oginfo.c | 34 +- src/H5Oint.c | 776 +++-- src/H5Olayout.c | 146 +- src/H5Olinfo.c | 128 +- src/H5Olink.c | 95 +- src/H5Omessage.c | 236 +- src/H5Omtime.c | 89 +- src/H5Oname.c | 44 +- src/H5Opkg.h | 162 +- src/H5Opline.c | 74 +- src/H5Oprivate.h | 105 +- src/H5Orefcount.c | 44 +- src/H5Osdspace.c | 75 +- src/H5Oshared.c | 104 +- src/H5Oshared.h | 48 +- src/H5Oshmesg.c | 28 +- src/H5Ostab.c | 100 +- src/H5Otest.c | 152 +- src/H5Ounknown.c | 14 +- src/H5P.c | 15 + src/H5PB.c | 127 +- src/H5PBprivate.h | 12 +- src/H5Pdcpl.c | 28 +- src/H5Pdxpl.c | 73 - src/H5Pint.c | 107 +- src/H5Pprivate.h | 7 +- src/H5R.c | 94 +- src/H5Rdeprec.c | 43 +- src/H5Rint.c | 142 +- src/H5Rpkg.h | 9 + src/H5Rprivate.h | 9 - src/H5S.c | 79 +- src/H5SM.c | 500 ++- src/H5SMmessage.c | 4 +- src/H5SMpkg.h | 5 +- src/H5SMprivate.h | 33 +- src/H5SMtest.c | 15 +- src/H5Sdbg.c | 6 +- src/H5Sprivate.h | 14 +- src/H5T.c | 1209 +++---- src/H5TS.c | 16 + src/H5TSprivate.h | 1 + src/H5Tarray.c | 42 +- src/H5Tcommit.c | 518 ++- src/H5Tcompound.c | 25 +- src/H5Tconv.c | 1381 +++----- src/H5Tdeprec.c | 76 +- src/H5Tenum.c | 15 +- src/H5Tnative.c | 193 +- src/H5Toh.c | 54 +- src/H5Tpkg.h | 546 ++-- src/H5Tprivate.h | 14 +- src/H5Tvlen.c | 152 +- src/H5Z.c | 104 +- src/H5Znbit.c | 12 +- src/H5Zpkg.h | 3 + src/H5Zprivate.h | 1 - src/H5Zscaleoffset.c | 46 +- src/H5err.txt | 1 + src/H5private.h | 95 +- src/Makefile.am | 7 +- test/accum.c | 270 +- test/accum_swmr_reader.c | 10 +- test/btree2.c | 1832 ++++++----- test/cache.c | 116 +- test/cache_common.c | 101 +- test/cache_tagging.c | 34 +- test/dsets.c | 6 +- test/earray.c | 158 +- test/efc.c | 1107 +++---- test/farray.c | 132 +- test/fheap.c | 2606 ++++++++------- test/freespace.c | 440 ++- test/gheap.c | 55 +- test/lheap.c | 23 +- test/links.c | 16 +- test/mf.c | 859 ++--- test/ohdr.c | 129 +- test/page_buffer.c | 277 +- test/stab.c | 2 +- test/tattr.c | 242 +- test/testfiles/error_test_1 | 2 +- test/ttsafe_error.c | 4 +- test/unregister.c | 7 + testpar/t_cache.c | 11 +- testpar/t_file.c | 101 +- testpar/t_pread.c | 2 +- testpar/t_shapesame.c | 2 +- testpar/t_span_tree.c | 6 + tools/src/misc/h5debug.c | 59 +- tools/test/h5diff/h5diffgentest.c | 7 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- tools/test/h5dump/errfiles/tall-1.err | 17 +- tools/test/h5dump/errfiles/tall-2A.err | 17 +- tools/test/h5dump/errfiles/tall-2A0.err | 17 +- tools/test/h5dump/errfiles/tall-2B.err | 17 +- tools/test/h5dump/errfiles/tarray1_big.err | 12 +- tools/test/h5dump/errfiles/tattr-3.err | 7 +- tools/test/h5dump/errfiles/tattrregR.err | 8 +- tools/test/h5dump/errfiles/tcomp-3.err | 13 +- tools/test/h5dump/errfiles/tdataregR.err | 8 +- tools/test/h5dump/errfiles/tdset-2.err | 21 +- tools/test/h5dump/errfiles/textlink.err | 34 +- tools/test/h5dump/errfiles/textlinkfar.err | 103 +- tools/test/h5dump/errfiles/textlinksrc.err | 103 +- tools/test/h5dump/errfiles/tgroup-2.err | 4 +- tools/test/h5dump/errfiles/torderlinks1.err | 17 +- tools/test/h5dump/errfiles/torderlinks2.err | 17 +- tools/test/h5dump/errfiles/tperror.err | 21 +- tools/test/h5dump/errfiles/tslink-D.err | 8 +- tools/test/h5dump/h5dumpgentest.c | 3 +- tools/test/h5jam/h5jamgentest.c | 3 +- ...h5repack_layout.h5-dset2_chunk_20x10-errstk.tst | 10 +- 310 files changed, 24250 insertions(+), 20317 deletions(-) create mode 100644 src/H5CX.c create mode 100644 src/H5CXmodule.h create mode 100644 src/H5CXprivate.h diff --git a/MANIFEST b/MANIFEST index 9b91c78..ea3d775 100644 --- a/MANIFEST +++ b/MANIFEST @@ -518,6 +518,9 @@ ./src/H5Ctest.c ./src/H5CS.c ./src/H5CSprivate.h +./src/H5CX.c +./src/H5CXprivate.h +./src/H5CXmodule.h ./src/H5D.c ./src/H5Dbtree.c ./src/H5Dbtree2.c diff --git a/examples/h5_elink_unix2win.c b/examples/h5_elink_unix2win.c index df52015..c29e7db 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -38,7 +38,7 @@ * understand Unix paths. */ static hid_t elink_unix2win_trav(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { hid_t fid; const char *file_name; diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index ba632f5..1a07656 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -310,7 +310,7 @@ static herr_t UD_hard_create(const char *link_name, hid_t loc_group, static herr_t UD_hard_delete(const char *link_name, hid_t loc_group, const void *udata, size_t udata_size); static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id); + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); static void hard_link_example(void) { @@ -490,7 +490,7 @@ done: * return its ID. */ static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { haddr_t addr; hid_t ret_value = -1; @@ -527,7 +527,7 @@ static hid_t UD_hard_traverse(const char *link_name, hid_t cur_group, * These links have no udata, so they don't need a query function. */ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id); + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); static void plist_link_example(void) { @@ -618,7 +618,7 @@ static void plist_link_example(void) * Open a path passed in through the property list. */ static hid_t UD_plist_traverse(const char *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t lapl_id) + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id) { char * path; hid_t ret_value = -1; diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index 32de037..4776e77 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -746,172 +746,6 @@ done: } -/* /\****if* H5Lf/h5lget_val_c */ -/* * NAME */ -/* * h5lget_val_c */ -/* * PURPOSE */ -/* * Call H5Lget_val */ -/* * INPUTS */ -/* * */ -/* * link_loc_id - File or group identifier. */ -/* * link_name - Name of the link for which valrmation is being sought */ -/* * link_namelen - Name length */ -/* * size - Maximum number of characters of link value to be returned. */ -/* * lapl_id - Link access property list */ -/* * OUTPUTS */ -/* * */ -/* * linkval_buff - The buffer to hold the returned link value. */ -/* * */ -/* * RETURNS */ -/* * 0 on success, -1 on failure */ -/* * AUTHOR */ -/* * M. Scot Breitenfeld */ -/* * March 3, 2008 */ -/* * HISTORY */ -/* * N/A */ -/* * SOURCE */ -/* *\/ */ -/* int_f */ -/* h5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ -/* size_t_f *size, _fcd linkval_buff, */ -/* hid_t_f *lapl_id) */ -/* { */ -/* char *c_link_name = NULL; /\* Buffer to hold C string *\/ */ -/* int_f ret_value = 0; /\* Return value *\/ */ -/* void *c_linkval_buff = NULL; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Call H5Lval function. */ -/* *\/ */ -/* if(H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Convert C name to FORTRAN */ -/* *\/ */ -/* HD5packFstring(c_buf, _fcdtocp(buf), c_bufsize-1); */ - - -/* done: */ -/* return ret_value; */ -/* } */ - - -/* /\****if* H5Lf/ */ -/* * NAME */ -/* * H5Lregistered_c */ -/* * PURPOSE */ -/* * Call H5Lregistered */ -/* * INPUTS */ -/* * */ -/* * */ -/* * INPUTS */ -/* * */ -/* * version - Version number of this struct */ -/* * class_id - Link class identifier */ -/* * comment - Comment for debugging */ -/* * comment_len - Comment for debugging */ -/* * create_func - Callback during link creation */ -/* * create_func_len - length */ -/* * move_func - Callback after moving link */ -/* * move_func_len - length */ -/* * copy_func - Callback after copying link */ -/* * copy_func_len - length */ -/* * trav_func - The main traversal function */ -/* * trav_func_len - length */ -/* * del_func - Callback for link deletion */ -/* * del_func_len - length */ -/* * query_func - Callback for queries */ -/* * query_func_len - length */ -/* * */ -/* * RETURNS */ -/* * 0 on success, -1 on failure */ -/* * AUTHOR */ -/* * M. Scot Breitenfeld */ -/* * February 3, 2008 */ -/* * HISTORY */ -/* * */ -/* * SOURCE */ -/* *\/ */ - -/* int_f */ - -/* h5lregistered_c(int_f *version, int_f *class_id, */ -/* _fcd comment, size_t_f *comment_len, */ -/* _fcd create_func, size_t_f *create_func_len, */ -/* _fcd move_func, size_t_f *move_func_len, */ -/* _fcd copy_func, size_t_f *copy_func_len, */ -/* _fcd trav_func, size_t_f *trav_func_len, */ -/* _fcd del_func , size_t_f *del_func_len, */ -/* _fcd query_func, size_t_f *query_func_len) */ -/* { */ -/* char *c_comment = NULL; */ -/* char *c_create_func = NULL; */ -/* char *c_move_func = NULL; */ -/* char *c_copy_func = NULL; */ -/* char *c_trav_func = NULL; */ -/* char *c_del_func = NULL; */ -/* char *c_query_func = NULL; */ - -/* H5L_class_t class_t; */ - -/* int_f ret_value = 0; */ - -/* /\* */ -/* * Convert FORTRAN name to C name */ -/* *\/ */ -/* if((c_comment = HD5f2cstring(c_comment, (size_t)*sc_comment_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_create_func = HD5f2cstring(c_create_func, (size_t)*c_create_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_move_func = HD5f2cstring(c_move_func, (size_t)*sc_move_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_copy_func = HD5f2cstring(c_copy_func, (size_t)*c_copy_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_trav_func = HD5f2cstring(c_trav_func, (size_t)*sc_trav_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_del_func = HD5f2cstring(c_del_func, (size_t)*c_del_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* if((c_query_func = HD5f2cstring(c_query_func, (size_t)*c_query_func_len)) == NULL) */ -/* HGOTO_DONE(FAIL); */ -/* /\* */ -/* * Pack into C struct H5L_class_t */ -/* *\/ */ -/* int version; /\* Version number of this struct *\/ */ -/* H5L_type_t class_id; /\* Link class identifier *\/ */ -/* const char *comment; /\* Comment for debugging *\/ */ -/* H5L_create_func_t create_func; /\* Callback during link creation *\/ */ -/* H5L_move_func_t move_func; /\* Callback after moving link *\/ */ -/* H5L_copy_func_t copy_func; /\* Callback after copying link *\/ */ -/* H5L_traverse_func_t trav_func; /\* The main traversal function *\/ */ -/* H5L_delete_func_t del_func; /\* Callback for link deletion *\/ */ -/* H5L_query_func_t query_func; /\* Callback for queries *\/ */ - -/* class_t.version = (int)*version; */ -/* class_t.class_id = (H5L_type_t)*class_id; */ -/* class_t.comment = c_comment; */ -/* class_t. */ - -/* /\* */ -/* * Call H5Lcopy function. */ -/* *\/ */ -/* if( H5Lcopy( (hid_t)*src_loc_id, c_src_name, (hid_t) *dest_loc_id, */ -/* c_dest_name, (hid_t)*lcpl_id, (hid_t)*lapl_id ) < 0) */ -/* HGOTO_DONE(FAIL); */ - -/* done: */ -/* if(c_src_name) */ -/* HDfree(c_src_name); */ -/* if(c_dest_name) */ -/* HDfree(c_dest_name); */ - -/* return ret_value; */ -/* } */ - /****if* H5Lf/h5lget_val_c * NAME * h5lget_val_c @@ -1068,6 +902,3 @@ h5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index return ret_value; } - - - diff --git a/fortran/src/H5Lff.F90 b/fortran/src/H5Lff.F90 index d5bb1d1..9775a7d 100644 --- a/fortran/src/H5Lff.F90 +++ b/fortran/src/H5Lff.F90 @@ -1020,292 +1020,6 @@ CONTAINS END SUBROUTINE h5lget_name_by_idx_f -! HAS PROBLEM WITH void pointer in C -!!$! -!!$!****s* H5L/ -!!$! -!!$! NAME -!!$! h5lget_val_by_idx_f -!!$! -!!$! PURPOSE -!!$! Returns the link value of a link, according to the order of -!!$! an index. For symbolic links, this is the path to which the -!!$! link points, including the null terminator. For user-defined -!!$! links, it is the link buffer. -!!$! INPUTS -!!$! loc_id - File or group identifier specifying location of subject group -!!$! group_name - Name of subject group -!!$! index_field - Index or field which determines the order -!!$! order - Order within field or index -!!$! n - Link for which to retrieve information -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t -!!$! corder_valid - indicates whether the creation order data is valid for this attribute -!!$! corder - is a positive integer containing the creation order of the attribute -!!$! cset - indicates the character set used for the attribute’s name -!!$! data_size - indicates the size, in the number of characters, of the attribute -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & -!!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group -!!$ CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group -!!$ INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order -!!$ ! H5_INDEX_UNKNOWN_F - Unknown index type -!!$ ! H5_INDEX_NAME_F - Index on names -!!$ ! H5_INDEX_CRT_ORDER_F - Index on creation order -!!$ ! H5_INDEX_N_F - Number of indices defined -!!$ INTEGER, INTENT(IN) :: order ! Order in which to iterate over index; Possible values are: -!!$ ! H5_ITER_UNKNOWN_F - Unknown order -!!$ ! H5_ITER_INC_F - Increasing order -!!$ ! H5_ITER_DEC_F - Decreasing order -!!$ ! H5_ITER_NATIVE_F - No particular order, whatever is fastest -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index -!!$ LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute -!!$ INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute -!!$ INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: corder_valid -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_BY_IDX_C'::h5lget_val_by_idx_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: loc_id -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: group_name -!!$ INTEGER(SIZE_T) :: group_namelen -!!$ INTEGER, INTENT(IN) :: index_field -!!$ INTEGER, INTENT(IN) :: order -!!$ INTEGER(HSIZE_T), INTENT(IN) :: n -!!$ INTEGER :: corder_valid -!!$ INTEGER, INTENT(OUT) :: corder -!!$ INTEGER, INTENT(OUT) :: cset -!!$ INTEGER(HSIZE_T), INTENT(OUT) :: data_size -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ END FUNCTION h5lget_val_by_idx_c -!!$ END INTERFACE -!!$ -!!$ group_namelen = LEN(group_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_info_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & -!!$ corder_valid, corder, cset, data_size, lapl_id_default) -!!$ -!!$ f_corder_valid =.FALSE. -!!$ IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. -!!$ -!!$ END SUBROUTINE h5lget_val_by_idx_f - -!!$! -!!$!****s* H5L/h5lget_val_f -!!$! -!!$! NAME -!!$! h5lget_val_f -!!$! -!!$! PURPOSE -!!$! Returns the value of a symbolic link. -!!$! -!!$! INPUTS -!!$! link_loc_id - File or group identifier. -!!$! link_name - Link whose value is to be returned. -!!$! size - Maximum number of characters of link value to be returned. -!!$! -!!$! OUTPUTS -!!$! linkval_buff - The buffer to hold the returned link value. -!!$! hdferr - error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! lapl_id - List access property list identifier. -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! March 3, 2008 -!!$! SOURCE -!!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & -!!$ hdferr, lapl_id) -!!$ IMPLICIT NONE -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(LEN=*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ INTEGER :: corder_valid -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! -!!$ INTERFACE -!!$ INTEGER FUNCTION h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LGET_VAL_C'::h5lget_val_c -!!$ !DEC$ENDIF -!!$ INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: link_name ! Link whose value is to be returned. -!!$ INTEGER :: link_namelen -!!$ INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of characters of link value to be returned. -!!$ -!!$ CHARACTER(LEN=size), INTENT(OUT) :: linkval_buff ! The buffer to hold the returned link value. -!!$ -!!$ INTEGER :: link_namelen -!!$ INTEGER(HID_T) :: lapl_id_default -!!$ -!!$ END FUNCTION h5lget_val_c -!!$ END INTERFACE -!!$ -!!$ link_namelen = LEN(link_name) -!!$ -!!$ lapl_id_default = H5P_DEFAULT_F -!!$ IF(PRESENT(lapl_id)) lapl_id_default = lapl_id -!!$ -!!$ hdferr = h5lget_val_c(link_loc_id, link_name, link_namelen, size, linkval_buff, & -!!$ lapl_id_default) -!!$ -!!$ END SUBROUTINE h5lget_val_f - -!!$! -!!$!****s* H5L/H5Lregistered_f -!!$! -!!$! NAME -!!$! H5Lregistered_f -!!$! -!!$! PURPOSE -!!$! Registers user-defined link class or changes behavior of existing class. -!!$! -!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: -!!$! version - Version number of this struct -!!$! class_id - Link class identifier -!!$! comment - Comment for debugging -!!$! create_func - Callback during link creation -!!$! move_func - Callback after moving link -!!$! copy_func - Callback after copying link -!!$! trav_func - The main traversal function -!!$! del_func - Callback for link deletion -!!$! query_func - Callback for queries -!!$! -!!$! OUTPUTS -!!$! hdferr - Error code -!!$! Success: 0 -!!$! Failure: -1 -!!$! OPTIONAL PARAMETERS -!!$! None -!!$! -!!$! AUTHOR -!!$! M. Scot Breitenfeld -!!$! February 29, 2008 -!!$! -!!$! HISTORY N/A -!!$! -!!$! -!!$! SOURCE -!!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & -!!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) -!!$ IMPLICIT NONE -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(LEN=*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(LEN=*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(LEN=*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(LEN=*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(LEN=*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(LEN=*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(LEN=*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ INTERFACE -!!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func,query_func_len) -!!$ USE H5GLOBAL -!!$ !DEC$IF DEFINED(HDF5F90_WINDOWS) -!!$ !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LREGISTERED_C'::H5Lregistered_c -!!$ !DEC$ENDIF -!!$ INTEGER, INTENT(IN) :: version ! Version number of this struct -!!$ INTEGER, INTENT(IN) :: class_id ! Link class identifier -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: comment ! Comment for debugging -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: create_func ! Callback during link creation -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: move_func ! Callback after moving link -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: copy_func ! Callback after copying link -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: trav_func ! The main traversal function -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: del_func ! Callback for link deletion -!!$ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: query_func ! Callback for queries -!!$ INTEGER, INTENT(OUT) :: hdferr ! Error code: -!!$ ! 0 on success and -1 on failure -!!$ INTEGER :: comment_len -!!$ INTEGER :: create_func_len -!!$ INTEGER :: move_func_len -!!$ INTEGER :: copy_func_len -!!$ INTEGER :: trav_func_len -!!$ INTEGER :: del_func_len -!!$ INTEGER :: query_func_len -!!$ -!!$ END FUNCTION H5Lregistered_c -!!$ END INTERFACE -!!$ -!!$ comment_len = LEN(comment) -!!$ create_func_len = LEN(create_func) -!!$ move_func_len = LEN(move_func) -!!$ copy_func_len = LEN(copy_func) -!!$ trav_func_len = LEN(trav_func) -!!$ del_func_len = LEN(del_func) -!!$ query_func_len = LEN(query_func) -!!$ -!!$ hdferr = H5Lregistered_c(version, class_id, comment, & -!!$ create_func, create_func_len, & -!!$ move_func, move_func_len, & -!!$ copy_func, copy_func_len, & -!!$ trav_func, trav_func_len, & -!!$ del_func, del_func_len, & -!!$ query_func, query_func_len) -!!$ -!!$ END SUBROUTINE H5Lregistered_f - !****s* H5L (F03)/h5literate_f ! ! NAME diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 7b5b5c9..3d87c28 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -4012,22 +4012,6 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Lunregister(int link_cls_id) throws HDF5LibraryException; - // /////// unimplemented //////// - // herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, - // H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, - // hid_t lapl_id); - - // herr_t H5Lregister(const H5L_class_t *cls); - - // herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size, - // unsigned *flags, const char **filename/*out*/, const char **obj_path /*out*/); - // herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, - // size_t size, hid_t lapl_id); - // herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, - // H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - // void *buf/*out*/, size_t size, hid_t lapl_id); - - // //////////////////////////////////////////////////////////// // // // H5O: HDF5 1.8 Object Interface API Functions // diff --git a/src/H5.c b/src/H5.c index f0a222d..d67c346 100644 --- a/src/H5.c +++ b/src/H5.c @@ -21,6 +21,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -224,7 +225,7 @@ H5_init_library(void) if(H5L_init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize link interface") if(H5FS_init() < 0) - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "unable to initialize FS interface") /* Debugging? */ H5_debug_mask("-all"); @@ -267,6 +268,9 @@ H5_term_library(void) /* Indicate that the library is being shut down */ H5_TERM_GLOBAL = TRUE; + /* Push the API context without checking for errors */ + H5CX_push_special(); + /* Check if we should display error output */ (void)H5Eget_auto2(H5E_DEFAULT, &func, NULL); @@ -351,9 +355,12 @@ H5_term_library(void) /* Don't shut down the skip list code until everything that uses it is down */ if(pending == 0) pending += DOWN(SL); - /* Don't shut down the free list code until _everything_ else is down */ + /* Don't shut down the free list code until everything that uses it is down */ if(pending == 0) pending += DOWN(FL); + /* Don't shut down the API context code until _everything_ else is down */ + if(pending == 0) + pending += DOWN(CX); } /* end if */ } while(pending && ntries++ < 100); @@ -409,6 +416,9 @@ H5_term_library(void) /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; + /* Don't pop the API context, since it's been shut down already */ + /* H5CX_pop_special(); */ + done: #ifdef H5_HAVE_THREADSAFE H5_API_UNLOCK diff --git a/src/H5A.c b/src/H5A.c index 07aca92..1b42106 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ @@ -91,7 +92,7 @@ static const H5I_class_t H5I_ATTR_CLS[1] = {{ H5I_ATTR, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5A_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5A__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -250,7 +251,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -270,12 +271,16 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Go do the real work for attaching the attribute to the object */ - if(NULL == (attr = H5A_create(&loc, attr_name, type, space, acpl_id, dxpl_id))) + if(NULL == (attr = H5A__create(&loc, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ @@ -284,8 +289,10 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, done: /* Cleanup on failure */ - if(ret_value < 0 && attr && H5A_close(attr) < 0) + if(ret_value < 0 && attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate2() */ @@ -328,13 +335,9 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5A_t *attr = NULL; /* Attribute created */ H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ H5T_t *type; /* Datatype to use for attribute */ H5S_t *space; /* Dataspace to use for attribute */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -357,33 +360,34 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; + if(H5P_DEFAULT != lapl_id) { + if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") + H5CX_set_lapl(lapl_id); + } /* end if */ - /* Go do the real work for attaching the attribute to the dataset */ - if(NULL == (attr = H5A_create(&obj_loc, attr_name, type, space, acpl_id, dxpl_id))) + /* Create the attribute on the object */ + if(NULL == (attr = H5A__create_by_name(&loc, obj_name, attr_name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") + done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - if(ret_value < 0 && attr && H5A_close(attr) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") + /* Cleanup on failure */ + if(ret_value < 0 && attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Acreate_by_name() */ @@ -413,7 +417,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -427,17 +431,17 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_name(loc.oloc, attr_name, dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) - - /* Finish initializing attribute */ - if(H5A__open_common(&loc, attr) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize attribute") + if(NULL == (attr = H5A__open(&loc, attr_name))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) /* Register the attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) @@ -446,8 +450,10 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen() */ @@ -480,7 +486,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -495,18 +501,23 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - if(H5P_DEFAULT == lapl_id) - lapl_id = H5P_LINK_ACCESS_DEFAULT; - else + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + + if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + H5CX_set_lapl(lapl_id); + } /* end if */ /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, obj_name, attr_name, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Register the attribute and get an ID for it */ @@ -516,8 +527,10 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_name() */ @@ -553,7 +566,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5A_t *attr = NULL; /* Attribute opened */ H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -571,18 +584,23 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(H5P_DEFAULT == lapl_id) - lapl_id = H5P_LINK_ACCESS_DEFAULT; - else + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") + + if(H5P_DEFAULT != lapl_id) { if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") + H5CX_set_lapl(lapl_id); + } /* end if */ /* Open the attribute in the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") /* Register the attribute and get an ID for it */ @@ -592,8 +610,10 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_by_idx() */ @@ -620,8 +640,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -635,15 +654,21 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(attr_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") /* Go write the actual data to the attribute */ - if((ret_value = H5A__write(attr, mem_type, buf, dxpl_id)) < 0) + if((ret_value = H5A__write(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Awrite() */ @@ -669,8 +694,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) { H5A_t *attr; /* Attribute object for ID */ H5T_t *mem_type; /* Memory datatype */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t aapl_id = H5P_DEFAULT; /* temp access plist */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -684,15 +708,18 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) if(NULL == buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&aapl_id, H5P_CLS_AACC, &dxpl_id, attr_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Go write the actual data to the attribute */ - if((ret_value = H5A__read(attr, mem_type, buf, dxpl_id)) < 0) + if((ret_value = H5A__read(attr, mem_type, buf)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aread() */ @@ -752,8 +779,9 @@ done: hid_t H5Aget_type(hid_t attr_id) { - H5A_t *attr; /* Attribute object for ID */ - hid_t ret_value; /* Return value */ + H5A_t *attr; /* Attribute object for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); @@ -762,9 +790,17 @@ H5Aget_type(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if((ret_value = H5A_get_type(attr)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5A__get_type(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") + done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -803,7 +839,7 @@ H5Aget_create_plist(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if((ret_value = H5A_get_create_plist(attr)) < 0) + if((ret_value = H5A__get_create_plist(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get creation property list for attr") done: @@ -880,7 +916,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -899,12 +935,16 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the length of the name */ @@ -919,8 +959,10 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Release resources */ - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_name_by_idx() */ @@ -1018,7 +1060,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1036,12 +1078,16 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, obj_name, attr_name, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, obj_name, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ @@ -1049,9 +1095,11 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info") done: - /* Cleanup on failure */ - if(attr && H5A_close(attr) < 0) + /* Release resources */ + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_name() */ @@ -1077,7 +1125,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute object for name */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1098,12 +1146,16 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(NULL == ainfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, obj_name, idx_type, order, n, lapl_id, dxpl_id))) + if(NULL == (attr = H5A__open_by_idx(&loc, obj_name, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") /* Get the attribute information */ @@ -1112,8 +1164,10 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, done: /* Release resources */ - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Aget_info_by_idx() */ @@ -1135,6 +1189,7 @@ done: herr_t H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1153,12 +1208,22 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Call private attribute rename routine */ - if(H5O_attr_rename(loc.oloc, H5AC_ind_read_dxpl_id, old_name, new_name) < 0) + if(H5A__rename(&loc, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename() */ @@ -1180,6 +1245,7 @@ herr_t H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name, hid_t lapl_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1199,21 +1265,26 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_attr_name, new_attr_name)) { H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by the library */ - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ - if(H5A_rename_by_name(loc, obj_name, old_attr_name, new_attr_name, lapl_id, dxpl_id) < 0) + if(H5A__rename_by_name(loc, obj_name, old_attr_name, new_attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Arename_by_name() */ @@ -1263,9 +1334,7 @@ herr_t H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, void *op_data) { - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1279,20 +1348,18 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_read_dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5A__iterate(loc_id, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(idx) - *idx = last_attr; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate2() */ @@ -1346,15 +1413,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t obj_loc_id = (-1); /* ID for object located */ - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1373,46 +1432,21 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Open the object */ - if((obj_loc_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") - - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP2; - attr_op.u.app_op2 = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") - /* Call attribute iteration routine */ - last_attr = start_idx = (idx ? *idx : 0); - if((ret_value = H5O_attr_iterate(obj_loc_id, dxpl_id, idx_type, order, start_idx, &last_attr, &attr_op, op_data)) < 0) + /* Call attribute iteration by name routine */ + if((ret_value = H5A__iterate_by_name(&loc, obj_name, idx_type, order, idx, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(idx) - *idx = last_attr; - done: - /* Release resources */ - if(obj_loc_id > 0) { - if(H5I_dec_app_ref(obj_loc_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") - } /* end if */ - else if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate_by_name() */ @@ -1435,6 +1469,7 @@ herr_t H5Adelete(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1448,11 +1483,21 @@ H5Adelete(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read") + /* Delete the attribute from the location */ - if(H5O_attr_remove(loc.oloc, name, H5AC_ind_read_dxpl_id) < 0) + if(H5A__delete(&loc, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1478,11 +1523,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1498,29 +1539,21 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ - if(H5O_attr_remove(obj_loc.oloc, attr_name, dxpl_id) < 0) + if(H5A__delete_by_name(&loc, obj_name, attr_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_name() */ @@ -1554,11 +1587,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1576,29 +1605,21 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") /* Delete the attribute from the location */ - if(H5O_attr_remove_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id) < 0) + if(H5A__delete_by_idx(&loc, obj_name, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") done: - /* Release resources */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Adelete_by_idx() */ @@ -1621,6 +1642,7 @@ done: herr_t H5Aclose(hid_t attr_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1629,12 +1651,17 @@ H5Aclose(hid_t attr_id) /* check arguments */ if(NULL == H5I_object_verify(attr_id, H5I_ATTR)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Decrement references to that atom (and close it) */ if(H5I_dec_app_ref(attr_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aclose() */ @@ -1657,6 +1684,7 @@ htri_t H5Aexists(hid_t obj_id, const char *attr_name) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1670,11 +1698,18 @@ H5Aexists(hid_t obj_id, const char *attr_name) if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the attribute exists */ - if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5A__exists(&loc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists() */ @@ -1697,7 +1732,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id) { H5G_loc_t loc; /* Object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1713,14 +1748,20 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if (!attr_name || !*attr_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info") - if ((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) + if ((ret_value = H5A__exists_by_name(loc, obj_name, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aexists_by_name() */ diff --git a/src/H5AC.c b/src/H5AC.c index 4223158..55434b7 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -39,6 +39,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACpkg.h" /* Metadata cache */ #include "H5Cprivate.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ @@ -66,7 +67,7 @@ static herr_t H5AC__check_if_write_permitted(const H5F_t *f, static herr_t H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr, H5C_auto_size_ctl_t *int_conf_ptr); #if H5AC_DO_TAGGING_SANITY_CHECKS -static herr_t H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t * type); +static herr_t H5AC__verify_tag(const H5AC_class_t * type); #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ @@ -81,20 +82,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE; /* Library Private Variables */ /*****************************/ -/* Default dataset transfer property list for metadata I/O calls (coll write, ind read) */ -hid_t H5AC_ind_read_dxpl_id = (-1); -#ifdef H5_HAVE_PARALLEL -/* collective metadata read property */ -hid_t H5AC_coll_read_dxpl_id = (-1); -#endif /* H5_HAVE_PARALLEL */ - -/* DXPL to be used in operations that will not result in I/O calls */ -hid_t H5AC_noio_dxpl_id = (-1); - -/* Default DXPL to be used for raw data I/O operations when one is not - provided by the user (fill values in H5Dcreate) */ -hid_t H5AC_rawdata_dxpl_id = (-1); - #ifdef H5_HAVE_PARALLEL /* Environment variable for collective API sanity checks */ hbool_t H5_coll_api_sanity_check_g = false; @@ -187,18 +174,7 @@ done: herr_t H5AC__init_package(void) { -#if defined H5_DEBUG_BUILD | defined H5_HAVE_PARALLEL - H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ -#endif /* defined H5_DEBUG_BUILD | defined H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL - H5P_coll_md_read_flag_t coll_meta_read; -#endif /* H5_HAVE_PARALLEL */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_NOERR #ifdef H5_HAVE_PARALLEL /* check whether to enable strict collective function calling @@ -212,81 +188,7 @@ H5AC__init_package(void) } #endif /* H5_HAVE_PARALLEL */ -#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) - /* Get an ID for the internal independent metadata dxpl */ - if((H5AC_ind_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get an ID for the no I/O internal dxpl */ - if((H5AC_noio_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* Get an ID for the raw data (H5AC) dxpl */ - if((H5AC_rawdata_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - - /* if this is a debug build, set the dxpl type flag on the - independent metadata dxpl and create the noio and raw data internal dxpls */ -#ifdef H5_DEBUG_BUILD - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_noio_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_NOIO_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* Insert the dxpl type property */ - dxpl_type = H5FD_RAWDATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") -#endif /* H5_DEBUG_BUILD */ - - /* if this is a parallel build, create an internal dxpl for - collective metadata reads */ -#ifdef H5_HAVE_PARALLEL - /* Get an ID for H5AC_coll_read_dxpl_id */ - if((H5AC_coll_read_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_coll_read_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - /* set 'collective metadata read' property */ - coll_meta_read = H5P_USER_TRUE; - if(H5P_set(xfer_plist, H5_COLL_MD_READ_FLAG_NAME, &coll_meta_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective metadata read flag") - - /* if we have a debug build, set the dxpl type to metadata on the - collective metadata dxpl */ -#ifdef H5_DEBUG_BUILD - /* set metadata dxpl type */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set dxpl type property") -#endif /* H5_DEBUG_BUILD */ -#endif /* H5_HAVE_PARALLEL */ - -#else /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - H5AC_ind_read_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_noio_dxpl_id = H5P_DATASET_XFER_DEFAULT; - H5AC_rawdata_dxpl_id = H5P_DATASET_XFER_DEFAULT; -#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - -#if defined(H5_DEBUG_BUILD) | defined(H5_HAVE_PARALLEL) -done: -#endif /* defined(H5_DEBUG_BUILD) | defined(H5_HAVE_PARALLEL) */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5AC__init_package() */ @@ -307,46 +209,13 @@ done: int H5AC_term_package(void) { - int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR - if(H5_PKG_INIT_VAR) { - if(H5AC_ind_read_dxpl_id > 0 || H5AC_noio_dxpl_id > 0 || H5AC_rawdata_dxpl_id > 0 -#ifdef H5_HAVE_PARALLEL - || H5AC_coll_read_dxpl_id > 0 -#endif /* H5_HAVE_PARALLEL */ - ) { -#if defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) - /* Indicate more work to do */ - n = 1; /* H5I */ - - /* Close H5AC dxpls */ - if(H5I_dec_ref(H5AC_ind_read_dxpl_id) < 0 || - H5I_dec_ref(H5AC_noio_dxpl_id) < 0 || - H5I_dec_ref(H5AC_rawdata_dxpl_id) < 0 -#ifdef H5_HAVE_PARALLEL - || H5I_dec_ref(H5AC_coll_read_dxpl_id) < 0 -#endif /* H5_HAVE_PARALLEL */ - ) - H5E_clear_stack(NULL); /*ignore error*/ -#endif /* defined(H5_HAVE_PARALLEL) || defined(H5_DEBUG_BUILD) */ - - /* Reset static IDs */ - H5AC_ind_read_dxpl_id = (-1); - H5AC_noio_dxpl_id = (-1); - H5AC_rawdata_dxpl_id = (-1); -#ifdef H5_HAVE_PARALLEL - H5AC_coll_read_dxpl_id = (-1); -#endif /* H5_HAVE_PARALLEL */ - } /* end if */ - + if(H5_PKG_INIT_VAR) /* Reset interface initialization flag */ - if(0 == n) - H5_PKG_INIT_VAR = FALSE; - } /* end if */ + H5_PKG_INIT_VAR = FALSE; - FUNC_LEAVE_NOAPI(n) + FUNC_LEAVE_NOAPI(0) } /* end H5AC_term_package() */ @@ -598,7 +467,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_dest(H5F_t *f, hid_t dxpl_id) +H5AC_dest(H5F_t *f) { #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; @@ -646,15 +515,14 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) * Must not flush in the R/O case, as this will trigger the * free space manager settle routines. */ - if ( ( H5F_ACC_RDWR & H5F_INTENT(f) ) && - ( H5AC__flush_entries(f, dxpl_id) < 0 ) ) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") + if(H5F_ACC_RDWR & H5F_INTENT(f)) + if(H5AC__flush_entries(f) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") #endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ - if(H5C_dest(f, dxpl_id) < 0) + if(H5C_dest(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; @@ -696,7 +564,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_evict(H5F_t *f, hid_t dxpl_id) +H5AC_evict(H5F_t *f) { hbool_t log_enabled; /* TRUE if logging was set up */ hbool_t curr_logging; /* TRUE if currently logging */ @@ -714,7 +582,7 @@ H5AC_evict(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unable to get logging status") /* Evict all entries in the cache except the pinned superblock entry */ - if(H5C_evict(f, dxpl_id) < 0) + if(H5C_evict(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't evict cache") done: @@ -743,8 +611,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, unsigned flags) +H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -781,7 +649,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, } #endif /* H5AC__TRACE_FILE_ENABLED */ - if(H5C_expunge_entry(f, dxpl_id, type, addr, flags) < 0) + if(H5C_expunge_entry(f, type, addr, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed") done: @@ -820,7 +688,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_flush(H5F_t *f, hid_t dxpl_id) +H5AC_flush(H5F_t *f) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -855,13 +723,13 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") /* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */ - if(H5AC__flush_entries(f, dxpl_id) < 0) + if(H5AC__flush_entries(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") #endif /* H5_HAVE_PARALLEL */ /* Flush the cache */ /* (Again, in parallel - writes out the superblock) */ - if(H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(H5C_flush_cache(f, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: @@ -900,7 +768,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_force_cache_image_load(H5F_t *f, hid_t dxpl_id) +H5AC_force_cache_image_load(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -911,7 +779,7 @@ H5AC_force_cache_image_load(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); HDassert(f->shared->cache); - if(H5C_force_cache_image_load(f, dxpl_id) < 0) + if(H5C_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "Can't load cache image") done: @@ -1003,8 +871,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned int flags) +H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned int flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1048,12 +916,12 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0) + if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ /* Insert entry into metadata cache */ - if(H5C_insert_entry(f, dxpl_id, type, addr, thing, flags) < 0) + if(H5C_insert_entry(f, type, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed") #if H5AC__TRACE_FILE_ENABLED @@ -1073,7 +941,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add /* Check if we should try to flush */ if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) - if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") } /* end if */ } @@ -1431,12 +1299,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, - haddr_t new_addr, hid_t -#ifndef H5_HAVE_PARALLEL -H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - dxpl_id) +H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1486,7 +1349,7 @@ H5_ATTR_UNUSED #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold) - if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ @@ -1591,7 +1454,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id) +H5AC_prep_for_file_close(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1602,7 +1465,7 @@ H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); HDassert(f->shared->cache); - if(H5C_prep_for_file_close(f, dxpl_id) < 0) + if(H5C_prep_for_file_close(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache prep for file close failed") done: @@ -1701,8 +1564,8 @@ done: *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *udata, unsigned flags) +H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1755,11 +1618,11 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC__TRACE_FILE_ENABLED */ #if H5AC_DO_TAGGING_SANITY_CHECKS - if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(dxpl_id, type) < 0) + if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Bad tag value") #endif /* H5AC_DO_TAGGING_SANITY_CHECKS */ - if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags))) + if(NULL == (thing = H5C_protect(f, type, addr, udata, flags))) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed") #if H5AC__TRACE_FILE_ENABLED @@ -2039,8 +1902,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing, unsigned flags) +H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, + unsigned flags) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -2111,13 +1974,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, } /* end if */ #endif /* H5_HAVE_PARALLEL */ - if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0) + if(H5C_unprotect(f, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed") #ifdef H5_HAVE_PARALLEL /* Check if we should try to flush */ if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)) - if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point") #endif /* H5_HAVE_PARALLEL */ @@ -2765,33 +2628,19 @@ done: * *------------------------------------------------------------------------------ */ -herr_t -H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag) +void +H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag) { - H5P_genplist_t *dxpl; /* Dataset transfer property list */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check Arguments */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get the current tag value and return that (if prev_tag is NOT null) */ - if(prev_tag) { - haddr_t tag; /* Tag value */ + if(prev_tag) + *prev_tag = H5CX_get_tag(); - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query dxpl") - *prev_tag = tag; - } /* end if */ + /* Set the provided tag */ + H5CX_set_tag(metadata_tag); - /* Set the provided tag in the dxpl_id. */ - if(H5P_set(dxpl, H5AC_TAG_NAME, &metadata_tag) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set tag in dxpl") - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOID } /* H5AC_tag */ @@ -2843,7 +2692,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) +H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2856,7 +2705,7 @@ H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) HDassert(f->shared); /* Call cache level function to flush metadata entries with specified tag */ - if(H5C_flush_tagged_entries(f, dxpl_id, metadata_tag) < 0) + if(H5C_flush_tagged_entries(f, metadata_tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot flush metadata") done: @@ -2878,7 +2727,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id) +H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2891,7 +2740,7 @@ H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global HDassert(f->shared); /* Call cache level function to evict metadata entries with specified tag */ - if(H5C_evict_tagged_entries(f, dxpl_id, metadata_tag, match_global) < 0) + if(H5C_evict_tagged_entries(f, metadata_tag, match_global) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot evict metadata") done: @@ -2912,7 +2761,7 @@ done: *------------------------------------------------------------------------------ */ herr_t -H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags) +H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { /* Variable Declarations */ herr_t ret_value = SUCCEED; @@ -2925,7 +2774,7 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id HDassert(f->shared); /* Call cache level function to expunge entries with specified tag and type id */ - if(H5C_expunge_tag_type_metadata(f, dxpl_id, tag, type_id, flags)<0) + if(H5C_expunge_tag_type_metadata(f, tag, type_id, flags)<0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot expunge tagged type entries") done: @@ -3019,21 +2868,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__verify_tag(hid_t dxpl_id, const H5AC_class_t *type) +H5AC__verify_tag(const H5AC_class_t *type) { - H5P_genplist_t *dxpl; /* DXPL for operation */ haddr_t tag; /* Entry tag to validate */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value") + /* Get the current tag */ + tag = H5CX_get_tag(); /* Verify legal tag value */ if(H5C_verify_tag(type->id, tag) < 0) @@ -3095,67 +2938,23 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, - H5AC_ring_t *orig_ring) +void +H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) { - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Sanity checks */ - HDassert(dxpl); - HDassert(orig_ring); + /* Get the current ring value and return that (if orig_ring is NOT null) */ + if(orig_ring) + *orig_ring = H5CX_get_ring(); - /* Set the ring type in the DXPL */ - if(NULL == ((*dxpl) = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if((H5P_get((*dxpl), H5AC_RING_NAME, orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get original ring value") - if((H5P_set((*dxpl), H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the provided ring */ + H5CX_set_ring(ring); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOID } /* end H5AC_set_ring() */ /*------------------------------------------------------------------------- - * Function: H5AC_reset_ring - * - * Purpose: Routine to reset the original ring on a DXPL (after passing - * through to the metadata cache). - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Tuesday, September 8, 2015 - * - *------------------------------------------------------------------------- - */ -herr_t -H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Reset the ring in the DXPL, if it's been changed */ - if(orig_ring) { - /* Sanity check */ - HDassert(dxpl); - - if((H5P_set(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5AC_reset_ring() */ - - -/*------------------------------------------------------------------------- * Function: H5AC_unsettle_entry_ring() * * Purpose: Advise the metadata cache that the specified entry's metadata diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index d03c17b..03e31b4 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -94,20 +94,19 @@ static herr_t H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr, int sync_point_op); static herr_t H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); -static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, - hid_t dxpl_id); +static herr_t H5AC__propagate_and_apply_candidate_list(H5F_t *f); +static herr_t H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f); static herr_t H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); static herr_t H5AC__receive_candidate_list(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, haddr_t **haddr_buf_ptr_ptr); -static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__receive_and_apply_clean_list(H5F_t *f); static herr_t H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr); -static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id); -static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +static herr_t H5AC__rsp__dist_md_write__flush(H5F_t *f); +static herr_t H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f); +static herr_t H5AC__rsp__p0_only__flush(H5F_t *f); +static herr_t H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f); /*********************/ @@ -1226,7 +1225,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) +H5AC__propagate_and_apply_candidate_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1275,7 +1274,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_candidates, + result = H5C_apply_candidate_list(f, cache_ptr, num_candidates, candidates_list_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -1393,7 +1392,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) +H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1416,7 +1415,7 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f, hid_t dxpl_id) HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); } /* end if */ else { - if(H5AC__receive_and_apply_clean_list(f, dxpl_id) < 0) + if(H5AC__receive_and_apply_clean_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") } /* end else */ @@ -1516,7 +1515,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) +H5AC__receive_and_apply_clean_list(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1541,7 +1540,7 @@ H5AC__receive_and_apply_clean_list(H5F_t *f, hid_t dxpl_id) if(num_entries > 0) /* mark the indicated entries as clean */ - if(H5C_mark_entries_as_clean(f, dxpl_id, num_entries, haddr_buf_ptr) < 0) + if(H5C_mark_entries_as_clean(f, num_entries, haddr_buf_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't mark entries clean.") /* if it is defined, call the sync point done callback. Note @@ -1659,7 +1658,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__dist_md_write__flush(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1702,7 +1701,7 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Apply the candidate list */ - result = H5C_apply_candidate_list(f, dxpl_id, cache_ptr, num_entries, + result = H5C_apply_candidate_list(f, cache_ptr, num_entries, haddr_buf_ptr, aux_ptr->mpi_rank, aux_ptr->mpi_size); /* Disable writes again */ @@ -1801,7 +1800,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1830,7 +1829,7 @@ H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate list.") /* propagate and apply candidate list -- all processes */ - if(H5AC__propagate_and_apply_candidate_list(f, dxpl_id) < 0) + if(H5AC__propagate_and_apply_candidate_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate and apply candidate list.") } /* evictions enabled */ @@ -1876,7 +1875,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__p0_only__flush(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -1909,7 +1908,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET); + result = H5C_flush_cache(f, H5AC__NO_FLAGS_SET); /* Disable writes again */ aux_ptr->write_permitted = FALSE; @@ -1927,7 +1926,7 @@ H5AC__rsp__p0_only__flush(H5F_t *f, hid_t dxpl_id) } /* end if */ /* Propagate cleaned entries to other ranks. */ - if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") done: @@ -1978,7 +1977,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) +H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -2030,7 +2029,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) aux_ptr->write_permitted = TRUE; /* Flush the cache */ - result = H5C_flush_to_min_clean(f, dxpl_id); + result = H5C_flush_to_min_clean(f); /* Disable writes again */ aux_ptr->write_permitted = FALSE; @@ -2047,7 +2046,7 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f, hid_t dxpl_id) (aux_ptr->write_done)(); } /* end if */ - if(H5AC__propagate_flushed_and_still_clean_entries_list(f, dxpl_id) < 0) + if(H5AC__propagate_flushed_and_still_clean_entries_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.") } /* end if */ @@ -2088,7 +2087,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op) +H5AC__run_sync_point(H5F_t *f, int sync_point_op) { H5AC_t * cache_ptr; H5AC_aux_t * aux_ptr; @@ -2130,12 +2129,12 @@ HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu case H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC__rsp__p0_only__flush_to_min_clean(f, dxpl_id) < 0) + if(H5AC__rsp__p0_only__flush_to_min_clean(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC__rsp__p0_only__flush(f, dxpl_id) < 0) + if(H5AC__rsp__p0_only__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__p0_only__flush() failed.") break; @@ -2148,12 +2147,12 @@ HDfprintf(stdout, "%d:H5AC_propagate...:%u: (u/uu/i/iu/r/ru) = %zu/%u/%zu/%u/%zu case H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: switch(sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: - if(H5AC__rsp__dist_md_write__flush_to_min_clean(f, dxpl_id) < 0) + if(H5AC__rsp__dist_md_write__flush_to_min_clean(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush_to_min_clean() failed.") break; case H5AC_SYNC_POINT_OP__FLUSH_CACHE: - if(H5AC__rsp__dist_md_write__flush(f, dxpl_id) < 0) + if(H5AC__rsp__dist_md_write__flush(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5AC__rsp__dist_md_write__flush() failed.") break; @@ -2284,7 +2283,7 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, *------------------------------------------------------------------------- */ herr_t -H5AC__flush_entries(H5F_t *f, hid_t dxpl_id) +H5AC__flush_entries(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2296,7 +2295,7 @@ H5AC__flush_entries(H5F_t *f, hid_t dxpl_id) /* Check if we have >1 ranks */ if(H5C_get_aux_ptr(f->shared->cache)) - if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) + if(H5AC__run_sync_point(f, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.") done: diff --git a/src/H5ACpkg.h b/src/H5ACpkg.h index ea7f0bf..409d914 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -425,8 +425,8 @@ H5_DLL herr_t H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, H5_DLL herr_t H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr); H5_DLL herr_t H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr); -H5_DLL herr_t H5AC__flush_entries(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, hid_t dxpl_id, int sync_point_op); +H5_DLL herr_t H5AC__flush_entries(H5F_t *f); +H5_DLL herr_t H5AC__run_sync_point(H5F_t *f, int sync_point_op); H5_DLL herr_t H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, void (*sync_point_done)(unsigned num_writes, haddr_t *written_entries_tbl)); H5_DLL herr_t H5AC__set_write_done_callback(H5C_t * cache_ptr, diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 083ee5b..99cc0e9 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -50,11 +50,6 @@ #define H5AC__SOHM_TAG (haddr_t)5 #define H5AC__GLOBALHEAP_TAG (haddr_t)6 -/* Definitions for cache "tag" property */ -#define H5AC_TAG_NAME "H5AC_tag" -#define H5AC_TAG_SIZE sizeof(haddr_t) -#define H5AC_TAG_DEF (H5AC__INVALID_TAG) - /* Types of metadata objects cached */ typedef enum { H5AC_BT_ID = 0, /* ( 0) B-tree nodes */ @@ -230,22 +225,6 @@ typedef struct H5AC_proxy_entry_t { /* (Note that this currently duplicates some cache functionality) */ } H5AC_proxy_entry_t; -/* Name of property for ring info in DXPL */ -#define H5AC_RING_NAME "H5AC_ring_type" - -/* Dataset transfer property lists for metadata calls */ -H5_DLLVAR hid_t H5AC_ind_read_dxpl_id; -#ifdef H5_HAVE_PARALLEL -H5_DLLVAR hid_t H5AC_coll_read_dxpl_id; -#endif /* H5_HAVE_PARALLEL */ - -/* DXPL to be used in operations that will not result in I/O calls */ -H5_DLLVAR hid_t H5AC_noio_dxpl_id; - -/* DXPL to be used for raw data I/O operations when one is not - provided by the user (fill values in H5Dcreate) */ -H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; - /* Default cache configuration. */ #define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED @@ -410,29 +389,29 @@ H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr); H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status_ptr); -H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, +H5_DLL herr_t H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); -H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5AC_prep_for_file_close(H5F_t *f); H5_DLL herr_t H5AC_create_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *udata, unsigned flags); +H5_DLL void * H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + void *udata, unsigned flags); H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL herr_t H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *thing, unsigned flags); -H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, + void *thing, unsigned flags); +H5_DLL herr_t H5AC_flush(H5F_t *f); H5_DLL herr_t H5AC_mark_entry_dirty(void *thing); H5_DLL herr_t H5AC_mark_entry_clean(void *thing); H5_DLL herr_t H5AC_mark_entry_unserialized(void *thing); H5_DLL herr_t H5AC_mark_entry_serialized(void *thing); H5_DLL herr_t H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, - haddr_t old_addr, haddr_t new_addr, hid_t dxpl_id); -H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_evict(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5AC_class_t *type, haddr_t addr, unsigned flags); + haddr_t old_addr, haddr_t new_addr); +H5_DLL herr_t H5AC_dest(H5F_t *f); +H5_DLL herr_t H5AC_evict(H5F_t *f); +H5_DLL herr_t H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, + haddr_t addr, unsigned flags); H5_DLL herr_t H5AC_remove_entry(void *entry); H5_DLL herr_t H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr); @@ -449,24 +428,23 @@ H5_DLL herr_t H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5AC_validate_cache_image_config(H5AC_cache_image_config_t *config_ptr); H5_DLL hbool_t H5AC_cache_image_pending(const H5F_t *f); -H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f, hid_t dxpl_id); +H5_DLL herr_t H5AC_force_cache_image_load(H5F_t * f); H5_DLL herr_t H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); /* Tag & Ring routines */ -H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag); -H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id); -H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id); +H5_DLL void H5AC_tag(haddr_t metadata_tag, haddr_t *prev_tag); +H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag); +H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global); H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag); H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f); H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked); H5_DLL herr_t H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring); -H5_DLL herr_t H5AC_set_ring(hid_t dxpl_id, H5AC_ring_t ring, H5P_genplist_t **dxpl, - H5AC_ring_t *orig_ring); -H5_DLL herr_t H5AC_reset_ring(H5P_genplist_t *dxpl, H5AC_ring_t orig_ring); +H5_DLL void H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring); H5_DLL herr_t H5AC_unsettle_entry_ring(void *entry); H5_DLL herr_t H5AC_unsettle_ring(H5F_t * f, H5AC_ring_t ring); -H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags); +H5_DLL herr_t H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, + unsigned flags); H5_DLL herr_t H5AC_get_tag(const void *thing, /*OUT*/ haddr_t *tag); /* Virtual entry routines */ @@ -474,7 +452,7 @@ H5_DLL H5AC_proxy_entry_t *H5AC_proxy_entry_create(void); H5_DLL herr_t H5AC_proxy_entry_add_parent(H5AC_proxy_entry_t *pentry, void *parent); H5_DLL herr_t H5AC_proxy_entry_remove_parent(H5AC_proxy_entry_t *pentry, void *parent); H5_DLL herr_t H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, - hid_t dxpl_id, void *child); + void *child); H5_DLL herr_t H5AC_proxy_entry_remove_child(H5AC_proxy_entry_t *pentry, void *child); H5_DLL herr_t H5AC_proxy_entry_dest(H5AC_proxy_entry_t *pentry); diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 105a531..498d023 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -284,8 +284,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, hid_t dxpl_id, - void *child) +H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, void *child) { herr_t ret_value = SUCCEED; /* Return value */ @@ -303,7 +302,7 @@ H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "temporary file space allocation failed for proxy entry") /* Insert the proxy entry into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_PROXY_ENTRY, pentry->addr, pentry, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_PROXY_ENTRY, pentry->addr, pentry, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to cache proxy entry") /* Proxies start out clean (insertions are automatically marked dirty) */ diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index ed67e0f..a3f7bba 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -54,7 +54,6 @@ typedef struct H5A_fh_ud_cmp_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of attribute to compare */ const H5A_dense_bt2_name_rec_t *record; /* v2 B-tree record for attribute */ H5A_bt2_found_t found_op; /* Callback when correct attribute is found */ @@ -168,7 +167,7 @@ H5A__dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_STATIC /* Decode attribute information */ - if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Compare the string values */ @@ -270,7 +269,6 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.record = bt2_rec; fh_udata.found_op = bt2_udata->found_op; @@ -287,7 +285,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int HDassert(fheap); /* Check if the user's attribute and the B-tree's attribute have the same name */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(fheap, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ diff --git a/src/H5Adense.c b/src/H5Adense.c index b1903a4..f76e106 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -72,7 +72,6 @@ typedef struct H5A_bt2_od_wrt_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle to operate on */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ H5A_t *attr; /* Attribute to write */ @@ -86,7 +85,6 @@ typedef struct H5A_bt2_od_wrt_t { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ hsize_t count; /* # of attributes examined */ @@ -109,7 +107,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const H5A_dense_bt2_name_rec_t *record; /* v2 B-tree record for attribute */ /* upward */ @@ -133,7 +130,6 @@ typedef struct H5A_bt2_ud_rm_t { typedef struct H5A_bt2_ud_rmbi_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ H5_index_t idx_type; /* Index type for operation */ @@ -168,7 +164,7 @@ typedef struct H5A_bt2_ud_rmbi_t { /*------------------------------------------------------------------------- - * Function: H5A_dense_create + * Function: H5A__dense_create * * Purpose: Creates dense attribute storage structures for an object * @@ -181,7 +177,7 @@ typedef struct H5A_bt2_ud_rmbi_t { *------------------------------------------------------------------------- */ herr_t -H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) +H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ @@ -190,7 +186,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -210,7 +206,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) fheap_cparam.max_man_size = H5O_FHEAP_MAX_MAN_SIZE; /* Create fractal heap for storing attributes */ - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create fractal heap") /* Retrieve the heap's address in the file */ @@ -244,7 +240,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_name = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -265,7 +261,7 @@ HDfprintf(stderr, "%s: ainfo->name_bt2_addr = %a\n", FUNC, ainfo->name_bt2_addr) H5O_FHEAP_ID_LEN; /* Fractal heap ID */ bt2_cparam.split_percent = H5A_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5A_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_corder = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -278,15 +274,15 @@ HDfprintf(stderr, "%s: ainfo->corder_bt2_addr = %a\n", FUNC, ainfo->corder_bt2_a done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_create() */ +} /* end H5A__dense_create() */ /*------------------------------------------------------------------------- @@ -324,7 +320,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) /*------------------------------------------------------------------------- - * Function: H5A_dense_open + * Function: H5A__dense_open * * Purpose: Open an attribute in dense storage structures for an object * @@ -337,7 +333,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) *------------------------------------------------------------------------- */ H5A_t * -H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -347,7 +343,7 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na htri_t attr_exists; /* Attribute exists in v2 B-tree */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -357,11 +353,11 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na HDassert(name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -369,24 +365,23 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record find */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = name; @@ -397,26 +392,26 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na udata.found_op_data = &ret_value; /* Find & copy the attribute in the 'name' index */ - if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute in name index") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, NULL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_open() */ +} /* end H5A__dense_open() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_insert + * Function: H5A__dense_insert * * Purpose: Insert an attribute into dense storage structures for an object * @@ -429,7 +424,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) +H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) { H5A_bt2_ud_ins_t udata; /* User data for v2 B-tree insertion */ H5HF_t *fheap = NULL; /* Fractal heap handle for attributes */ @@ -442,7 +437,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -452,7 +447,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) HDassert(attr); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -468,7 +463,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) mesg_flags |= H5O_MSG_FLAG_SHARED; else { /* Should this attribute be written as a SOHM? */ - if(H5SM_try_share(f, dxpl_id, NULL, 0, H5O_ATTR_ID, attr, &mesg_flags) < 0) + if(H5SM_try_share(f, NULL, 0, H5O_ATTR_ID, attr, &mesg_flags) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Attributes can't be "unique be shareable" yet */ @@ -476,19 +471,19 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) } /* end else */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check for inserting shared attribute */ @@ -521,17 +516,16 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Insert the serialized attribute into the fractal heap */ /* (sets the heap ID in the user data) */ - if(H5HF_insert(fheap, dxpl_id, attr_size, attr_ptr, &udata.id) < 0) + if(H5HF_insert(fheap, attr_size, attr_ptr, &udata.id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert attribute into fractal heap") } /* end else */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the callback information for v2 B-tree record insertion */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.shared_fheap = shared_fheap; udata.common.name = attr->shared->name; @@ -543,36 +537,36 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* udata.id already set */ /* Insert attribute into 'name' tracking v2 B-tree */ - if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ if(ainfo->index_corder) { /* Open the creation order index v2 B-tree */ HDassert(H5F_addr_defined(ainfo->corder_bt2_addr)); - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, ainfo->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_insert() */ +} /* end H5A__dense_insert() */ /*------------------------------------------------------------------------- @@ -647,7 +641,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) /* Check for modifying shared attribute */ if(record->flags & H5O_MSG_FLAG_SHARED) { /* Update the shared attribute in the SOHM info */ - if(H5O_attr_update_shared(op_data->f, op_data->dxpl_id, NULL, op_data->attr, NULL) < 0) + if(H5O__attr_update_shared(op_data->f, NULL, op_data->attr, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute in shared storage") /* Update record's heap ID */ @@ -658,12 +652,11 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(op_data->f, op_data->dxpl_id, op_data->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(op_data->f, op_data->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = op_data->f; - udata.dxpl_id = op_data->dxpl_id; udata.fheap = NULL; udata.shared_fheap = NULL; udata.name = NULL; @@ -674,7 +667,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) udata.found_op_data = NULL; /* Modify record for creation order index */ - if(H5B2_modify(bt2_corder, op_data->dxpl_id, &udata, H5A__dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) + if(H5B2_modify(bt2_corder, &udata, H5A__dense_write_bt2_cb2, &op_data->attr->sh_loc.u.heap_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") } /* end if */ @@ -706,20 +699,20 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) { size_t obj_len; /* Length of existing encoded attribute */ - if(H5HF_get_obj_len(op_data->fheap, op_data->dxpl_id, &record->id, &obj_len) < 0) + if(H5HF_get_obj_len(op_data->fheap, &record->id, &obj_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get object size") HDassert(obj_len == attr_size); } #endif /* NDEBUG */ /* Update existing attribute in heap */ /* (might be more efficient as fractal heap 'op' callback, but leave that for later -QAK) */ - if(H5HF_write(op_data->fheap, op_data->dxpl_id, &record->id, changed, attr_ptr) < 0) + if(H5HF_write(op_data->fheap, &record->id, changed, attr_ptr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute in heap") } /* end else */ done: /* Release resources */ - if(bt2_corder && H5B2_close(bt2_corder, op_data->dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") @@ -729,7 +722,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_write + * Function: H5A__dense_write * * Purpose: Modify an attribute in dense storage structures for an object * @@ -742,7 +735,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) +H5A__dense_write(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5A_bt2_od_wrt_t op_data; /* "Op data" for v2 B-tree modify */ @@ -752,7 +745,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -764,7 +757,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) HDassert(attr); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -772,28 +765,27 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = attr->shared->name; @@ -805,27 +797,26 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Create the "op_data" for the v2 B-tree record 'modify' callback */ op_data.f = f; - op_data.dxpl_id = dxpl_id; op_data.fheap = fheap; op_data.shared_fheap = shared_fheap; op_data.attr = attr; op_data.corder_bt2_addr = ainfo->corder_bt2_addr; /* Modify attribute through 'name' tracking v2 B-tree */ - if(H5B2_modify(bt2_name, dxpl_id, &udata, H5A__dense_write_bt2_cb, &op_data) < 0) + if(H5B2_modify(bt2_name, &udata, H5A__dense_write_bt2_cb, &op_data) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to modify record in v2 B-tree") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_write() */ +} /* end H5A__dense_write() */ /*------------------------------------------------------------------------- @@ -857,7 +848,7 @@ H5A__dense_copy_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail) */ - if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) + if(NULL == (udata->attr = (H5A_t *)H5O_msg_decode(udata->f, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, FAIL, "can't decode attribute") /* Set the creation order index for the attribute */ @@ -873,7 +864,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_rename + * Function: H5A__dense_rename * * Purpose: Rename an attribute in dense storage structures for an object * @@ -886,7 +877,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *old_name, +H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, const char *new_name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ @@ -899,7 +890,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -910,7 +901,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(new_name); /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -918,28 +909,27 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record modify */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = old_name; @@ -950,7 +940,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = &attr_copy; /* Get copy of attribute through 'name' tracking v2 B-tree */ - if((attr_exists = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((attr_exists = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") else if(attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index") @@ -970,12 +960,12 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * attr_copy->shared->name = H5MM_xstrdup(new_name); /* Recompute the version to encode the attribute with */ - if(H5A_set_version(f, attr_copy) < 0) + if(H5A__set_version(f, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "unable to update attribute version") /* Insert renamed attribute back into dense storage */ /* (Possibly making it shared) */ - if(H5A_dense_insert(f, dxpl_id, ainfo, attr_copy) < 0) + if(H5A__dense_insert(f, ainfo, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage") /* Was this attribute shared? */ @@ -983,7 +973,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * hsize_t attr_rc; /* Attribute's ref count in shared message storage */ /* Retrieve ref count for shared attribute */ - if(H5SM_get_refcount(f, dxpl_id, H5O_ATTR_ID, &attr_copy->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(f, H5O_ATTR_ID, &attr_copy->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If the newly shared attribute needs to share "ownership" of the shared @@ -995,36 +985,36 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * */ if(attr_rc == 1) { /* Increment reference count on attribute components */ - if(H5O_attr_link(f, dxpl_id, NULL, attr_copy) < 0) + if(H5O__attr_link(f, NULL, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ } /* end if */ else if(shared_mesg == 0) { /* Increment reference count on attribute components */ /* (so that they aren't deleted when the attribute is removed shortly) */ - if(H5O_attr_link(f, dxpl_id, NULL, attr_copy) < 0) + if(H5O__attr_link(f, NULL, attr_copy) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ else if(shared_mesg < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Delete old attribute from dense storage */ - if(H5A_dense_remove(f, dxpl_id, ainfo, old_name) < 0) + if(H5A__dense_remove(f, ainfo, old_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") if(attr_copy) H5O_msg_free(H5O_ATTR_ID, attr_copy); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_rename() */ +} /* end H5A__dense_rename() */ /*------------------------------------------------------------------------- @@ -1065,12 +1055,11 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; fh_udata.attr = NULL; /* Call fractal heap 'op' routine, to copy the attribute information */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Check which type of callback to make */ @@ -1125,7 +1114,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_iterate + * Function: H5A__dense_iterate * * Purpose: Iterate over attributes in dense storage structures for an object * @@ -1138,7 +1127,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainfo, +H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) { @@ -1149,7 +1138,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1189,11 +1178,11 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf htri_t attr_sharable; /* Flag indicating attributes are sharable */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1201,24 +1190,23 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree iterator callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.loc_id = loc_id; @@ -1229,7 +1217,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, dxpl_id, H5A__dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5A__dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed"); /* Update the last attribute examined, if requested */ @@ -1239,27 +1227,27 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf else { /* Build the table of attributes for this object */ /* (build table using the name index, but sort according to idx_type) */ - if(H5A_dense_build_table(f, dxpl_id, ainfo, idx_type, order, &atable) < 0) + if(H5A__dense_build_table(f, ainfo, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error building table of attributes") /* Iterate over attributes in table */ - if((ret_value = H5A_attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) + if((ret_value = H5A__attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_iterate() */ +} /* end H5A__dense_iterate() */ /*------------------------------------------------------------------------- @@ -1289,37 +1277,37 @@ H5A__dense_remove_bt2_cb(const void *_record, void *_udata) /* Check for removing the link from the creation order index */ if(H5F_addr_defined(udata->corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(udata->common.f, udata->common.dxpl_id, udata->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(udata->common.f, udata->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata->common.corder = attr->shared->crt_idx; /* Remove the record from the creation order index v2 B-tree */ - if(H5B2_remove(bt2_corder, udata->common.dxpl_id, udata, NULL, NULL) < 0) + if(H5B2_remove(bt2_corder, udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from creation order index v2 B-tree") } /* end if */ /* Check for removing shared attribute */ if(record->flags & H5O_MSG_FLAG_SHARED) { /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(udata->common.f, udata->common.dxpl_id, NULL, &(attr->sh_loc)) < 0) + if(H5SM_delete(udata->common.f, NULL, &(attr->sh_loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { /* Perform the deletion action on the attribute */ /* (takes care of shared & committed datatype/dataspace components) */ - if(H5O_attr_delete(udata->common.f, udata->common.dxpl_id, NULL, attr) < 0) + if(H5O__attr_delete(udata->common.f, NULL, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") /* Remove record from fractal heap */ - if(H5HF_remove(udata->common.fheap, udata->common.dxpl_id, &record->id) < 0) + if(H5HF_remove(udata->common.fheap, &record->id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from fractal heap") } /* end else */ done: /* Release resources */ - if(bt2_corder && H5B2_close(bt2_corder, udata->common.dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) @@ -1327,7 +1315,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_remove + * Function: H5A__dense_remove * * Purpose: Remove an attribute from the dense storage of an object * @@ -1340,7 +1328,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1350,7 +1338,7 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1360,11 +1348,11 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(name && *name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1372,24 +1360,23 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.shared_fheap = shared_fheap; udata.common.name = name; @@ -1399,22 +1386,22 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.corder_bt2_addr = ainfo->corder_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2_name, dxpl_id, &udata, H5A__dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2_name, &udata, H5A__dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from name index v2 B-tree") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") if(attr_copy) - H5O_msg_free_real(H5O_MSG_ATTR, attr_copy); + H5O__msg_free_real(H5O_MSG_ATTR, attr_copy); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_remove() */ +} /* end H5A__dense_remove() */ /*------------------------------------------------------------------------- @@ -1446,7 +1433,6 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; fh_udata.attr = NULL; @@ -1459,7 +1445,7 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Check whether to make a copy of the attribute or just need the shared location info */ if(H5F_addr_defined(bt2_udata->other_bt2_addr) || !(record->flags & H5O_MSG_FLAG_SHARED)) { /* Call fractal heap 'op' routine, to make copy of attribute to remove */ - if(H5HF_op(fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, FAIL, "attribute removal callback failed") HDassert(fh_udata.attr); @@ -1488,7 +1474,6 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; - other_bt2_udata.dxpl_id = bt2_udata->dxpl_id; other_bt2_udata.fheap = bt2_udata->fheap; other_bt2_udata.shared_fheap = bt2_udata->shared_fheap; other_bt2_udata.name = fh_udata.attr->shared->name; @@ -1498,13 +1483,13 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) } /* end else */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->other_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->other_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the "other" index v2 B-tree */ - if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove record from 'other' index v2 B-tree") } /* end if */ @@ -1519,23 +1504,23 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) sh_loc_ptr = &(fh_udata.attr->sh_loc); /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, sh_loc_ptr) < 0) + if(H5SM_delete(bt2_udata->f, NULL, sh_loc_ptr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { /* Perform the deletion action on the attribute */ /* (takes care of shared & committed datatype/dataspace components) */ - if(H5O_attr_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.attr) < 0) + if(H5O__attr_delete(bt2_udata->f, NULL, fh_udata.attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") /* Remove record from fractal heap */ - if(H5HF_remove(fheap, bt2_udata->dxpl_id, &record->id) < 0) + if(H5HF_remove(fheap, &record->id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from fractal heap") } /* end else */ done: /* Release resources */ - if(bt2 && H5B2_close(bt2, bt2_udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(fh_udata.attr) H5O_msg_free(H5O_ATTR_ID, fh_udata.attr); @@ -1545,7 +1530,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_remove_by_idx + * Function: H5A__dense_remove_by_idx * * Purpose: Remove an attribute from the dense storage of an object, * according to the order within an index @@ -1559,8 +1544,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n) +H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5HF_t *shared_fheap = NULL; /* Fractal heap handle for shared header messages */ @@ -1569,7 +1554,7 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1606,11 +1591,11 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, htri_t attr_sharable; /* Flag indicating attributes are sharable */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1618,37 +1603,36 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.idx_type = idx_type; udata.other_bt2_addr = idx_type == H5_INDEX_NAME ? ainfo->corder_bt2_addr : ainfo->name_bt2_addr; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5A__dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5A__dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "unable to remove attribute from v2 B-tree index") } /* end if */ else { /* Build the table of attributes for this object */ /* (build table using the name index, but sort according to idx_type) */ - if(H5A_dense_build_table(f, dxpl_id, ainfo, idx_type, order, &atable) < 0) + if(H5A__dense_build_table(f, ainfo, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "error building table of attributes") /* Check for skipping too many attributes */ @@ -1656,27 +1640,27 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Delete appropriate attribute from dense storage */ - if(H5A_dense_remove(f, dxpl_id, ainfo, ((atable.attrs[n])->shared)->name) < 0) + if(H5A__dense_remove(f, ainfo, ((atable.attrs[n])->shared)->name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end else */ done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_remove_by_idx() */ +} /* end H5A__dense_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_exists + * Function: H5A__dense_exists * * Purpose: Check if an attribute exists in dense storage structures for * an object @@ -1690,7 +1674,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *name) +H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) { H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1699,7 +1683,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1709,11 +1693,11 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * HDassert(name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Check if attributes are shared in this file */ - if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID, dxpl_id)) < 0) + if((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't determine if attributes are shared") /* Get handle for shared message heap, if attributes are sharable */ @@ -1721,24 +1705,23 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * haddr_t shared_fheap_addr; /* Address of fractal heap to use */ /* Retrieve the address of the shared message's fractal heap */ - if(H5SM_get_fheap_addr(f, dxpl_id, H5O_ATTR_ID, &shared_fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, H5O_ATTR_ID, &shared_fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get shared message heap address") /* Check if there are any shared messages currently */ if(H5F_addr_defined(shared_fheap_addr)) { /* Open the fractal heap for shared header messages */ - if(NULL == (shared_fheap = H5HF_open(f, dxpl_id, shared_fheap_addr))) + if(NULL == (shared_fheap = H5HF_open(f, shared_fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") } /* end if */ } /* end if */ /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the "udata" information for v2 B-tree record 'find' */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = shared_fheap; udata.name = name; @@ -1749,20 +1732,20 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * udata.found_op_data = NULL; /* Find the attribute in the 'name' index */ - if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") done: /* Release resources */ - if(shared_fheap && H5HF_close(shared_fheap, dxpl_id) < 0) + if(shared_fheap && H5HF_close(shared_fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_exists() */ +} /* end H5A__dense_exists() */ /*------------------------------------------------------------------------- @@ -1796,7 +1779,7 @@ H5A__dense_delete_bt2_cb(const void *_record, void *_bt2_udata) H5SM_reconstitute(&sh_mesg, bt2_udata->f, H5O_ATTR_ID, record->id); /* Decrement the reference count on the shared attribute message */ - if(H5SM_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, &sh_mesg) < 0) + if(H5SM_delete(bt2_udata->f, NULL, &sh_mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute") } /* end if */ else { @@ -1805,33 +1788,32 @@ H5A__dense_delete_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.record = record; /* up */ fh_udata.attr = NULL; /* Call fractal heap 'op' routine, to copy the attribute information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, FAIL, "heap op callback failed") attr = fh_udata.attr; /* Perform the deletion action on the attribute */ /* (takes care of shared/committed datatype & dataspace components) */ - if(H5O_attr_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.attr) < 0) + if(H5O__attr_delete(bt2_udata->f, NULL, fh_udata.attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") } /* end else */ done: /* Release resources */ if(attr) - H5O_msg_free_real(H5O_MSG_ATTR, attr); + H5O__msg_free_real(H5O_MSG_ATTR, attr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5A__dense_delete_bt2_cb() */ /*------------------------------------------------------------------------- - * Function: H5A_dense_delete + * Function: H5A__dense_delete * * Purpose: Delete all dense storage structures for attributes on an object * @@ -1844,13 +1826,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) +H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo) { H5A_bt2_ud_common_t udata; /* v2 B-tree user data for deleting attributes */ H5HF_t *fheap = NULL; /* Fractal heap handle */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1859,12 +1841,11 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) HDassert(ainfo); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Create the "udata" information for v2 B-tree 'delete' */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.shared_fheap = NULL; udata.name = NULL; @@ -1874,33 +1855,33 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) udata.found_op_data = NULL; /* Delete name index v2 B-tree */ - if(H5B2_delete(f, dxpl_id, ainfo->name_bt2_addr, NULL, H5A__dense_delete_bt2_cb, &udata) < 0) + if(H5B2_delete(f, ainfo->name_bt2_addr, NULL, H5A__dense_delete_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") ainfo->name_bt2_addr = HADDR_UNDEF; /* Release resources */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") fheap = NULL; /* Check if we should delete the creation order index v2 B-tree */ if(H5F_addr_defined(ainfo->corder_bt2_addr)) { /* Delete the creation order index, without adjusting the ref. count on the attributes */ - if(H5B2_delete(f, dxpl_id, ainfo->corder_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, ainfo->corder_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for creation order index") ainfo->corder_bt2_addr = HADDR_UNDEF; } /* end if */ /* Delete fractal heap */ - if(H5HF_delete(f, dxpl_id, ainfo->fheap_addr) < 0) + if(H5HF_delete(f, ainfo->fheap_addr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") ainfo->fheap_addr = HADDR_UNDEF; done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close fractal heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_delete() */ +} /* end H5A__dense_delete() */ diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 9221254..1e031f7 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -38,6 +38,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -87,12 +88,12 @@ PURPOSE Creates an attribute on an object USAGE - hid_t H5Acreate1(loc_id, name, type_id, space_id, plist_id) + hid_t H5Acreate1(loc_id, name, type_id, space_id, acpl_id) hid_t loc_id; IN: Object (dataset or group) to be attached to const char *name; IN: Name of attribute to create hid_t type_id; IN: ID of datatype for attribute hid_t space_id; IN: ID of dataspace for attribute - hid_t plist_id; IN: ID of creation property list (currently not used) + hid_t acpl_id; IN: ID of creation property list (currently not used) RETURNS Non-negative on success/Negative on failure @@ -110,16 +111,17 @@ --------------------------------------------------------------------------*/ hid_t H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, - hid_t plist_id) + hid_t acpl_id) { - H5A_t *attr = NULL; /* Attribute created */ - H5G_loc_t loc; /* Object location */ - H5T_t *type; /* Datatype to use for attribute */ - H5S_t *space; /* Dataspace to use for attribute */ - hid_t ret_value; /* Return value */ + H5A_t *attr = NULL; /* Attribute created */ + H5G_loc_t loc; /* Object location */ + H5T_t *type; /* Datatype to use for attribute */ + H5S_t *space; /* Dataspace to use for attribute */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, plist_id); + H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, acpl_id); /* check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) @@ -135,8 +137,16 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set collective metadata read") + /* Go do the real work for attaching the attribute to the dataset */ - if(NULL==(attr = H5A_create(&loc, name, type, space, plist_id, H5AC_ind_read_dxpl_id))) + if(NULL == (attr = H5A__create(&loc, name, type, space, acpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute") /* Register the new attribute and get an ID for it */ @@ -144,6 +154,12 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID") done: + /* Cleanup on failure */ + if(ret_value < 0 && attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* H5Acreate1() */ @@ -173,9 +189,10 @@ done: hid_t H5Aopen_name(hid_t loc_id, const char *name) { - H5G_loc_t loc; /* Object location */ - H5A_t *attr = NULL; /* Attribute opened */ - hid_t ret_value; + H5G_loc_t loc; /* Object location */ + H5A_t *attr = NULL; /* Attribute opened */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -188,8 +205,13 @@ H5Aopen_name(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the attribute on the object header */ - if(NULL == (attr = H5A_open_by_name(&loc, ".", name, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (attr = H5A__open_by_name(&loc, ".", name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) /* Register the attribute and get an ID for it */ @@ -199,8 +221,10 @@ H5Aopen_name(hid_t loc_id, const char *name) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -233,6 +257,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) { H5G_loc_t loc; /* Object location */ H5A_t *attr = NULL; /* Attribute opened */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -244,9 +269,14 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the attribute in the object header */ - if(NULL == (attr = H5A_open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open attribute") + if(NULL == (attr = H5A__open_by_idx(&loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)idx))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute") /* Register the attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) @@ -255,8 +285,10 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) done: /* Cleanup on failure */ if(ret_value < 0) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -283,9 +315,10 @@ done: int H5Aget_num_attrs(hid_t loc_id) { - H5O_loc_t *loc; /* Object location for attribute */ - void *obj; - int ret_value; + H5O_loc_t *loc; /* Object location for attribute */ + void *obj; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + int ret_value; FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", loc_id); @@ -330,11 +363,18 @@ H5Aget_num_attrs(hid_t loc_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "inappropriate attribute target") } /*lint !e788 All appropriate cases are covered */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Look up the # of attributes for the object */ - if((ret_value = H5O_attr_count(loc, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5A__get_num_attrs(loc)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aget_num_attrs() */ @@ -379,10 +419,8 @@ done: herr_t H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) { - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - hsize_t start_idx; /* Index of attribute to start iterating at */ - hsize_t last_attr; /* Index of last attribute examined */ - herr_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data); @@ -391,20 +429,18 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - /* Build attribute operator info */ - attr_op.op_type = H5A_ATTR_OP_APP; - attr_op.u.app_op = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call attribute iteration routine */ - last_attr = start_idx = (hsize_t)(attr_num ? *attr_num : 0); - if((ret_value = H5O_attr_iterate(loc_id, H5AC_ind_read_dxpl_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, start_idx, &last_attr, &attr_op, op_data)) < 0) + if((ret_value = H5A__iterate_old(loc_id, attr_num, op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); - /* Set the last attribute information */ - if(attr_num) - *attr_num = (unsigned)last_attr; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Aiterate1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Aint.c b/src/H5Aint.c index f1dd41e..a02dcc9 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -35,6 +35,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -55,7 +56,6 @@ /* Data exchange structure to use when building table of compact attributes for an object */ typedef struct { H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5A_attr_table_t *atable; /* Pointer to attribute table to build */ size_t curr_attr; /* Current attribute to operate on */ hbool_t bogus_crt_idx; /* Whether bogus creation index values need to be set */ @@ -73,7 +73,6 @@ typedef struct { H5F_t *file; /* file */ hbool_t *recompute_size; /* Flag to indicate if size changed */ H5O_copy_t *cpy_info; /* Information on copying options */ - hid_t dxpl_id; /* DXPL for operation */ const H5O_loc_t *oloc_src; H5O_loc_t *oloc_dst; } H5A_dense_file_cp_ud_t; @@ -88,6 +87,9 @@ typedef struct { /* Local Prototypes */ /********************/ +static H5A_t *H5A__create_common(const H5G_loc_t *loc, const char *name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id); +static herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr); static herr_t H5A__compact_build_table_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/); static herr_t H5A__dense_build_table_cb(const H5A_t *attr, void *_udata); @@ -97,6 +99,8 @@ static int H5A__attr_cmp_corder_inc(const void *attr1, const void *attr2); static int H5A__attr_cmp_corder_dec(const void *attr1, const void *attr2); static herr_t H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_order_t order); +static herr_t H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, + H5_iter_order_t order, hsize_t *idx, H5A_attr_iter_op_t *attr_op, void *op_data); /*********************/ /* Package Variables */ @@ -117,28 +121,20 @@ H5FL_SEQ_DEFINE(H5A_t_ptr); /*------------------------------------------------------------------------- - * Function: H5A_create + * Function: H5A__create_common * - * Purpose: - * This is the guts of creating an attribute. - * Usage: - * hid_t H5A_create(ent, name, type, space) - * const H5G_entry_t *ent; IN: Pointer to symbol table entry for object to attribute - * const char *name; IN: Name of attribute - * H5T_t *type; IN: Datatype of attribute - * H5S_t *space; IN: Dataspace of attribute - * hid_t acpl_id IN: Attribute creation property list + * Purpose: This is the guts of creating an attribute. * - * Return: attribute structure on success, NULL on Failure. + * Return: Attribute structure on success, NULL on Failure. * * Programmer: Quincey Koziol * April 2, 1998 * *------------------------------------------------------------------------- */ -H5A_t * -H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, - const H5S_t *space, hid_t acpl_id, hid_t dxpl_id) +static H5A_t * +H5A__create_common(const H5G_loc_t *loc, const char *name, const H5T_t *type, + const H5S_t *space, hid_t acpl_id) { H5A_t *attr = NULL; /* Attribute created */ hssize_t snelmts; /* elements in attribute */ @@ -146,9 +142,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, htri_t exists; /* Whether attribute exists */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->oloc->addr, NULL) + FUNC_ENTER_STATIC_TAG(loc->oloc->addr) - /* check args */ + /* Check args */ HDassert(loc); HDassert(name); HDassert(type); @@ -159,7 +155,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, * name, but it's going to be hard to unwind all the special cases on * failure, so just check first, for now - QAK) */ - if((exists = H5O_attr_exists(loc->oloc, name, dxpl_id)) < 0) + if((exists = H5O__attr_exists(loc->oloc, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "error checking attributes") else if(exists > 0) HGOTO_ERROR(H5E_ATTR, H5E_ALREADYEXISTS, NULL, "attribute already exists") @@ -233,20 +229,19 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Check if any of the pieces should be (or are already) shared in the * SOHM table */ - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, NULL, 0, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL, "trying to share datatype failed") - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, NULL, 0, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, NULL, "trying to share dataspace failed") /* Check whether datatype is committed & increment ref count * (to maintain ref. count incr/decr similarity with "shared message" * type of datatype sharing) */ - if(H5T_committed(attr->shared->dt)) { + if(H5T_committed(attr->shared->dt)) /* Increment the reference count on the shared datatype */ - if(H5T_link(attr->shared->dt, 1, dxpl_id) < 0) + if(H5T_link(attr->shared->dt, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, NULL, "unable to adjust shared datatype link count") - } /* end if */ /* Compute the size of pieces on disk. This is either the size of the * datatype and dataspace messages themselves, or the size of the "shared" @@ -270,19 +265,123 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, attr->obj_opened = TRUE; /* Set the version to encode the attribute with */ - if(H5A_set_version(attr->oloc.file, attr) < 0) + if(H5A__set_version(attr->oloc.file, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") /* Insert the attribute into the object header */ - if(H5O_attr_create(&(attr->oloc), dxpl_id, attr) < 0) + if(H5O__attr_create(&(attr->oloc), attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, NULL, "unable to create attribute in object header") + /* Set return value */ ret_value = attr; + done: - if(NULL == ret_value && attr && H5A_close(attr)) + /* Cleanup on failure */ + if(NULL == ret_value && attr && H5A__close(attr)) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* H5A_create() */ + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* H5A__create_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__create + * + * Purpose: Entry point for creating attribute on an object + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Attribute structure on success, NULL on Failure. + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__create(const H5G_loc_t *loc, const char *name, const H5T_t *type, + const H5S_t *space, hid_t acpl_id) +{ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(loc); + HDassert(name); + HDassert(type); + HDassert(space); + + /* Go do the real work for attaching the attribute to the object */ + if(NULL == (ret_value = H5A__create_common(loc, name, type, space, acpl_id))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCREATE, NULL, "unable to create attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__create() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__create_by_name + * + * Purpose: Create an attribute on object, according to it's name + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + H5A_t *attr = NULL; /* Attribute from object header */ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* check args */ + HDassert(loc); + HDassert(obj_name); + HDassert(attr_name); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") + loc_found = TRUE; + + /* Go do the real work for attaching the attribute to the object */ + if(NULL == (attr = H5A__create_common(&obj_loc, attr_name, type, space, acpl_id))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to create attribute") + + /* Set return value */ + ret_value = attr; + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't free location") + + /* Cleanup on failure */ + if(ret_value == NULL) + if(attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__create_by_name() */ /*------------------------------------------------------------------------- @@ -292,7 +391,7 @@ done: * Finishes initializing an attributes the open * * Usage: - * herr_t H5A__open_common(loc, name, dxpl_id) + * herr_t H5A__open_common(loc, name) * const H5G_loc_t *loc; IN: Pointer to group location for object * H5A_t *attr; IN/OUT: Pointer to attribute to initialize * @@ -303,12 +402,12 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_STATIC /* check args */ HDassert(loc); @@ -343,7 +442,56 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_open_by_idx + * Function: H5A__open + * + * Purpose: Open an attribute in an object header + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * December 9, 2017 + * + *------------------------------------------------------------------------- + */ +H5A_t * +H5A__open(const H5G_loc_t *loc, const char *attr_name) +{ + H5A_t *attr = NULL; /* Attribute from object header */ + H5A_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* check args */ + HDassert(loc); + HDassert(attr_name); + + /* Read in attribute from object header */ + if(NULL == (attr = H5O__attr_open_by_name(loc->oloc, attr_name))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header for attribute: '%s'", attr_name) + + /* Finish initializing attribute */ + if(H5A__open_common(loc, attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to initialize attribute") + + /* Set return value */ + ret_value = attr; + +done: + /* Cleanup on failure */ + if(ret_value == NULL) + if(attr && H5A__close(attr) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__open_by_idx * * Purpose: Open an attribute according to its index order * @@ -355,8 +503,8 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id) +H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -365,7 +513,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* check args */ HDassert(loc); @@ -377,12 +525,12 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") loc_found = TRUE; /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_idx(obj_loc.oloc, idx_type, order, n, dxpl_id))) + if(NULL == (attr = H5O__attr_open_by_idx(obj_loc.oloc, idx_type, order, n))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ @@ -399,15 +547,15 @@ done: /* Cleanup on failure */ if(ret_value == NULL) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_open_by_idx() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5A_open_by_name + * Function: H5A__open_by_name * * Purpose: Open an attribute in an object header, according to it's name * @@ -419,8 +567,7 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id) +H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -429,7 +576,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE_VOL /* check args */ HDassert(loc); @@ -442,12 +589,12 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "object not found") loc_found = TRUE; /* Read in attribute from object header */ - if(NULL == (attr = H5O_attr_open_by_name(obj_loc.oloc, attr_name, dxpl_id))) + if(NULL == (attr = H5O__attr_open_by_name(obj_loc.oloc, attr_name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to load attribute info from object header") /* Finish initializing attribute */ @@ -464,11 +611,11 @@ done: /* Cleanup on failure */ if(ret_value == NULL) - if(attr && H5A_close(attr) < 0) + if(attr && H5A__close(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_open_by_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__open_by_name() */ /*-------------------------------------------------------------------------- @@ -488,7 +635,7 @@ done: This function reads a complete attribute from disk. --------------------------------------------------------------------------*/ herr_t -H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) +H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) { uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ uint8_t *bkg_buf = NULL; /* background buffer */ @@ -501,7 +648,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL_TAG(attr->oloc.addr) HDassert(attr); HDassert(mem_type); @@ -523,7 +670,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) else { /* Attribute exists and has a value */ /* Convert memory buffer into disk buffer */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(attr->shared->dt, mem_type))) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") /* Check for type conversion required */ @@ -543,7 +690,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) HDmemcpy(tconv_buf, attr->shared->data, (src_type_size * nelmts)); /* Perform datatype conversion. */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") /* Copy the converted data into the user's buffer */ @@ -570,7 +717,7 @@ done: if(bkg_buf) bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5A__read() */ @@ -591,7 +738,7 @@ done: This function writes a complete attribute to disk. --------------------------------------------------------------------------*/ herr_t -H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) +H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) { uint8_t *tconv_buf = NULL; /* datatype conv buffer */ hbool_t tconv_owned = FALSE; /* Whether the datatype conv buffer is owned by attribute */ @@ -605,7 +752,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(attr->oloc.addr) HDassert(attr); HDassert(mem_type); @@ -624,7 +771,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) /* Convert memory buffer into disk buffer */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(mem_type, attr->shared->dt))) HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes") /* Check for type conversion required */ @@ -644,7 +791,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HDmemcpy(tconv_buf, buf, (src_type_size * nelmts)); /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed") /* Free the previous attribute data buffer, if there is one */ @@ -669,7 +816,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) } /* end else */ /* Modify the attribute in the object header */ - if(H5O_attr_write(&(attr->oloc), dxpl_id, attr) < 0) + if(H5O__attr_write(&(attr->oloc), attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to modify attribute") } /* end if */ @@ -684,7 +831,7 @@ done: if(bkg_buf) bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5A__write() */ @@ -710,7 +857,7 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) size_t copy_len, nbytes; ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* get the real attribute length */ nbytes = HDstrlen(attr->shared->name); @@ -772,7 +919,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_get_type + * Function: H5A__get_type * * Purpose: Returns an ID for the datatype of an attribute * @@ -783,12 +930,12 @@ done: *------------------------------------------------------------------------- */ hid_t -H5A_get_type(H5A_t *attr) +H5A__get_type(H5A_t *attr) { H5T_t *dt = NULL; hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(attr); @@ -816,16 +963,16 @@ H5A_get_type(H5A_t *attr) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if (H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) + if(H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_get_type() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5A__get_type() */ /*-------------------------------------------------------------------------- NAME - H5A_get_create_plist + H5A__get_create_plist PURPOSE private version of H5Aget_create_plist RETURNS @@ -840,14 +987,14 @@ done: resource leaks will occur. --------------------------------------------------------------------------*/ hid_t -H5A_get_create_plist(H5A_t* attr) +H5A__get_create_plist(H5A_t* attr) { H5P_genplist_t *plist; /* Default property list */ hid_t new_plist_id; /* ID of ACPL to return */ H5P_genplist_t *new_plist; /* ACPL to return */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE if(NULL == (plist = (H5P_genplist_t *)H5I_object(H5P_LST_ATTRIBUTE_CREATE_ID_g))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "can't get default ACPL") @@ -866,7 +1013,7 @@ H5A_get_create_plist(H5A_t* attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Aget_create_plist() */ +} /* end H5A__get_create_plist() */ /*------------------------------------------------------------------------- @@ -911,7 +1058,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_copy + * Function: H5A__copy * * Purpose: Copies attribute OLD_ATTR. * @@ -929,13 +1076,13 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr) +H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) { H5A_t *new_attr = NULL; hbool_t allocated_attr = FALSE; /* Whether the attribute was allocated */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(old_attr); @@ -970,15 +1117,15 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr) done: if(ret_value == NULL) - if(allocated_attr && new_attr && H5A_close(new_attr) < 0) + if(allocated_attr && new_attr && H5A__close(new_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_copy() */ +} /* end H5A__copy() */ /*------------------------------------------------------------------------- - * Function: H5A_free + * Function: H5A__free * * Purpose: Frees all memory associated with an attribute, but does not * free the H5A_t structure (which should be done in H5T_close). @@ -993,11 +1140,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_free(H5A_t *attr) +H5A__free(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(attr); @@ -1007,7 +1154,7 @@ H5A_free(H5A_t *attr) attr->shared->name = NULL; } if(attr->shared->dt) { - if(H5T_close(attr->shared->dt) < 0) + if(H5T_close_real(attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release datatype info") attr->shared->dt = NULL; } @@ -1021,11 +1168,43 @@ H5A_free(H5A_t *attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_free() */ +} /* end H5A__free() */ /*------------------------------------------------------------------------- - * Function: H5A_close + * Function: H5A__close_cb + * + * Purpose: Frees an attribute and all associated memory. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 1997 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__close_cb(H5A_t *attr) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(attr); + HDassert(attr->shared); + + /* Call the actual close routine */ + if(H5A__close(attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "problem closing attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5A__close_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__close * * Purpose: Frees an attribute and all associated memory. * @@ -1034,18 +1213,14 @@ done: * Programmer: Robb Matzke * Monday, December 8, 1997 * - * Modifications: - * Raymond Lu - * 4 June 2008 - * Changed some attribute object information to be shared. *------------------------------------------------------------------------- */ herr_t -H5A_close(H5A_t *attr) +H5A__close(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(attr); HDassert(attr->shared); @@ -1054,10 +1229,10 @@ H5A_close(H5A_t *attr) if(attr->obj_opened && (H5O_close(&(attr->oloc), NULL) < 0)) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") - /* Reference count can be 0. It only happens when H5A_create fails. */ + /* Reference count can be 0. It only happens when H5A__create fails. */ if(attr->shared->nrefs <= 1) { /* Free dynamicly allocated items */ - if(H5A_free(attr) < 0) + if(H5A__free(attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release attribute info") /* Destroy shared attribute struct */ @@ -1078,7 +1253,7 @@ H5A_close(H5A_t *attr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_close() */ +} /* end H5A__close() */ /*------------------------------------------------------------------------- @@ -1176,7 +1351,40 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_exists_by_name + * Function: H5A__exists + * + * Purpose: Private version of H5Aexists + * + * Note: This routine is needed so that there's a non-API routine for + * detecting attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: TRUE/FALSE + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +htri_t +H5A__exists(const H5G_loc_t *loc, const char *name) +{ + htri_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check if the attribute exists */ + if((ret_value = H5O__attr_exists(loc->oloc, name)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__exists() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__exists_by_name * * Purpose: Private version of H5Aexists_by_name * @@ -1189,8 +1397,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id) +H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -1198,7 +1405,7 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -1206,12 +1413,12 @@ H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; /* Check if the attribute exists */ - if((ret_value = H5O_attr_exists(obj_loc.oloc, attr_name, dxpl_id)) < 0) + if((ret_value = H5O__attr_exists(obj_loc.oloc, attr_name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: @@ -1219,8 +1426,8 @@ done: if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") - FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_exists_by_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__exists_by_name() */ /*------------------------------------------------------------------------- @@ -1269,7 +1476,7 @@ H5A__compact_build_table_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/ } /* end if */ /* Copy attribute into table */ - if(NULL == (udata->atable->attrs[udata->curr_attr] = H5A_copy(NULL, (const H5A_t *)mesg->native))) + if(NULL == (udata->atable->attrs[udata->curr_attr] = H5A__copy(NULL, (const H5A_t *)mesg->native))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Assign [somewhat arbitrary] creation order value, if requested */ @@ -1285,7 +1492,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_compact_build_table + * Function: H5A__compact_build_table * * Purpose: Builds a table containing a sorted list of attributes for * an object @@ -1302,14 +1509,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, +H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable) { H5A_compact_bt_ud_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -1322,7 +1529,6 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, /* Set up user data for iteration */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.atable = atable; udata.curr_attr = 0; udata.bogus_crt_idx = (hbool_t)((oh->version == H5O_VERSION_1 || @@ -1331,7 +1537,7 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5A__compact_build_table_cb; - if(H5O_msg_iterate_real(f, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(f, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error building attribute table") /* Correct # of attributes in table */ @@ -1346,7 +1552,7 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_compact_build_table() */ +} /* end H5A__compact_build_table() */ /*------------------------------------------------------------------------- @@ -1382,7 +1588,7 @@ H5A__dense_build_table_cb(const H5A_t *attr, void *_udata) HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, H5_ITER_ERROR, "can't allocate attribute") /* Copy attribute information. Share the attribute object in copying. */ - if(NULL == H5A_copy(udata->atable->attrs[udata->curr_attr], attr)) + if(NULL == H5A__copy(udata->atable->attrs[udata->curr_attr], attr)) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Increment number of attributes stored */ @@ -1394,7 +1600,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_build_table + * Function: H5A__dense_build_table * * Purpose: Builds a table containing a sorted list of attributes for * an object @@ -1412,14 +1618,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5A__dense_build_table(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ hsize_t nrec; /* # of records in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -1429,7 +1635,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, HDassert(atable); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -1459,8 +1665,8 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, attr_op.u.lib_op = H5A__dense_build_table_cb; /* Iterate over the links in the group, building a table of the link messages */ - if(H5A_dense_iterate(f, dxpl_id, (hid_t)0, ainfo, H5_INDEX_NAME, - H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) + if(H5A__dense_iterate(f, (hid_t)0, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, + (hsize_t)0, NULL, &attr_op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Sort attribute table in correct iteration order */ @@ -1472,11 +1678,11 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_build_table() */ +} /* end H5A__dense_build_table() */ /*------------------------------------------------------------------------- @@ -1651,7 +1857,7 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, /*------------------------------------------------------------------------- - * Function: H5A_attr_iterate_table + * Function: H5A__attr_iterate_table * * Purpose: Iterate over table containing a list of attributes for an object, * making appropriate callbacks @@ -1665,14 +1871,14 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, *------------------------------------------------------------------------- */ herr_t -H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, +H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *last_attr, hid_t loc_id, const H5A_attr_iter_op_t *attr_op, void *op_data) { size_t u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(atable); @@ -1730,11 +1936,11 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_attr_iterate_table() */ +} /* end H5A__attr_iterate_table() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_release_table + * Function: H5A__attr_release_table * * Purpose: Release table containing a list of attributes for an object * @@ -1747,11 +1953,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_attr_release_table(H5A_attr_table_t *atable) +H5A__attr_release_table(H5A_attr_table_t *atable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(atable); @@ -1762,7 +1968,7 @@ H5A_attr_release_table(H5A_attr_table_t *atable) /* Free attribute message information */ for(u = 0; u < atable->nattrs; u++) - if(atable->attrs[u] && H5A_close(atable->attrs[u]) < 0) + if(atable->attrs[u] && H5A__close(atable->attrs[u]) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute") } /* end if */ else @@ -1772,11 +1978,11 @@ H5A_attr_release_table(H5A_attr_table_t *atable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_attr_release_table() */ +} /* end H5A__attr_release_table() */ /*------------------------------------------------------------------------- - * Function: H5A_get_ainfo + * Function: H5A__get_ainfo * * Purpose: Retrieves the "attribute info" message for an object. Also * sets the number of attributes correctly, if it isn't set up yet. @@ -1791,12 +1997,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) +H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check arguments */ HDassert(f); @@ -1808,7 +2014,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "unable to check object header") if(ret_value > 0) { /* Retrieve the "attribute info" structure */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_AINFO_ID, ainfo)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_AINFO_ID, ainfo)) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't read AINFO message") /* Check if we don't know how many attributes there are */ @@ -1816,7 +2022,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) /* Check if we are using "dense" attribute storage */ if(H5F_addr_defined(ainfo->fheap_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -1832,15 +2038,15 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5A_get_ainfo() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5A__get_ainfo() */ /*------------------------------------------------------------------------- - * Function: H5A_set_version + * Function: H5A__set_version * * Purpose: Sets the correct version to encode attribute with. * Chooses the oldest version possible, unless the "use the @@ -1856,13 +2062,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_set_version(const H5F_t *f, H5A_t *attr) +H5A__set_version(const H5F_t *f, H5A_t *attr) { hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the latest attribute version support is enabled */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE_NOERR /* check arguments */ HDassert(f); @@ -1892,13 +2097,12 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) else attr->shared->version = H5O_ATTR_VERSION_1; /* Write out basic version */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_set_version() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5A__set_version() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_copy_file + * Function: H5A__attr_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -1918,8 +2122,8 @@ done: *------------------------------------------------------------------------- */ H5A_t * -H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, hid_t dxpl_id) +H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, + H5O_copy_t *cpy_info) { H5A_t *attr_dst = NULL; /* Destination attribute */ hid_t tid_src = -1; /* Datatype ID for source datatype */ @@ -1934,7 +2138,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si size_t dst_dt_size; /* Size of destination attribute datatype */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(attr_src); @@ -1999,9 +2203,9 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si * final size of the messages. This does nothing if the datatype is * committed or sharing is disabled. */ - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute datatype") - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute dataspace") /* Compute the sizes of the datatype and dataspace. This is their raw @@ -2061,9 +2265,9 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination file datatype") /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(attr_src->shared->dt, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(attr_src->shared->dt, dt_mem))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, attr_dst->shared->dt, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, attr_dst->shared->dt))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -2112,7 +2316,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Convert from source file to memory */ - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed") HDmemcpy(reclaim_buf, buf, buf_size); @@ -2122,12 +2326,12 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HDmemset(bkg_buf, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed") HDmemcpy(attr_dst->shared->data, buf, attr_dst->shared->data_size); - if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, NULL, "unable to reclaim variable-length data") } /* end if */ else { @@ -2140,7 +2344,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si attr_dst->shared->crt_idx = attr_src->shared->crt_idx; /* Recompute the version to encode the destination attribute */ - if(H5A_set_version(file_dst, attr_dst) < 0) + if(H5A__set_version(file_dst, attr_dst) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") /* Recompute the destination attribute's size, if it's a different version */ @@ -2173,15 +2377,15 @@ done: bkg_buf = H5FL_BLK_FREE(attr_buf, bkg_buf); /* Release destination attribute information on failure */ - if(!ret_value && attr_dst && H5A_close(attr_dst) < 0) + if(!ret_value && attr_dst && H5A__close(attr_dst) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_attr_copy_file() */ +} /* H5A__attr_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5A_attr_post_copy_file + * Function: H5A__attr_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -2197,13 +2401,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, - H5O_loc_t *dst_oloc, const H5A_t *attr_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, + H5O_loc_t *dst_oloc, const H5A_t *attr_dst, H5O_copy_t *cpy_info) { H5F_t *file_src, *file_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(src_oloc); @@ -2232,7 +2436,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, dst_oloc_dt->file = file_dst; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, dxpl_id, cpy_info, FALSE, NULL, NULL) < 0) + if(H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, cpy_info, FALSE, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Update shared message info from named datatype info */ @@ -2242,9 +2446,9 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, /* Try to share both the datatype and dataset. This does nothing if the * datatype is committed or sharing is disabled. */ - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_WAS_DEFERRED, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute datatype") - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_WAS_DEFERRED, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute dataspace") /* Only need to fix reference attribute with real data being copied to @@ -2264,8 +2468,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, ref_count = attr_dst->shared->data_size / H5T_get_size(attr_dst->shared->dt); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(file_src, attr_dst->shared->data, dxpl_id, - file_dst, attr_dst->shared->data, ref_count, H5T_get_ref_type(attr_dst->shared->dt), cpy_info) < 0) + if(H5O_copy_expand_ref(file_src, attr_dst->shared->data, file_dst, attr_dst->shared->data, ref_count, H5T_get_ref_type(attr_dst->shared->dt), cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ else @@ -2275,7 +2478,7 @@ H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_attr_post_copy_file() */ +} /* H5A__attr_post_copy_file() */ /*------------------------------------------------------------------------- @@ -2308,12 +2511,10 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) HDassert(udata->file); HDassert(udata->cpy_info); - if(NULL == (attr_dst = H5A_attr_copy_file(attr_src, udata->file, - udata->recompute_size, udata->cpy_info, udata->dxpl_id))) + if(NULL == (attr_dst = H5A__attr_copy_file(attr_src, udata->file, udata->recompute_size, udata->cpy_info))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") - if(H5A_attr_post_copy_file(udata->oloc_src, attr_src, udata->oloc_dst, attr_dst, - udata->dxpl_id, udata->cpy_info) < 0) + if(H5A__attr_post_copy_file(udata->oloc_src, attr_src, udata->oloc_dst, attr_dst, udata->cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") /* Reset shared location information */ @@ -2321,17 +2522,17 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to reset attribute sharing") /* Set COPIED tag for destination object's metadata */ - H5_BEGIN_TAG(udata->dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert attribute into dense storage */ - if(H5A_dense_insert(udata->file, udata->dxpl_id, udata->ainfo, attr_dst) < 0) + if(H5A__dense_insert(udata->file, udata->ainfo, attr_dst) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") /* Reset metadata tag */ - H5_END_TAG(H5_ITER_ERROR); + H5_END_TAG done: - if(attr_dst && H5A_close(attr_dst) < 0) + if(attr_dst && H5A__close(attr_dst) < 0) HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute") FUNC_LEAVE_NOAPI(ret_value) @@ -2339,7 +2540,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_post_copy_file_all + * Function: H5A__dense_post_copy_file_all * * Purpose: Copy all dense attributes from SRC to DST. * @@ -2353,15 +2554,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo_src, - H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo_src, + H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, H5O_copy_t *cpy_info) { H5A_dense_file_cp_ud_t udata; /* User data for iteration callback */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ hbool_t recompute_size = FALSE; /* recompute the size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(ainfo_src); @@ -2371,24 +2572,56 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo udata.file = dst_oloc->file; /* Destination file */ udata.recompute_size = &recompute_size; /* Flag to indicate if size changed */ udata.cpy_info = cpy_info; /* Information on copying options */ - udata.dxpl_id = dxpl_id; /* DXPL for operation */ udata.oloc_src = src_oloc; udata.oloc_dst = dst_oloc; attr_op.op_type = H5A_ATTR_OP_LIB; attr_op.u.lib_op = H5A__dense_post_copy_file_cb; - if(H5A_dense_iterate(src_oloc->file, dxpl_id, (hid_t)0, ainfo_src, H5_INDEX_NAME, + if(H5A__dense_iterate(src_oloc->file, (hid_t)0, ainfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_post_copy_file_all */ +} /* end H5A__dense_post_copy_file_all */ + + +/*------------------------------------------------------------------------- + * Function: H5A__rename + * + * Purpose: Private version of H5Arename + * + * Note: This routine is needed so that there's a non-API routine for + * renaming attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__rename(const H5G_loc_t *loc, const char *old_name, const char *new_name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Call object header attribute rename routine */ + if(H5O__attr_rename(loc->oloc, old_name, new_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__rename() */ /*------------------------------------------------------------------------- - * Function: H5A_rename_by_name + * Function: H5A__rename_by_name * * Purpose: Private version of H5Arename_by_name * @@ -2401,8 +2634,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, - const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id) +H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, + const char *new_attr_name) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ @@ -2410,29 +2643,376 @@ H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_nam hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL - /* Avoid thrashing things if the names are the same */ - if(HDstrcmp(old_attr_name, new_attr_name)) { - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") - loc_found = TRUE; - - /* Call attribute rename routine */ - if(H5O_attr_rename(obj_loc.oloc, dxpl_id, old_attr_name, new_attr_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") - } /* end if */ + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Call attribute rename routine */ + if(H5O__attr_rename(obj_loc.oloc, old_attr_name, new_attr_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") done: /* Release resources */ if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__rename_by_name() */ + +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5A__get_num_attrs + * + * Purpose: Private version of deprecated H5Aget_num_attrs + * + * Note: This routine is needed so that there's a non-API routine for + * querying the attribute count that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +int +H5A__get_num_attrs(const H5O_loc_t *loc) +{ + int ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Look up the # of attributes for the object */ + if((ret_value = H5O__attr_count(loc)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, FAIL, "can't get attribute count for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__get_num_attrs() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_common + * + * Purpose: Internal common version of H5Aiterate + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5A__iterate_common(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_attr_iter_op_t *attr_op, void *op_data) +{ + hsize_t start_idx; /* Index of attribute to start iterating at */ + hsize_t last_attr; /* Index of last attribute examined */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_NOERR + + /* Call attribute iteration routine */ + last_attr = start_idx = (idx ? *idx : 0); + if((ret_value = H5O__attr_iterate(loc_id, idx_type, order, start_idx, &last_attr, attr_op, op_data)) < 0) + HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); + + /* Set the last attribute information */ + if(idx) + *idx = last_attr; + FUNC_LEAVE_NOAPI(ret_value) -} /* H5A_rename_by_name() */ +} /* H5A__iterate_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate + * + * Purpose: Private version of H5Aiterate2 + * + * Note: This routine is needed so that there's a non-API routine for + * iterating over attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_operator2_t op, void *op_data) +{ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP2; + attr_op.u.app_op2 = op; + + /* Call internal attribute iteration routine */ + if((ret_value = H5A__iterate_common(loc_id, idx_type, order, idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate() */ + +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_old + * + * Purpose: Private version of H5Aiterate1 + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate_old(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, + void *op_data) +{ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + hsize_t idx; /* Index of attribute to start iterating at */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP; + attr_op.u.app_op = op; + + /* Set up index */ + idx = (hsize_t)(attr_num ? *attr_num : 0); + + /* Call internal attribute iteration routine */ + if((ret_value = H5A__iterate_common(loc_id, H5_INDEX_CRT_ORDER, H5_ITER_INC, &idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + + /* Translate hsize_t index value to legacy unsigned index value*/ + if(attr_num) + *attr_num = (unsigned)idx; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate_old() */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + +/*------------------------------------------------------------------------- + * Function: H5A__iterate_by_name + * + * Purpose: Private version of H5Aiterate_by_name + * + * Note: This routine is needed so that there's a non-API routine for + * iterating over attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__iterate_by_name(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, + void *op_data) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + hid_t obj_loc_id = (-1); /* ID for object located */ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Open the object */ + if((obj_loc_id = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + + /* Build attribute operator info */ + attr_op.op_type = H5A_ATTR_OP_APP2; + attr_op.u.app_op2 = op; + + /* Call attribute iteration routine */ + if((ret_value = H5A__iterate_common(obj_loc_id, idx_type, order, idx, &attr_op, op_data)) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error iterating over attributes") + +done: + /* Release resources */ + if(obj_loc_id > 0) { + if(H5I_dec_app_ref(obj_loc_id) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object") + } /* end if */ + else if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__iterate_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete + * + * Purpose: Private version of H5Adelete + * + * Note: This routine is needed so that there's a non-API routine for + * deleting attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete(const H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Call object header attribute delete attribute routine */ + if(H5O__attr_remove(loc->oloc, name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete_by_name + * + * Purpose: Private version of H5Adelete_by_name + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_name) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Delete the attribute from the location */ + if(H5O__attr_remove(obj_loc.oloc, attr_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5A__delete_by_idx + * + * Purpose: Private version of H5Adelete_by_idx + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 6, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location */ + if(H5G_loc_find(loc, obj_name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Delete the attribute from the location */ + if(H5O__attr_remove_by_idx(obj_loc.oloc, idx_type, order, n) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") + +done: + /* Release resources */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5A__delete_by_idx() */ + diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 6d5a83a..3315cc1 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -129,7 +129,6 @@ typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, vo typedef struct H5A_bt2_ud_common_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */ const char *name; /* Name of attribute to compare */ @@ -182,93 +181,111 @@ H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1]; /******************************/ /* Function prototypes for H5A package scope */ -H5_DLL H5A_t *H5A_create(const H5G_loc_t *loc, const char *name, - const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id); -H5_DLL H5A_t *H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, - const char *attr_name, hid_t lapl_id, hid_t dxpl_id); -H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr); -H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr); +H5_DLL H5A_t *H5A__create(const H5G_loc_t *loc, const char *attr_name, + const H5T_t *type, const H5S_t *space, hid_t acpl_id); +H5_DLL H5A_t *H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name, const H5T_t *type, const H5S_t *space, + hid_t acpl_id); +H5_DLL H5A_t *H5A__open(const H5G_loc_t *loc, const char *attr_name); +H5_DLL H5A_t *H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name); +H5_DLL H5A_t *H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL H5A_t *H5A__copy(H5A_t *new_attr, const H5A_t *old_attr); +H5_DLL hid_t H5A__get_type(H5A_t *attr); H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo); -H5_DLL hid_t H5A_get_create_plist(H5A_t* attr); -H5_DLL herr_t H5A_free(H5A_t *attr); -H5_DLL herr_t H5A_close(H5A_t *attr); -H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo); -H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr); -H5_DLL herr_t H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, - const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, - hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id); -H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id); +H5_DLL hid_t H5A__get_create_plist(H5A_t* attr); +H5_DLL herr_t H5A__free(H5A_t *attr); +H5_DLL herr_t H5A__close(H5A_t *attr); +H5_DLL herr_t H5A__close_cb(H5A_t *attr); +H5_DLL htri_t H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo); +H5_DLL herr_t H5A__set_version(const H5F_t *f, H5A_t *attr); +H5_DLL herr_t H5A__rename(const H5G_loc_t *loc, const char *old_name, + const char *new_name); +H5_DLL herr_t H5A__rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name, + const char *new_attr_name); +#ifndef H5_NO_DEPRECATED_SYMBOLS +H5_DLL int H5A__get_num_attrs(const H5O_loc_t *loc); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5A__iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t *idx, H5A_operator2_t op, void *op_data); +H5_DLL herr_t H5A__iterate_by_name(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op, + void *op_data); +#ifndef H5_NO_DEPRECATED_SYMBOLS +H5_DLL herr_t H5A__iterate_old(hid_t loc_id, unsigned *attr_num, + H5A_operator1_t op, void *op_data); +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5A__delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5A__delete_by_name(const H5G_loc_t *loc, const char *obj_name, + const char *attr_name); +H5_DLL herr_t H5A__delete_by_idx(const H5G_loc_t *loc, const char *obj_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5A__exists(const H5G_loc_t *loc, const char *name); +H5_DLL htri_t H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name); +H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf); +H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf); H5_DLL ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf); /* Attribute "dense" storage routines */ -H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo); -H5_DLL H5A_t *H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - const char *name); -H5_DLL herr_t H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5A_t *attr); -H5_DLL herr_t H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, - H5A_t *attr); -H5_DLL herr_t H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5_DLL herr_t H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo); +H5_DLL H5A_t *H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name); +H5_DLL herr_t H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr); +H5_DLL herr_t H5A__dense_write(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr); +H5_DLL herr_t H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, const char *new_name); -H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, - void *op_data); -H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, const char *name); -H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n); -H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, +H5_DLL herr_t H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *attr_op, void *op_data); +H5_DLL herr_t H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name); -H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo); +H5_DLL herr_t H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, + const char *name); +H5_DLL herr_t H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo); /* Attribute table operations */ -H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +H5_DLL herr_t H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, + H5_iter_order_t order, H5A_attr_table_t *atable); +H5_DLL herr_t H5A__dense_build_table(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable); -H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, - const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order, - H5A_attr_table_t *atable); -H5_DLL herr_t H5A_attr_iterate_table(const H5A_attr_table_t *atable, +H5_DLL herr_t H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *last_attr, hid_t loc_id, const H5A_attr_iter_op_t *attr_op, void *op_data); -H5_DLL herr_t H5A_attr_release_table(H5A_attr_table_t *atable); +H5_DLL herr_t H5A__attr_release_table(H5A_attr_table_t *atable); /* Attribute operations */ -H5_DLL herr_t H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr); -H5_DLL H5A_t *H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, - hid_t dxpl_id); -H5_DLL H5A_t *H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id); -H5_DLL herr_t H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5A_t *attr, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, - H5A_t *attr); -H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, - const char *old_name, const char *new_name); -H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name, - hid_t dxpl_id); -H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id); -H5_DLL htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id); +H5_DLL herr_t H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr); +H5_DLL H5A_t *H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name); +H5_DLL H5A_t *H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n); +H5_DLL herr_t H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, + H5O_shared_t *sh_mesg); +H5_DLL herr_t H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr); +H5_DLL herr_t H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, + const char *new_name); +H5_DLL herr_t H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *op, void *op_data); +H5_DLL herr_t H5O__attr_remove(const H5O_loc_t *loc, const char *name); +H5_DLL herr_t H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n); +H5_DLL htri_t H5O__attr_exists(const H5O_loc_t *loc, const char *name); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL int H5O__attr_count(const H5O_loc_t *loc); #endif /* H5_NO_DEPRECATED_SYMBOLS */ -H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, - H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); -H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src, - H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); +H5_DLL H5A_t *H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, + H5O_copy_t *cpy_info); +H5_DLL herr_t H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, + H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, H5O_copy_t *cpy_info); +H5_DLL herr_t H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src, + H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, H5O_copy_t *cpy_info); /* Testing functions */ #ifdef H5A_TESTING -H5_DLL htri_t H5A_is_shared_test(hid_t aid); -H5_DLL herr_t H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count); +H5_DLL htri_t H5A__is_shared_test(hid_t aid); +H5_DLL herr_t H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count); #endif /* H5A_TESTING */ #endif /* _H5Apkg_H */ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 9826859..342ffc8 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -76,14 +76,10 @@ typedef struct H5A_attr_iter_op_t { H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr); H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr); H5_DLL H5T_t *H5A_type(const H5A_t *attr); -H5_DLL hid_t H5A_get_type(H5A_t *attr); H5_DLL hid_t H5A_get_space(H5A_t *attr); H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, - hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); -H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type, - H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, - const H5A_attr_iter_op_t *op, void *op_data); #endif /* _H5Aprivate_H */ diff --git a/src/H5Atest.c b/src/H5Atest.c index b923637..f7b7fd3 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -36,6 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5SMprivate.h" /* Shared object header messages */ @@ -77,7 +78,7 @@ /*------------------------------------------------------------------------- - * Function: H5A_is_shared_test + * Function: H5A__is_shared_test * * Purpose: Check if an attribute is shared * @@ -90,12 +91,12 @@ *------------------------------------------------------------------------- */ htri_t -H5A_is_shared_test(hid_t attr_id) +H5A__is_shared_test(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -106,11 +107,11 @@ H5A_is_shared_test(hid_t attr_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_is_shared_test() */ +} /* end H5A__is_shared_test() */ /*------------------------------------------------------------------------- - * Function: H5A_get_shared_rc_test + * Function: H5A__get_shared_rc_test * * Purpose: Retrieve the refcount for a shared attribute * @@ -123,26 +124,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) +H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) { H5A_t *attr; /* Attribute object for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ - if(H5SM_get_refcount(attr->oloc.file, H5AC_ind_read_dxpl_id, H5O_ATTR_ID, - &attr->sh_loc, ref_count) < 0) + if(H5SM_get_refcount(attr->oloc.file, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_get_shared_rc_test() */ +} /* end H5A__get_shared_rc_test() */ diff --git a/src/H5B.c b/src/H5B.c index e64a695..fe09b42 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -103,7 +103,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ @@ -143,20 +143,15 @@ typedef struct H5B_ins_ud_t { /********************/ /* Local Prototypes */ /********************/ -static H5B_ins_t H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - const H5B_class_t *type, - uint8_t *lt_key, - hbool_t *lt_key_changed, - uint8_t *md_key, void *udata, - uint8_t *rt_key, - hbool_t *rt_key_changed, - H5B_ins_ud_t *split_bt_ud/*out*/); +static H5B_ins_t H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, + const H5B_class_t *type, uint8_t *lt_key, hbool_t *lt_key_changed, + uint8_t *md_key, void *udata, uint8_t *rt_key, hbool_t *rt_key_changed, + H5B_ins_ud_t *split_bt_ud/*out*/); static herr_t H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key); -static herr_t H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - unsigned idx, void *udata, - H5B_ins_ud_t *split_bt_ud/*out*/); +static herr_t H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, + void *udata, H5B_ins_ud_t *split_bt_ud/*out*/); static H5B_t * H5B__copy(const H5B_t *old_bt); @@ -216,8 +211,7 @@ H5FL_SEQ_DEFINE_STATIC(size_t); *------------------------------------------------------------------------- */ herr_t -H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, - haddr_t *addr_p/*out*/) +H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p/*out*/) { H5B_t *bt = NULL; H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */ @@ -250,23 +244,23 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, if(NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) || NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node") - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "file allocation failed for B-tree root node") /* * Cache the new B-tree node. */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG - H5B__assert(f, dxpl_id, *addr_p, shared->type, udata); + H5B__assert(f, *addr_p, shared->type, udata); #endif done: if(ret_value < 0) { if(shared && shared->sizeof_rnode>0) { H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); - (void)H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, *addr_p, (hsize_t)shared->sizeof_rnode); + (void)H5MF_xfree(f, H5FD_MEM_BTREE, *addr_p, (hsize_t)shared->sizeof_rnode); } /* end if */ if(bt) /* Destroy B-tree node */ @@ -302,7 +296,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -337,7 +331,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") rt = bt->nchildren; @@ -359,16 +353,16 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u HDassert(idx < bt->nchildren); if(bt->level > 0) { - if((ret_value = H5B_find(f, dxpl_id, type, bt->child[idx], udata)) < 0) + if((ret_value = H5B_find(f, type, bt->child[idx], udata)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in subtree") } /* end if */ else { - if((ret_value = (type->found)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0) + if((ret_value = (type->found)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), udata)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't lookup key in leaf node") } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -398,10 +392,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, +H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_t *split_bt_ud/*out*/) { - H5P_genplist_t *dx_plist; /* Data transfer property list */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ unsigned nleft, nright; /* Number of keys in left & right halves */ @@ -427,12 +420,8 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, HDassert(shared); HDassert(bt_ud->bt->nchildren == shared->two_k); - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_BTREE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Get B-tree split ratios */ - if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratios[0]) < 0) + if(H5CX_get_btree_split_ratios(split_ratios) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios") #ifdef H5B_DEBUG @@ -481,12 +470,12 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, /* * Create the new B-tree node. */ - if(H5B_create(f, dxpl_id, shared->type, udata, &split_bt_ud->addr/*out*/) < 0) + if(H5B_create(f, shared->type, udata, &split_bt_ud->addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create B-tree") cache_udata.f = f; cache_udata.type = shared->type; cache_udata.rc_shared = bt_ud->bt->rc_shared; - if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (split_bt_ud->bt = (H5B_t *)H5AC_protect(f, H5AC_BT, split_bt_ud->addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree") split_bt_ud->bt->level = bt_ud->bt->level; @@ -519,12 +508,12 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, if(H5F_addr_defined(bt_ud->bt->right)) { H5B_t *tmp_bt; - if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (tmp_bt = (H5B_t *)H5AC_protect(f, H5AC_BT, bt_ud->bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load right sibling") tmp_bt->left = split_bt_ud->addr; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud->bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud->bt->right, tmp_bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end if */ @@ -533,7 +522,7 @@ H5B__split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, done: if(ret_value < 0) { - if(split_bt_ud->bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, split_bt_ud->addr, split_bt_ud->bt, split_bt_ud->cache_flags) < 0) + if(split_bt_ud->bt && H5AC_unprotect(f, H5AC_BT, split_bt_ud->addr, split_bt_ud->bt, split_bt_ud->cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") split_bt_ud->bt = NULL; split_bt_ud->addr = HADDR_UNDEF; @@ -558,7 +547,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { /* * These are defined this way to satisfy alignment constraints. @@ -599,11 +588,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.type = type; cache_udata.rc_shared = rc_shared; bt_ud.addr = addr; - if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to locate root of B-tree") /* Insert the object */ - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &bt_ud, type, lt_key, + if((int)(my_ins = H5B__insert_helper(f, &bt_ud, type, lt_key, <_key_changed, md_key, udata, rt_key, &rt_key_changed, &split_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key") @@ -633,7 +622,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void * "moving". */ H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); - if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)shared->sizeof_rnode))) + if(HADDR_UNDEF == (old_root_addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)shared->sizeof_rnode))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move root") /* @@ -646,12 +635,12 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Unprotect the old root so we can move it. Also force it to be marked * dirty so it is written to the new location. */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release old root") bt_ud.bt = NULL; /* Make certain future references will be caught */ /* Move the location of the old root on the disk */ - if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr, dxpl_id) < 0) + if(H5AC_move_entry(f, H5AC_BT, bt_ud.addr, old_root_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node") bt_ud.addr = old_root_addr; @@ -675,7 +664,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDmemcpy(H5B_NKEY(new_root_bt, shared, 2), rt_key, shared->type->sizeof_nkey); /* Insert the modified copy of the old root into the file again */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT, addr, new_root_bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to add old B-tree root node to cache") done: @@ -684,16 +673,16 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTRELEASE, FAIL, "unable to free B-tree root node"); if(bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt_ud.addr, bt_ud.bt, bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt_ud.addr, bt_ud.bt, bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect old root") if(split_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect new child") #ifdef H5B_DEBUG if(ret_value >= 0) - H5B__assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, addr, type, udata); #endif FUNC_LEAVE_NOAPI(ret_value) @@ -805,12 +794,9 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, - const H5B_class_t *type, - uint8_t *lt_key, hbool_t *lt_key_changed, - uint8_t *md_key, void *udata, - uint8_t *rt_key, hbool_t *rt_key_changed, - H5B_ins_ud_t *split_bt_ud/*out*/) +H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, + uint8_t *lt_key, hbool_t *lt_key_changed, uint8_t *md_key, void *udata, + uint8_t *rt_key, hbool_t *rt_key_changed, H5B_ins_ud_t *split_bt_ud/*out*/) { H5B_t *bt; /* Convenience pointer to B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -882,7 +868,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * must necessarily be at level zero. */ HDassert(0 == bt->level); - if((type->new_node)(f, dxpl_id, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata, + if((type->new_node)(f, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata, H5B_NKEY(bt, shared, 1), bt->child + 0/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, H5B_INS_ERROR, "unable to create leaf node") bt->nchildren = 1; @@ -890,7 +876,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, idx = 0; if(type->follow_min) { - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert first leaf node") @@ -904,10 +890,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * Follow the minimum branch out of this node to a subtree. */ child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -918,7 +904,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * current node. Follow the minimum branch to a leaf node and let * the subclass handle the problem. */ - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node") @@ -930,7 +916,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ my_ins = H5B_INS_LEFT; HDmemcpy(md_key, H5B_NKEY(bt,shared,idx), type->sizeof_nkey); - if((type->new_node)(f, dxpl_id, H5B_INS_LEFT, H5B_NKEY(bt, shared, idx), udata, + if((type->new_node)(f, H5B_INS_LEFT, H5B_NKEY(bt, shared, idx), udata, md_key, &new_child_bt_ud.addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node") *lt_key_changed = TRUE; @@ -950,10 +936,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ idx = bt->nchildren - 1; child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) @@ -965,7 +951,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * the subclass handle the problem. */ idx = bt->nchildren - 1; - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node") @@ -978,7 +964,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, idx = bt->nchildren - 1; my_ins = H5B_INS_RIGHT; HDmemcpy(md_key, H5B_NKEY(bt, shared, idx + 1), type->sizeof_nkey); - if((type->new_node)(f, dxpl_id, H5B_INS_RIGHT, md_key, udata, + if((type->new_node)(f, H5B_INS_RIGHT, md_key, udata, H5B_NKEY(bt, shared, idx + 1), &new_child_bt_ud.addr/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node") *rt_key_changed = TRUE; @@ -1005,10 +991,10 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, */ HDassert(idx < bt->nchildren); child_bt_ud.addr = bt->child[idx]; - if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node") - if((int)(my_ins = H5B__insert_helper(f, dxpl_id, &child_bt_ud, type, + if((int)(my_ins = H5B__insert_helper(f, &child_bt_ud, type, H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree") @@ -1017,7 +1003,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * Follow a branch out of this node to a leaf node of some other type. */ HDassert(idx < bt->nchildren); - if((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt, shared, idx), + if((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node") @@ -1068,7 +1054,7 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, * If this node is full then split it before inserting the new child. */ if(bt->nchildren == shared->two_k) { - if(H5B__split(f, dxpl_id, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) + if(H5B__split(f, bt_ud, idx, udata, split_bt_ud/*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, H5B_INS_ERROR, "unable to split node") if(idx < bt->nchildren) { tmp_bt = bt; @@ -1111,11 +1097,11 @@ H5B__insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, done: if(child_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, child_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, child_bt_ud.addr, child_bt_ud.bt, child_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect child") if(new_child_bt_ud.bt) - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, new_child_bt_ud.addr, new_child_bt_ud.bt, new_child_bt_ud.cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_BT, new_child_bt_ud.addr, new_child_bt_ud.bt, new_child_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to unprotect new child") FUNC_LEAVE_NOAPI(ret_value) @@ -1137,7 +1123,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1168,21 +1154,21 @@ H5B__iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load B-tree node") /* Iterate over node's children */ for(u = 0; u < bt->nchildren && ret_value == H5_ITER_CONT; u++) { if(bt->level > 0) - ret_value = H5B__iterate_helper(f, dxpl_id, type, bt->child[u], op, udata); + ret_value = H5B__iterate_helper(f, type, bt->child[u], op, udata); else - ret_value = (*op)(f, dxpl_id, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); + ret_value = (*op)(f, H5B_NKEY(bt, shared, u), bt->child[u], H5B_NKEY(bt, shared, u + 1), udata); if(ret_value < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); } /* end for */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1204,7 +1190,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, void *udata) { herr_t ret_value = FAIL; /* Return value */ @@ -1221,7 +1207,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDassert(udata); /* Iterate over the B-tree records */ - if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); FUNC_LEAVE_NOAPI(ret_value) @@ -1253,10 +1239,9 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, *------------------------------------------------------------------------- */ static H5B_ins_t -H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, - int level, uint8_t *lt_key/*out*/, - hbool_t *lt_key_changed/*out*/, void *udata, - uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) +H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, + uint8_t *lt_key/*out*/, hbool_t *lt_key_changed/*out*/, void *udata, + uint8_t *rt_key/*out*/, hbool_t *rt_key_changed/*out*/) { H5B_t *bt = NULL, *sibling = NULL; unsigned bt_flags = H5AC__NO_FLAGS_SET; @@ -1291,7 +1276,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load B-tree node") rt = bt->nchildren; @@ -1312,9 +1297,9 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(idx < bt->nchildren); if(bt->level > 0) { /* We're at an internal node -- call recursively */ - if((int)(ret_value = H5B__remove_helper(f, dxpl_id, - bt->child[idx], type, level + 1, H5B_NKEY(bt, shared, idx)/*out*/, - lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, + if((int)(ret_value = H5B__remove_helper(f, bt->child[idx], type, + level + 1, H5B_NKEY(bt, shared, idx)/*out*/, + lt_key_changed/*out*/, udata, H5B_NKEY(bt, shared, idx + 1)/*out*/, rt_key_changed/*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in subtree") } else if(type->remove) { @@ -1323,9 +1308,9 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ * has a removal method. Pass the removal request to the pointed-to * object and let it decide how to progress. */ - if((int)(ret_value = (type->remove)(f, dxpl_id, - bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, udata, - H5B_NKEY(bt, shared, idx + 1), rt_key_changed)) < 0) + if((int)(ret_value = (type->remove)(f, bt->child[idx], + H5B_NKEY(bt, shared, idx), lt_key_changed, udata, + H5B_NKEY(bt, shared, idx + 1), rt_key_changed)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node") } else { /* @@ -1391,7 +1376,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ * "critical" for any child in its node to maintain this * consistency (and avoid breaking key/child consistency) */ if(H5F_addr_defined(bt->left)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to load node from tree") /* Copy right-most key from deleted node to right-most key @@ -1403,12 +1388,12 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ sibling->right = bt->right; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ if(H5F_addr_defined(bt->right)) { - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to unlink node from tree") /* Copy left-most key from deleted node to left-most key in @@ -1420,7 +1405,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ sibling->left = bt->left; - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1433,7 +1418,7 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ /* Delete the node from disk (via the metadata cache) */ bt_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; H5_CHECK_OVERFLOW(shared->sizeof_rnode, size_t, hsize_t); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { + if(H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags | H5AC__DELETED_FLAG) < 0) { bt = NULL; bt_flags = H5AC__NO_FLAGS_SET; HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to free B-tree node") @@ -1528,13 +1513,13 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the rightmost key in the left sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, sibling->nchildren), H5B_NKEY(bt, shared, 0), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end if */ @@ -1543,19 +1528,19 @@ H5B__remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *typ HDassert(level > 0); /* Update the lefttmost key in the right sibling */ - if(NULL == (sibling = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->right, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, H5B_INS_ERROR, "unable to protect node") HDmemcpy(H5B_NKEY(sibling, shared, 0), H5B_NKEY(bt, shared, bt->nchildren), type->sizeof_nkey); - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling = NULL; /* Make certain future references will be caught */ } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -1579,7 +1564,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { /* These are defined this way to satisfy alignment constraints */ uint64_t _lt_key[128], _rt_key[128]; @@ -1598,16 +1583,15 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HDassert(H5F_addr_defined(addr)); /* The actual removal */ - if(H5B__remove_helper(f, dxpl_id, addr, type, 0, lt_key, <_key_changed, - udata, rt_key, &rt_key_changed) == H5B_INS_ERROR) + if(H5B_INS_ERROR == H5B__remove_helper(f, addr, type, 0, lt_key, <_key_changed, udata, rt_key, &rt_key_changed)) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree") #ifdef H5B_DEBUG - H5B__assert(f, dxpl_id, addr, type, udata); + H5B__assert(f, addr, type, udata); #endif done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5B_remove() */ /*------------------------------------------------------------------------- @@ -1624,7 +1608,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *udata) +H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) { H5B_t *bt = NULL; /* B-tree node being operated on */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -1650,14 +1634,14 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Iterate over all children in tree, deleting them */ if(bt->level > 0) { /* Iterate over all children in node, deleting them */ for(u = 0; u < bt->nchildren; u++) - if(H5B_delete(f, dxpl_id, type, bt->child[u], udata) < 0) + if(H5B_delete(f, type, bt->child[u], udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to delete B-tree node") } /* end if */ @@ -1669,16 +1653,16 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Iterate over all entries in node, calling callback */ for(u = 0; u < bt->nchildren; u++) { /* Call user's callback for each entry */ - if((type->remove)(f, dxpl_id, - bt->child[u], H5B_NKEY(bt, shared, u), <_key_changed, udata, - H5B_NKEY(bt, shared, u + 1), &rt_key_changed) < H5B_INS_NOOP) + if((type->remove)(f, bt->child[u], H5B_NKEY(bt, shared, u), + <_key_changed, udata, H5B_NKEY(bt, shared, u + 1), + &rt_key_changed) < H5B_INS_NOOP) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't remove B-tree node") } /* end for */ } /* end if */ } /* end else */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) @@ -1873,7 +1857,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, const H5B_info_ud_t *info_udata) { H5B_t *bt = NULL; /* Pointer to current B-tree node */ @@ -1911,7 +1895,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* Cache information from this node */ @@ -1924,7 +1908,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a info_udata->bt_info->num_nodes++; /* Release current node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; @@ -1935,7 +1919,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a while(H5F_addr_defined(next_addr)) { /* Protect the next node to the right */ addr = next_addr; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "B-tree node") /* Cache information from this node */ @@ -1946,7 +1930,7 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a info_udata->bt_info->num_nodes++; /* Unprotect node */ - if(H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") bt = NULL; } /* end while */ @@ -1954,12 +1938,12 @@ H5B__get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t a /* Check for another "row" of B-tree nodes to iterate over */ if(level > 0) { /* Keep following the left-most child until we reach a leaf node. */ - if(H5B__get_info_helper(f, dxpl_id, type, left_child, info_udata) < 0) + if(H5B__get_info_helper(f, type, left_child, info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "unable to list B-tree node") } /* end if */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1979,7 +1963,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, +H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_info, H5B_operator_t op, void *udata) { H5B_info_ud_t info_udata; /* User-data for B-tree size iteration */ @@ -2004,13 +1988,13 @@ H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, info_udata.udata = udata; /* Iterate over the B-tree nodes */ - if(H5B__get_info_helper(f, dxpl_id, type, addr, &info_udata) < 0) + if(H5B__get_info_helper(f, type, addr, &info_udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADITER, FAIL, "B-tree iteration failed") /* Iterate over the B-tree records, making any "leaf" callbacks */ /* (Only if operator defined) */ if(op) - if((ret_value = H5B__iterate_helper(f, dxpl_id, type, addr, op, udata)) < 0) + if((ret_value = H5B__iterate_helper(f, type, addr, op, udata)) < 0) HERROR(H5E_BTREE, H5E_BADITER, "B-tree iteration failed"); done: @@ -2031,7 +2015,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) +H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) { H5B_t *bt = NULL; /* The B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -2062,12 +2046,12 @@ H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr) cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree node") done: /* Release the node */ - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2.c b/src/H5B2.c index 7e679cd..1f964b8 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -135,7 +135,7 @@ H5FL_DEFINE_STATIC(H5B2_t); *------------------------------------------------------------------------- */ H5B2_t * -H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udata) +H5B2_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ @@ -154,7 +154,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat HDcompile_assert(H5B2_NUM_BTREE_ID == NELMTS(H5B2_client_class_g)); /* Create shared v2 B-tree header */ - if(HADDR_UNDEF == (hdr_addr = H5B2__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (hdr_addr = H5B2__hdr_create(f, cparam, ctx_udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't create v2 B-tree header") /* Create v2 B-tree wrapper */ @@ -162,7 +162,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for v2 B-tree info") /* Look up the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect v2 B-tree header") /* Point v2 B-tree wrapper at header and bump it's ref count */ @@ -181,10 +181,10 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat ret_value = bt2; done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to release v2 B-tree header") if(!ret_value && bt2) - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, NULL, "unable to close v2 B-tree") FUNC_LEAVE_NOAPI(ret_value) @@ -206,7 +206,7 @@ done: *------------------------------------------------------------------------- */ H5B2_t * -H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) +H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata) { H5B2_t *bt2 = NULL; /* Pointer to the B-tree */ H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ @@ -219,7 +219,7 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) HDassert(H5F_addr_defined(addr)); /* Look up the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect v2 B-tree header") /* Check for pending heap deletion */ @@ -246,10 +246,10 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) ret_value = bt2; done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to release v2 B-tree header") if(!ret_value && bt2) - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCLOSEOBJ, NULL, "unable to close v2 B-tree") FUNC_LEAVE_NOAPI(ret_value) @@ -270,7 +270,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) +H5B2_insert(H5B2_t *bt2, void *udata) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -288,7 +288,7 @@ H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) hdr = bt2->hdr; /* Insert the record */ - if(H5B2__insert(hdr, dxpl_id, udata) < 0) + if(H5B2__insert(hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree") done: @@ -313,7 +313,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_data) +H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_update_status_t status = H5B2_UPDATE_UNKNOWN; /* Whether the record was inserted/modified */ @@ -334,17 +334,17 @@ H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_ /* Check if the root node is allocated yet */ if(!H5F_addr_defined(hdr->root.addr)) { /* Create root node as leaf node in B-tree */ - if(H5B2__create_leaf(hdr, dxpl_id, hdr, &(hdr->root)) < 0) + if(H5B2__create_leaf(hdr, hdr, &(hdr->root)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create root node") } /* end if */ /* Attempt to insert record into B-tree */ if(hdr->depth > 0) { - if(H5B2__update_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__update_internal(hdr, hdr->depth, NULL, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in B-tree internal node") } /* end if */ else { - if(H5B2__update_leaf(hdr, dxpl_id, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__update_leaf(hdr, &hdr->root, &status, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in B-tree leaf node") } /* end else */ @@ -353,7 +353,7 @@ H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, void *op_ /* Use insert algorithm if nodes to leaf full */ if(H5B2_UPDATE_INSERT_CHILD_FULL == status) { - if(H5B2__insert(hdr, dxpl_id, udata) < 0) + if(H5B2__insert(hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree") } /* end if */ else if(H5B2_UPDATE_SHADOW_DONE == status || H5B2_UPDATE_INSERT_DONE == status) { @@ -420,7 +420,7 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) *------------------------------------------------------------------------- */ herr_t -H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) +H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -438,11 +438,10 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) hdr = bt2->hdr; /* Iterate through records */ - if(hdr->root.node_nrec > 0) { + if(hdr->root.node_nrec > 0) /* Iterate through nodes */ - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, hdr->depth, &hdr->root, hdr, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5B2_iterate() */ @@ -472,8 +471,7 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) *------------------------------------------------------------------------- */ htri_t -H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, - void *op_data) +H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -543,7 +541,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -556,7 +554,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Locate node pointer for child */ if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ @@ -585,7 +583,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -599,14 +597,14 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Make callback for current record */ if(op && (op)(H5B2_INT_NREC(internal, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Indicate record found */ @@ -621,7 +619,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -634,13 +632,13 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Locate record */ if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Record not found */ @@ -650,7 +648,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, /* Make callback for current record */ if(op && (op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") @@ -679,7 +677,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, } /* end else */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -713,8 +711,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, - H5B2_found_t op, void *op_data) +H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, + void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -763,7 +761,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned u; /* Local index variable */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -781,7 +779,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -800,14 +798,14 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, /* Make callback for current record */ if((op)(H5B2_INT_NREC(internal, hdr, u), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -827,7 +825,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, next_node_ptr = internal->node_ptrs[u]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -850,7 +848,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -866,14 +864,14 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, /* Make callback for correct record */ if((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0) { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "'found' callback failed for B-tree find operation") } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -902,8 +900,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, - void *op_data) +H5B2_remove(H5B2_t *bt2, void *udata, H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -927,7 +924,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2__remove_internal(hdr, dxpl_id, &depth_decreased, NULL, NULL, + if(H5B2__remove_internal(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, H5B2_POS_ROOT, &hdr->root, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -947,7 +944,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, } /* end for */ } /* end if */ else { - if(H5B2__remove_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, &hdr->root, H5B2_POS_ROOT, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -977,8 +974,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, - hsize_t idx, H5B2_remove_t op, void *op_data) +H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, + H5B2_remove_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1010,7 +1007,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, if(hdr->depth > 0) { hbool_t depth_decreased = FALSE; /* Flag to indicate whether the depth of the B-tree decreased */ - if(H5B2__remove_internal_by_idx(hdr, dxpl_id, &depth_decreased, NULL, NULL, + if(H5B2__remove_internal_by_idx(hdr, &depth_decreased, NULL, NULL, hdr->depth, &(hdr->cache_info), NULL, &hdr->root, H5B2_POS_ROOT, idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") @@ -1030,7 +1027,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, } /* end for */ } /* end if */ else { - if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, (unsigned)idx, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, &hdr->root, H5B2_POS_ROOT, hdr, (unsigned)idx, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1101,7 +1098,7 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) *------------------------------------------------------------------------- */ herr_t -H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, +H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, H5B2_found_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ @@ -1125,11 +1122,11 @@ H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, /* Attempt to find neighbor record in B-tree */ if(hdr->depth > 0) { - if(H5B2__neighbor_internal(hdr, dxpl_id, hdr->depth, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, hdr->depth, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2__neighbor_leaf(hdr, dxpl_id, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, &hdr->root, NULL, range, hdr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ @@ -1159,8 +1156,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, - void *op_data) +H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -1206,7 +1202,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -1219,7 +1215,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, /* Locate node pointer for child */ if(H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ @@ -1249,7 +1245,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, } /* end if */ /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -1268,7 +1264,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, HDassert(changed == FALSE); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1278,7 +1274,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, internal_flags |= changed ? H5AC__DIRTIED_FLAG : 0; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_DONE(SUCCEED); @@ -1294,7 +1290,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, hbool_t changed = FALSE;/* Whether the 'modify' callback changed the record */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -1307,13 +1303,13 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, /* Locate record */ if(H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) { /* Unlock current node before failing */ - H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); + H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET); HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ if(cmp != 0) { /* Unlock leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Note: don't push error on stack, leave that to next higher level, @@ -1333,7 +1329,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, HDassert(changed == FALSE); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree find operation") @@ -1365,7 +1361,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, leaf_flags |= (changed ? H5AC__DIRTIED_FLAG : 0); /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } /* end block */ @@ -1394,7 +1390,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_close(H5B2_t *bt2, hid_t dxpl_id) +H5B2_close(H5B2_t *bt2) { haddr_t bt2_addr = HADDR_UNDEF; /* Address of v2 B-tree (for deletion) */ hbool_t pending_delete = FALSE; /* Whether the v2 B-tree is pending deletion */ @@ -1445,7 +1441,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) /* Lock the v2 B-tree header into memory */ /* (OK to pass in NULL for callback context, since we know the header must be in the cache) */ - if(NULL == (hdr = H5B2__hdr_protect(bt2->f, dxpl_id, bt2_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(bt2->f, bt2_addr, NULL, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Set the shared v2 B-tree header's file context for this operation */ @@ -1459,7 +1455,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement reference count on shared v2 B-tree header") /* Delete v2 B-tree, starting with header (unprotects header) */ - if(H5B2__hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") } /* end if */ else { @@ -1503,8 +1499,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, - H5B2_remove_t op, void *op_data) +H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, + void *op_data) { H5B2_hdr_t *hdr = NULL; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1519,7 +1515,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, #ifdef QAK HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); #endif /* QAK */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Remember the callback & context for later */ @@ -1534,14 +1530,14 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); hdr->f = f; /* Delete v2 B-tree now, starting with header (unprotects header) */ - if(H5B2__hdr_delete(hdr, dxpl_id) < 0) + if(H5B2__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree") hdr = NULL; } /* end if */ done: /* Unprotect the header, if an error occurred */ - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -1562,7 +1558,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent) +H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent) { /* Local variables */ H5B2_hdr_t *hdr = bt2->hdr; /* Header for B-tree */ @@ -1591,7 +1587,7 @@ H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent) hdr->f = bt2->f; /* Add the v2 B-tree 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) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree as child of proxy") hdr->parent = parent; } /* end if */ diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 3890ae0..dc079f1 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -86,7 +86,7 @@ *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header info */ @@ -108,7 +108,7 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(type); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree header") /* Set file pointer for this B-tree operation */ @@ -160,7 +160,7 @@ H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -207,7 +207,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(nrec > 0); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load v2 B-tree header") /* Set file pointer for this B-tree operation */ @@ -219,7 +219,7 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5_CHECK_OVERFLOW(depth, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, NULL, &node_ptr, (uint16_t)depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Print opening message */ @@ -270,9 +270,9 @@ H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, internal->node_ptrs[u].addr); done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release v2 B-tree header") - if(internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(f, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -293,7 +293,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ @@ -319,7 +319,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent HDassert(nrec > 0); /* Load the B-tree header */ - if(NULL == (hdr = H5B2__hdr_protect(f, dxpl_id, hdr_addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect v2 B-tree header") /* Set file pointer for this B-tree operation */ @@ -331,7 +331,7 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent H5_CHECK_OVERFLOW(nrec, unsigned, uint16_t); node_ptr.addr = addr; H5_CHECKED_ASSIGN(node_ptr.node_nrec, unsigned, nrec, uint16_t) - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, NULL, &node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Print opening message */ @@ -366,9 +366,9 @@ H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent } /* end for */ done: - if(hdr && H5B2__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5B2__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") - if(leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(f, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index ab017c6..e9b6810 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -282,8 +282,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, - void *ctx_udata) +H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) { H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ hbool_t inserted = FALSE; /* Whether the header was inserted into cache */ @@ -306,7 +305,7 @@ H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, HADDR_UNDEF, "can't create shared B-tree info") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->hdr_size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)hdr->hdr_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, HADDR_UNDEF, "file allocation failed for B-tree header") /* Create 'top' proxy for extensible array entries */ @@ -315,13 +314,13 @@ H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, HGOTO_ERROR(H5E_BTREE, H5E_CANTCREATE, HADDR_UNDEF, "can't create v2 B-tree proxy") /* Cache the new B-tree node */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_BT2_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, HADDR_UNDEF, "can't add B-tree header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, HADDR_UNDEF, "unable to add v2 B-tree header as child of array proxy") /* Set address of v2 B-tree header to return */ @@ -336,7 +335,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, HADDR_UNDEF, "unable to remove v2 B-tree header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, hdr->addr, (hsize_t)hdr->hdr_size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_BTREE, hdr->addr, (hsize_t)hdr->hdr_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, HADDR_UNDEF, "unable to free v2 B-tree header") /* Destroy header */ @@ -524,7 +523,7 @@ done: *------------------------------------------------------------------------- */ H5B2_hdr_t * -H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, +H5B2__hdr_protect(H5F_t *f, haddr_t hdr_addr, void *ctx_udata, unsigned flags) { H5B2_hdr_cache_ud_t udata; /* User data for cache callbacks */ @@ -546,7 +545,7 @@ H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, &udata, flags))) + if(NULL == (hdr = (H5B2_hdr_t *)H5AC_protect(f, H5AC_BT2_HDR, hdr_addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to load v2 B-tree header, address = %llu", (unsigned long long)hdr_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -557,7 +556,7 @@ H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, void *ctx_udata, HGOTO_ERROR(H5E_BTREE, H5E_CANTCREATE, NULL, "can't create v2 B-tree proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree header as child of proxy") } /* end if */ @@ -568,7 +567,7 @@ done: /* Clean up on error */ if(!ret_value) { /* Release the header, if it was protected */ - if(hdr && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(hdr->f, H5AC_BT2_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree header, address = %llu", (unsigned long long)hdr_addr) } /* end if */ @@ -590,7 +589,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags) +H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -600,7 +599,7 @@ H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect v2 B-tree header, address = %llu", (unsigned long long)hdr->addr) done: @@ -699,7 +698,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__hdr_delete(H5B2_hdr_t *hdr) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -725,7 +724,7 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Delete all nodes in B-tree */ if(H5F_addr_defined(hdr->root.addr)) - if(H5B2__delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, hdr->remove_op, hdr->remove_op_data) < 0) + if(H5B2__delete_node(hdr, hdr->depth, &hdr->root, hdr, hdr->remove_op, hdr->remove_op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes") /* Indicate that the heap header should be deleted & file space freed */ @@ -733,7 +732,7 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) done: /* Unprotect the header with appropriate flags */ - if(H5B2__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0) + if(H5B2__hdr_unprotect(hdr, cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release v2 B-tree header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2int.c b/src/H5B2int.c index c72bc98..b3f855f 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -56,7 +56,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent); @@ -146,9 +146,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -180,7 +180,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Create new internal node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2__create_internal(hdr, dxpl_id, internal, &(internal->node_ptrs[idx + 1]), (uint16_t)(depth - 1)) < 0) + if(H5B2__create_internal(hdr, internal, &(internal->node_ptrs[idx + 1]), (uint16_t)(depth - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Setup information for unlocking child nodes */ @@ -188,10 +188,10 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Protect both leaves */ /* (Shadow left node if doing SWMR writes) */ - if(NULL == (left_int = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_int = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_int = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_int = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -210,7 +210,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Create new leaf node */ internal->node_ptrs[idx + 1].all_nrec = internal->node_ptrs[idx + 1].node_nrec = 0; - if(H5B2__create_leaf(hdr, dxpl_id, internal, &(internal->node_ptrs[idx + 1])) < 0) + if(H5B2__create_leaf(hdr, internal, &(internal->node_ptrs[idx + 1])) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new leaf node") /* Setup information for unlocking child nodes */ @@ -218,10 +218,10 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Protect both leaves */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -299,7 +299,7 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)(*right_nrec + 1), left_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -317,9 +317,9 @@ H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Release child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -341,7 +341,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) +H5B2__split_root(H5B2_hdr_t *hdr) { H5B2_internal_t *new_root = NULL; /* Pointer to new root node */ unsigned new_root_flags = H5AC__NO_FLAGS_SET; /* Cache flags for new root node */ @@ -381,23 +381,23 @@ H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) /* Create new internal node to use as root */ hdr->root.node_nrec = 0; - if(H5B2__create_internal(hdr, dxpl_id, hdr, &(hdr->root), hdr->depth) < 0) + if(H5B2__create_internal(hdr, hdr, &(hdr->root), hdr->depth) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create new internal node") /* Protect new root node */ - if(NULL == (new_root = H5B2__protect_internal(hdr, dxpl_id, hdr, &hdr->root, hdr->depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (new_root = H5B2__protect_internal(hdr, hdr, &hdr->root, hdr->depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set first node pointer in root node to old root node pointer info */ new_root->node_ptrs[0] = old_root_ptr; /* Split original root node */ - if(H5B2__split1(hdr, dxpl_id, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) + if(H5B2__split1(hdr, hdr->depth, &(hdr->root), NULL, new_root, &new_root_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split old root node") done: /* Release new root node (marked as dirty) */ - if(new_root && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, hdr->root.addr, new_root, new_root_flags) < 0) + if(new_root && H5AC_unprotect(hdr->f, H5AC_BT2_INT, hdr->root.addr, new_root, new_root_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -419,8 +419,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned idx) +H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -448,10 +448,10 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow both nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -474,10 +474,10 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow both nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -542,7 +542,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + move_nrec + 1), right_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -598,7 +598,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)move_nrec, left_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -639,9 +639,9 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Release child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -663,8 +663,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { H5B2_node_ptr_t *left_node_ptrs = NULL, *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */ @@ -701,13 +701,13 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow all nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -735,13 +735,13 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow all nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -812,7 +812,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + moved_middle_nrec + 1), middle_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -861,7 +861,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, right_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, right_node_ptrs, 0, (unsigned)right_nrec_move, middle_child, right_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -910,7 +910,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, 0, (unsigned)left_nrec_move, left_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -958,7 +958,7 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, (unsigned)(curr_middle_nrec + 1), (unsigned)(curr_middle_nrec + right_nrec_move + 1), right_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1010,11 +1010,11 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock child nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(middle_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, middle_addr, middle_child, middle_child_flags) < 0) + if(middle_child && H5AC_unprotect(hdr->f, child_class, middle_addr, middle_child, middle_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1037,9 +1037,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -1068,10 +1068,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1094,10 +1094,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock left & right B-tree child nodes */ /* (Shadow the left node if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1124,7 +1124,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + *right_nrec + 2), right_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1173,11 +1173,11 @@ H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock left node (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1200,9 +1200,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) +H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ @@ -1239,13 +1239,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow left and middle nodes if doing SWMR writes) */ - if(NULL == (left_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx - 1], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx + 1], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1273,13 +1273,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Lock B-tree child nodes */ /* (Shadow left and middle nodes if doing SWMR writes) */ - if(NULL == (left_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (left_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx - 1], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") left_addr = internal->node_ptrs[idx - 1].addr; - if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) + if(NULL == (middle_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], hdr->swmr_write, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") middle_addr = internal->node_ptrs[idx].addr; - if(NULL == (right_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (right_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx + 1], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") right_addr = internal->node_ptrs[idx + 1].addr; @@ -1332,7 +1332,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, left_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, left_node_ptrs, (unsigned)(*left_nrec + 1), (unsigned)(*left_nrec + middle_nrec_move + 1), middle_child, left_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1360,7 +1360,7 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Update flush dependencies for grandchildren, if using SWMR */ if(hdr->swmr_write && depth > 1) - if(H5B2__update_child_flush_depends(hdr, dxpl_id, depth, middle_node_ptrs, + if(H5B2__update_child_flush_depends(hdr, depth, middle_node_ptrs, (unsigned)(*middle_nrec + 1), (unsigned)(*middle_nrec + *right_nrec + 2), right_child, middle_child) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child nodes to new parent") @@ -1415,13 +1415,13 @@ H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock left & middle nodes (marked as dirty) */ - if(left_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, left_addr, left_child, left_child_flags) < 0) + if(left_child && H5AC_unprotect(hdr->f, child_class, left_addr, left_child, left_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") - if(middle_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, middle_addr, middle_child, middle_child_flags) < 0) + if(middle_child && H5AC_unprotect(hdr->f, child_class, middle_addr, middle_child, middle_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") /* Delete right node & remove from cache (marked as dirty) */ - if(right_child && H5AC_unprotect(hdr->f, dxpl_id, child_class, right_addr, right_child, right_child_flags) < 0) + if(right_child && H5AC_unprotect(hdr->f, child_class, right_addr, right_child, right_child_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -1442,7 +1442,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata) +H5B2__insert(H5B2_hdr_t *hdr, void *udata) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1455,23 +1455,23 @@ H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata) /* Check if the root node is allocated yet */ if(!H5F_addr_defined(hdr->root.addr)) { /* Create root node as leaf node in B-tree */ - if(H5B2__create_leaf(hdr, dxpl_id, hdr, &(hdr->root)) < 0) + if(H5B2__create_leaf(hdr, hdr, &(hdr->root)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to create root node") } /* end if */ /* Check if we need to split the root node (equiv. to a 1->2 node split) */ else if(hdr->root.node_nrec == hdr->node_info[hdr->depth].split_nrec) { /* Split root node */ - if(H5B2__split_root(hdr, dxpl_id) < 0) + if(H5B2__split_root(hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ /* Attempt to insert record into B-tree */ if(hdr->depth > 0) { - if(H5B2__insert_internal(hdr, dxpl_id, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) + if(H5B2__insert_internal(hdr, hdr->depth, NULL, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2__insert_leaf(hdr, dxpl_id, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) + if(H5B2__insert_leaf(hdr, &hdr->root, H5B2_POS_ROOT, hdr, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ @@ -1502,9 +1502,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, H5B2_operator_t op, - void *op_data) +H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, H5B2_operator_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ void *node = NULL; /* Pointers to current node */ @@ -1527,7 +1526,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_internal_t *internal; /* Pointer to internal node */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -1546,7 +1545,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -1563,7 +1562,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDmemcpy(native, node_native, (hdr->cls->nrec_size * curr_node->node_nrec)); /* Unlock the node */ - if(H5AC_unprotect(hdr->f, dxpl_id, curr_node_class, curr_node->addr, node, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, curr_node_class, curr_node->addr, node, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") if(hdr->swmr_write) node_pinned = TRUE; @@ -1574,7 +1573,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, for(u = 0; u < curr_node->node_nrec && !ret_value; u++) { /* Descend into child node, if current node is an internal node */ if(depth > 0) { - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -1587,7 +1586,7 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into last child node, if current node is an internal node */ if(!ret_value && depth > 0) { - if((ret_value = H5B2__iterate_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) + if((ret_value = H5B2__iterate_node(hdr, (uint16_t)(depth - 1), &(node_ptrs[u]), node, op, op_data)) < 0) HERROR(H5E_BTREE, H5E_CANTLIST, "node iteration failed"); } /* end if */ @@ -1621,9 +1620,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, H5B2_remove_t op, - void *op_data) +H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, H5B2_remove_t op, void *op_data) { const H5AC_class_t *curr_node_class = NULL; /* Pointer to current node's class info */ void *node = NULL; /* Pointers to current node */ @@ -1641,7 +1639,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, unsigned u; /* Local index */ /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Set up information about current node */ @@ -1651,14 +1649,14 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2__delete_node(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, op, op_data) < 0) + if(H5B2__delete_node(hdr, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node descent failed") } /* end if */ else { H5B2_leaf_t *leaf; /* Pointer to leaf node */ /* Lock the current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, (H5B2_node_ptr_t *)curr_node, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Set up information about current node */ @@ -1681,7 +1679,7 @@ H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock & delete current node */ - if(node && H5AC_unprotect(hdr->f, dxpl_id, curr_node_class, curr_node->addr, node, (unsigned)(H5AC__DELETED_FLAG | (hdr->swmr_write ? 0 : H5AC__FREE_FILE_SPACE_FLAG))) < 0) + if(node && H5AC_unprotect(hdr->f, curr_node_class, curr_node->addr, node, (unsigned)(H5AC__DELETED_FLAG | (hdr->swmr_write ? 0 : H5AC__FREE_FILE_SPACE_FLAG))) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1702,8 +1700,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - const H5B2_node_ptr_t *curr_node, void *parent, hsize_t *btree_size) +H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, + void *parent, hsize_t *btree_size) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ herr_t ret_value = SUCCEED; /* Iterator return value */ @@ -1717,7 +1715,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(depth > 0); /* Lock the current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ + if(NULL == (internal = H5B2__protect_internal(hdr, parent, (H5B2_node_ptr_t *)curr_node, depth, FALSE, H5AC__READ_ONLY_FLAG))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Recursively descend into child nodes, if we are above the "twig" level in the B-tree */ @@ -1726,7 +1724,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Descend into children */ for(u = 0; u < internal->nrec + (unsigned)1; u++) - if(H5B2__node_size(hdr, dxpl_id, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, btree_size) < 0) + if(H5B2__node_size(hdr, (uint16_t)(depth - 1), &(internal->node_ptrs[u]), internal, btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ else /* depth is 1: count all the leaf nodes from this node */ @@ -1736,7 +1734,7 @@ H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, *btree_size += hdr->node_size; done: - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1789,7 +1787,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptr, void *old_parent, void *new_parent) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1820,7 +1818,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_internal_t *child_int; /* Protect child */ - if(NULL == (child_int = H5B2__protect_internal(hdr, dxpl_id, new_parent, (H5B2_node_ptr_t *)node_ptr, (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (child_int = H5B2__protect_internal(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") child_class = H5AC_BT2_INT; child = child_int; @@ -1836,7 +1834,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_leaf_t *child_leaf; /* Protect child */ - if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, new_parent, (H5B2_node_ptr_t *)node_ptr, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, new_parent, (H5B2_node_ptr_t *)node_ptr, FALSE, H5AC__NO_FLAGS_SET))) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") child_class = H5AC_BT2_LEAF; child = child_leaf; @@ -1866,7 +1864,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, done: /* Unprotect the child */ if(child) - if(H5AC_unprotect(hdr->f, dxpl_id, child_class, node_ptr->addr, child, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, child_class, node_ptr->addr, child, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1887,7 +1885,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, +H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t *node_ptrs, unsigned start_idx, unsigned end_idx, void *old_parent, void *new_parent) { @@ -1907,7 +1905,7 @@ H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, /* Loop over children */ for(u = start_idx; u < end_idx; u++) /* Update parent for children */ - if(H5B2__update_flush_depend(hdr, dxpl_id, depth - 1, &node_ptrs[u], old_parent, new_parent) < 0) + if(H5B2__update_flush_depend(hdr, depth - 1, &node_ptrs[u], old_parent, new_parent) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") done: diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 1716c44..95ed769 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -56,8 +56,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr); +static herr_t H5B2__shadow_internal(H5B2_internal_t *internal, H5B2_node_ptr_t *curr_node_ptr); /*********************/ @@ -94,8 +93,8 @@ H5FL_DEFINE(H5B2_internal_t); *------------------------------------------------------------------------- */ herr_t -H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, uint16_t depth) +H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + uint16_t depth) { H5B2_internal_t *internal = NULL; /* Pointer to new internal node created */ hbool_t inserted = FALSE; /* Whether the internal node was inserted into cache */ @@ -139,17 +138,17 @@ H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, internal->shadow_epoch = hdr->shadow_epoch; /* Allocate space on disk for the internal node */ - if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree internal node") /* Cache the new B-tree node */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree internal node to cache") inserted = TRUE; /* Add internal node as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, internal) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree node as child of proxy") internal->top_proxy = hdr->top_proxy; } /* end if */ @@ -163,7 +162,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, FAIL, "unable to remove v2 B-tree internal node from cache") /* Release internal node's disk space */ - if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, dxpl_id, node_ptr->addr, (hsize_t)hdr->node_size) < 0) + if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, node_ptr->addr, (hsize_t)hdr->node_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release file space for v2 B-tree internal node") /* Destroy internal node */ @@ -190,8 +189,8 @@ done: *------------------------------------------------------------------------- */ H5B2_internal_t * -H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, unsigned flags) +H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + uint16_t depth, hbool_t shadow, unsigned flags) { H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *internal = NULL; /* v2 B-tree internal node */ @@ -216,20 +215,20 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.depth = depth; /* Protect the internal node */ - if(NULL == (internal = (H5B2_internal_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, &udata, flags))) + if(NULL == (internal = (H5B2_internal_t *)H5AC_protect(hdr->f, H5AC_BT2_INT, node_ptr->addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree internal node") /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == internal->top_proxy) { /* Add internal node as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, internal) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree internal node as child of proxy") internal->top_proxy = hdr->top_proxy; } /* end if */ /* Shadow the node, if requested */ if(shadow) - if(H5B2__shadow_internal(internal, dxpl_id, node_ptr) < 0) + if(H5B2__shadow_internal(internal, node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, NULL, "unable to shadow internal node") /* Set return value */ @@ -248,7 +247,7 @@ done: } /* end if */ /* Unprotect internal node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree internal node, address = %llu", (unsigned long long)node_ptr->addr) } /* end if */ } /* end if */ @@ -284,9 +283,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, - void *parent, void *udata, H5B2_found_t op, void *op_data) +H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, + H5B2_found_t op, void *op_data) { H5B2_internal_t *internal; /* Pointer to internal node */ unsigned idx = 0; /* Location of record which matches key */ @@ -303,7 +302,7 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(op); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Locate node pointer for child */ @@ -326,17 +325,17 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to find neighboring record */ if(depth > 1) { - if(H5B2__neighbor_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) + if(H5B2__neighbor_internal(hdr, (uint16_t)(depth - 1), &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree internal node") } /* end if */ else { - if(H5B2__neighbor_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) + if(H5B2__neighbor_leaf(hdr, &internal->node_ptrs[idx], neighbor_loc, comp, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to find neighbor record in B-tree leaf node") } /* end else */ done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -357,9 +356,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, - H5B2_nodepos_t curr_pos, void *parent, void *udata) +H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, + void *udata) { H5B2_internal_t *internal = NULL; /* Pointer to internal node */ unsigned internal_flags = H5AC__NO_FLAGS_SET; @@ -376,7 +375,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ @@ -413,35 +412,32 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to redistribute records among children */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec < split_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec < split_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec < split_nrec) || (internal->node_ptrs[idx - 1].node_nrec < split_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__split1(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__split1(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split child node") } /* end else */ } /* end else */ @@ -475,11 +471,11 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to insert node */ if(depth > 1) { - if(H5B2__insert_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) + if(H5B2__insert_internal(hdr, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree internal node") } /* end if */ else { - if(H5B2__insert_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) + if(H5B2__insert_leaf(hdr, &internal->node_ptrs[idx], next_pos, internal, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into B-tree leaf node") } /* end else */ @@ -494,11 +490,11 @@ done: if(internal) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write && (internal_flags & H5AC__DIRTIED_FLAG)) - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal B-tree node") /* Unprotect node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") } /* end if */ @@ -523,7 +519,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, void *op_data) @@ -544,7 +540,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ @@ -591,11 +587,11 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, /* Attempt to update record in child */ if(depth > 1) { - if(H5B2__update_internal(hdr, dxpl_id, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) + if(H5B2__update_internal(hdr, (uint16_t)(depth - 1), &internal_flags, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in internal B-tree node") } /* end if */ else { - if(H5B2__update_leaf(hdr, dxpl_id, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) + if(H5B2__update_leaf(hdr, &internal->node_ptrs[idx], status, next_pos, internal, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update record in leaf B-tree node") } /* end else */ @@ -656,7 +652,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, */ if(could_split) { /* Release the internal B-tree node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") internal = NULL; @@ -666,7 +662,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, } /* end if */ /* Release the internal B-tree node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") internal = NULL; @@ -674,7 +670,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, *status = H5B2_UPDATE_INSERT_DONE; /* Dodge sideways into inserting a record into this node */ - if(H5B2__insert_internal(hdr, dxpl_id, depth, parent_cache_info_flags_ptr, curr_node_ptr, curr_pos, parent, udata) < 0) + if(H5B2__insert_internal(hdr, depth, parent_cache_info_flags_ptr, curr_node_ptr, curr_pos, parent, udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, FAIL, "unable to insert record into internal B-tree node") break; @@ -691,7 +687,7 @@ done: /* Check if we should shadow this node */ if(hdr->swmr_write && (internal_flags & H5AC__DIRTIED_FLAG)) { /* Attempt to shadow the node if doing SWMR writes */ - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal B-tree node") /* Change the state to "shadowed" if only modified currently */ @@ -701,7 +697,7 @@ done: } /* end if */ /* Unprotect node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") } /* end if */ @@ -726,8 +722,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr) +H5B2__shadow_internal(H5B2_internal_t *internal, H5B2_node_ptr_t *curr_node_ptr) { H5B2_hdr_t *hdr; /* B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -758,11 +753,11 @@ H5B2__shadow_internal(H5B2_internal_t *internal, hid_t dxpl_id, * shadowed node. Remove it from cache but do not mark it free on disk. */ /* Allocate space for the cloned node */ - if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move B-tree node") /* Move the location of the node on the disk */ - if(H5AC_move_entry(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, new_node_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_BT2_INT, curr_node_ptr->addr, new_node_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node") curr_node_ptr->addr = new_node_addr; @@ -793,7 +788,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, +H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, void *op_data) @@ -819,7 +814,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") internal_addr = curr_node_ptr->addr; @@ -832,8 +827,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, ((internal->node_ptrs[0].node_nrec + internal->node_ptrs[1].node_nrec) <= ((merge_nrec * 2) + 1))) { /* Merge children of root node */ - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") /* Let the cache know that the object is deleted */ @@ -847,7 +841,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Update flush dependency for child, if using SWMR */ if(hdr->swmr_write) - if(H5B2__update_flush_depend(hdr, dxpl_id, depth, curr_node_ptr, internal, hdr) < 0) + if(H5B2__update_flush_depend(hdr, depth, curr_node_ptr, internal, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") /* Indicate that the level of the B-tree decreased */ @@ -872,7 +866,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node") internal_addr = curr_node_ptr->addr; } /* end if */ @@ -906,35 +900,32 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge3(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ @@ -962,7 +953,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "Can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -985,12 +976,12 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2__remove_internal(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), + if(H5B2__remove_internal(hdr, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, next_pos, new_node_ptr, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2__remove_leaf(hdr, dxpl_id, new_node_ptr, next_pos, new_cache_info, udata, op, op_data) < 0) + if(H5B2__remove_leaf(hdr, new_node_ptr, next_pos, new_cache_info, udata, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1008,7 +999,7 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -1030,11 +1021,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, - H5B2_remove_t op, void *op_data) +H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, + void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data) { H5AC_info_t *new_cache_info; /* Pointer to new cache info */ unsigned *new_cache_info_flags_ptr = NULL; @@ -1057,7 +1047,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") internal_addr = curr_node_ptr->addr; HDassert(internal->nrec == curr_node_ptr->node_nrec); @@ -1073,8 +1063,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(depth == hdr->depth); /* Merge children of root node */ - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, 0) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") /* Let the cache know that the object is deleted */ @@ -1088,7 +1077,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Update flush dependency for child, if using SWMR */ if(hdr->swmr_write) - if(H5B2__update_flush_depend(hdr, dxpl_id, depth, curr_node_ptr, internal, hdr) < 0) + if(H5B2__update_flush_depend(hdr, depth, curr_node_ptr, internal, hdr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "unable to update child node to new parent") /* Indicate that the level of the B-tree decreased */ @@ -1114,7 +1103,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_internal(internal, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_internal(internal, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow internal node") internal_addr = curr_node_ptr->addr; } /* end if */ @@ -1169,35 +1158,32 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, */ if(idx == 0) { /* Left-most child */ if(retries > 0 && (internal->node_ptrs[idx + 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, idx) < 0) + if(H5B2__redistribute2(hdr, depth, internal, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else if(idx == internal->nrec) { /* Right-most child */ if(retries > 0 && (internal->node_ptrs[idx - 1].node_nrec > merge_nrec)) { - if(H5B2__redistribute2(hdr, dxpl_id, depth, internal, (idx - 1)) < 0) + if(H5B2__redistribute2(hdr, depth, internal, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge2(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) + if(H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, (idx - 1)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end if */ else { /* Middle child */ if(retries > 0 && ((internal->node_ptrs[idx + 1].node_nrec > merge_nrec) || (internal->node_ptrs[idx - 1].node_nrec > merge_nrec))) { - if(H5B2__redistribute3(hdr, dxpl_id, depth, internal, &internal_flags, idx) < 0) + if(H5B2__redistribute3(hdr, depth, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTREDISTRIBUTE, FAIL, "unable to redistribute child node records") } /* end if */ else { - if(H5B2__merge3(hdr, dxpl_id, depth, curr_node_ptr, - parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) + if(H5B2__merge3(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, idx) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to merge child node") } /* end else */ } /* end else */ @@ -1253,7 +1239,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Swap record to delete with record from leaf, if we are the last internal node */ if(swap_loc && depth == 1) - if(H5B2__swap_leaf(hdr, dxpl_id, depth, internal, &internal_flags, idx, swap_loc) < 0) + if(H5B2__swap_leaf(hdr, depth, internal, &internal_flags, idx, swap_loc) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSWAP, FAIL, "can't swap records in B-tree") /* Set pointers for advancing to child node */ @@ -1276,12 +1262,12 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* Attempt to remove record from child node */ if(depth > 1) { - if(H5B2__remove_internal_by_idx(hdr, dxpl_id, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), + if(H5B2__remove_internal_by_idx(hdr, depth_decreased, swap_loc, swap_parent, (uint16_t)(depth - 1), new_cache_info, new_cache_info_flags_ptr, new_node_ptr, next_pos, n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree internal node") } /* end if */ else { - if(H5B2__remove_leaf_by_idx(hdr, dxpl_id, new_node_ptr, next_pos, new_cache_info, (unsigned)n, op, op_data) < 0) + if(H5B2__remove_leaf_by_idx(hdr, new_node_ptr, next_pos, new_cache_info, (unsigned)n, op, op_data) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to remove record from B-tree leaf node") } /* end else */ @@ -1299,7 +1285,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, done: /* Release the B-tree internal node */ - if(internal && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) + if(internal && H5AC_unprotect(hdr->f, H5AC_BT2_INT, internal_addr, internal, internal_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release internal B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index d900761..54d40ea 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -57,8 +57,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr); +static herr_t H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr); /*********************/ @@ -95,7 +94,7 @@ H5FL_DEFINE(H5B2_leaf_t); *------------------------------------------------------------------------- */ herr_t -H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, H5B2_node_ptr_t *node_ptr) +H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr) { H5B2_leaf_t *leaf = NULL; /* Pointer to new leaf node created */ hbool_t inserted = FALSE; /* Whether the leaf node was inserted into cache */ @@ -130,17 +129,17 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, H5B2_node_ptr_t leaf->shadow_epoch = hdr->shadow_epoch; /* Allocate space on disk for the leaf */ - if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree leaf node") /* Cache the new B-tree node */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache") inserted = TRUE; /* Add leaf node as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, leaf) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, FAIL, "unable to add v2 B-tree node as child of proxy") leaf->top_proxy = hdr->top_proxy; } /* end if */ @@ -154,7 +153,7 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTREMOVE, FAIL, "unable to remove v2 B-tree leaf node from cache") /* Release leaf node's disk space */ - if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, dxpl_id, node_ptr->addr, (hsize_t)hdr->node_size) < 0) + if(H5F_addr_defined(node_ptr->addr) && H5MF_xfree(hdr->f, H5FD_MEM_BTREE, node_ptr->addr, (hsize_t)hdr->node_size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release file space for v2 B-tree leaf node") /* Destroy leaf node */ @@ -181,8 +180,8 @@ done: *------------------------------------------------------------------------- */ H5B2_leaf_t * -H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, - H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags) +H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, + hbool_t shadow, unsigned flags) { H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *leaf; /* v2 B-tree leaf node */ @@ -205,20 +204,20 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.nrec = node_ptr->node_nrec; /* Protect the leaf node */ - if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, &udata, flags))) + if(NULL == (leaf = (H5B2_leaf_t *)H5AC_protect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, &udata, flags))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, NULL, "unable to protect B-tree leaf node") /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == leaf->top_proxy) { /* Add leaf node as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, leaf) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSET, NULL, "unable to add v2 B-tree leaf node as child of proxy") leaf->top_proxy = hdr->top_proxy; } /* end if */ /* Shadow the node, if requested */ if(shadow) - if(H5B2__shadow_leaf(leaf, dxpl_id, node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, NULL, "unable to shadow leaf node") /* Set return value */ @@ -237,7 +236,7 @@ done: } /* end if */ /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, NULL, "unable to unprotect v2 B-tree leaf node, address = %llu", (unsigned long long)node_ptr->addr) } /* end if */ } /* end if */ @@ -273,7 +272,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, void *op_data) { @@ -291,7 +290,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p HDassert(op); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Locate node pointer for child */ @@ -326,7 +325,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) @@ -347,7 +346,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -364,7 +363,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Must have a leaf node with enough space to insert a record now */ @@ -431,11 +430,11 @@ done: if(leaf) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG)) - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node") /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") } /* end if */ @@ -460,7 +459,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, void *op_data) { @@ -478,7 +477,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ @@ -581,7 +580,7 @@ done: /* Check if we should shadow this node */ if(hdr->swmr_write && (leaf_flags & H5AC__DIRTIED_FLAG)) { /* Attempt to shadow the node if doing SWMR writes */ - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf B-tree node") /* Change the state to "shadowed" if only modified currently */ @@ -591,7 +590,7 @@ done: } /* end if */ /* Unprotect leaf node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") } /* end if */ @@ -615,9 +614,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, - unsigned idx, void *swap_loc) +H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ haddr_t child_addr; /* Address of child node */ @@ -641,7 +639,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_class = H5AC_BT2_INT; /* Lock B-tree child nodes */ - if(NULL == (child_internal = H5B2__protect_internal(hdr, dxpl_id, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (child_internal = H5B2__protect_internal(hdr, internal, &internal->node_ptrs[idx], (uint16_t)(depth - 1), FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") child_addr = internal->node_ptrs[idx].addr; @@ -656,7 +654,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, child_class = H5AC_BT2_LEAF; /* Lock B-tree child node */ - if(NULL == (child_leaf = H5B2__protect_leaf(hdr, dxpl_id, internal, &internal->node_ptrs[idx], FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (child_leaf = H5B2__protect_leaf(hdr, internal, &internal->node_ptrs[idx], FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") child_addr = internal->node_ptrs[idx].addr; @@ -683,7 +681,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, done: /* Unlock child node */ - if(child && H5AC_unprotect(hdr->f, dxpl_id, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0) + if(child && H5AC_unprotect(hdr->f, child_class, child_addr, child, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree child node") FUNC_LEAVE_NOAPI(ret_value) @@ -707,7 +705,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr) +H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr) { H5B2_hdr_t *hdr; /* B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -738,11 +736,11 @@ H5B2__shadow_leaf(H5B2_leaf_t *leaf, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_p * shadowed node. Remove it from cache but do not mark it free on disk. */ /* Allocate space for the cloned node */ - if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size))) + if(HADDR_UNDEF == (new_node_addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, (hsize_t)hdr->node_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "unable to allocate file space to move B-tree node") /* Move the location of the old child on the disk */ - if(H5AC_move_entry(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, new_node_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_BT2_LEAF, curr_node_ptr->addr, new_node_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTMOVE, FAIL, "unable to move B-tree node") curr_node_ptr->addr = new_node_addr; @@ -773,7 +771,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, +H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ @@ -791,7 +789,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") leaf_addr = curr_node_ptr->addr; @@ -833,7 +831,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(leaf->nrec > 0) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node") leaf_addr = curr_node_ptr->addr; } /* end if */ @@ -860,7 +858,7 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -882,9 +880,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - unsigned idx, H5B2_remove_t op, void *op_data) +H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, unsigned idx, H5B2_remove_t op, + void *op_data) { H5B2_leaf_t *leaf; /* Pointer to leaf node */ haddr_t leaf_addr = HADDR_UNDEF; /* Leaf address on disk */ @@ -899,7 +897,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, HDassert(H5F_addr_defined(curr_node_ptr->addr)); /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") leaf_addr = curr_node_ptr->addr; @@ -936,7 +934,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, if(leaf->nrec > 0) { /* Shadow the node if doing SWMR writes */ if(hdr->swmr_write) { - if(H5B2__shadow_leaf(leaf, dxpl_id, curr_node_ptr) < 0) + if(H5B2__shadow_leaf(leaf, curr_node_ptr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTCOPY, FAIL, "unable to shadow leaf node") leaf_addr = curr_node_ptr->addr; } /* end if */ @@ -963,7 +961,7 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, done: /* Release the B-tree leaf node */ - if(leaf && H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) + if(leaf && H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, leaf_addr, leaf, leaf_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release leaf B-tree node") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5B2pkg.h b/src/H5B2pkg.h index e24d2eb..552cebb 100644 --- a/src/H5B2pkg.h +++ b/src/H5B2pkg.h @@ -334,31 +334,29 @@ extern const H5B2_class_t *const H5B2_client_class_g[H5B2_NUM_BTREE_ID]; /* Generic routines */ H5_DLL herr_t H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); -H5_DLL herr_t H5B2__update_flush_depend(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned depth, const H5B2_node_ptr_t *node_ptr, void *old_parent, - void *new_parent); +H5_DLL herr_t H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, + const H5B2_node_ptr_t *node_ptr, void *old_parent, void *new_parent); H5_DLL herr_t H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry); /* Internal node management routines */ -H5_DLL herr_t H5B2__split1(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx); -H5_DLL herr_t H5B2__redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -H5_DLL herr_t H5B2__merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, +H5_DLL herr_t H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); +H5_DLL herr_t H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx); /* Routines for managing B-tree header info */ H5_DLL H5B2_hdr_t *H5B2__hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5B2__hdr_create(H5F_t *f, hid_t dxpl_id, - const H5B2_create_t *cparam, void *ctx_udata); +H5_DLL haddr_t H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata); H5_DLL herr_t H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, uint16_t depth); H5_DLL herr_t H5B2__hdr_incr(H5B2_hdr_t *hdr); @@ -366,29 +364,26 @@ H5_DLL herr_t H5B2__hdr_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr); H5_DLL size_t H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr); H5_DLL herr_t H5B2__hdr_dirty(H5B2_hdr_t *hdr); -H5_DLL H5B2_hdr_t *H5B2__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t hdr_addr, +H5_DLL H5B2_hdr_t *H5B2__hdr_protect(H5F_t *f, haddr_t hdr_addr, void *ctx_udata, unsigned flags); -H5_DLL herr_t H5B2__hdr_unprotect(H5B2_hdr_t *hdr, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5B2__hdr_delete(H5B2_hdr_t *hdr); /* Routines for operating on leaf nodes */ -H5_DLL H5B2_leaf_t * H5B2__protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - void *parent, H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags); -H5_DLL herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, - void *swap_loc); +H5_DLL H5B2_leaf_t * H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, + H5B2_node_ptr_t *node_ptr, hbool_t shadow, unsigned flags); +H5_DLL herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, + unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); /* Routines for operating on internal nodes */ -H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, - unsigned flags); +H5_DLL H5B2_internal_t *H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, + H5B2_node_ptr_t *node_ptr, uint16_t depth, hbool_t shadow, unsigned flags); /* Routines for allocating nodes */ -H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL herr_t H5B2__split_root(H5B2_hdr_t *hdr); +H5_DLL herr_t H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr); -H5_DLL herr_t H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL herr_t H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, uint16_t depth); /* Routines for releasing structures */ @@ -397,74 +392,69 @@ H5_DLL herr_t H5B2__leaf_free(H5B2_leaf_t *l); H5_DLL herr_t H5B2__internal_free(H5B2_internal_t *i); /* Routines for inserting records */ -H5_DLL herr_t H5B2__insert(H5B2_hdr_t *hdr, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata); -H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, void *udata); +H5_DLL herr_t H5B2__insert(H5B2_hdr_t *hdr, void *udata); +H5_DLL herr_t H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata); +H5_DLL herr_t H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata); /* Routines for update records */ -H5_DLL herr_t H5B2__update_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, unsigned *parent_cache_info_flags_ptr, - H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, - void *op_data); -H5_DLL herr_t H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_update_status_t *status, - H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_modify_t op, - void *op_data); +H5_DLL herr_t H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, + void *udata, H5B2_modify_t op, void *op_data); +H5_DLL herr_t H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_update_status_t *status, H5B2_nodepos_t curr_pos, void *parent, + void *udata, H5B2_modify_t op, void *op_data); /* Routines for iterating over nodes/records */ -H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, H5B2_operator_t op, void *op_data); -H5_DLL herr_t H5B2__node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, - hsize_t *op_data); +H5_DLL herr_t H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, + const H5B2_node_ptr_t *curr_node, void *parent, hsize_t *op_data); /* Routines for locating records */ H5_DLL herr_t H5B2__locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx, int *result); -H5_DLL herr_t H5B2__neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, - H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, - void *op_data); -H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + void *neighbor_loc, H5B2_compare_t comp, void *parent, void *udata, + H5B2_found_t op, void *op_data); /* Routines for removing records */ -H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, - hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, - H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, - H5B2_nodepos_t curr_pos, H5B2_node_ptr_t *curr_node_ptr, void *udata, - H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - void *udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, + void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, + unsigned *parent_cache_info_flags_ptr, H5B2_nodepos_t curr_pos, + H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, void *swap_parent, uint16_t depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, hsize_t n, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, - H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_t curr_pos, void *parent, - unsigned idx, H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, + H5B2_nodepos_t curr_pos, void *parent, unsigned idx, H5B2_remove_t op, + void *op_data); /* Routines for deleting nodes */ -H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, uint16_t depth, +H5_DLL herr_t H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, const H5B2_node_ptr_t *curr_node, void *parent, H5B2_remove_t op, void *op_data); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5B2__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t obj_addr); -H5_DLL herr_t H5B2__int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, - haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr); -H5_DLL herr_t H5B2__leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5B2_class_t *type, - haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr); +H5_DLL herr_t H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t obj_addr); +H5_DLL herr_t H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, + haddr_t obj_addr); +H5_DLL herr_t H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr); /* Sanity checking routines */ #ifdef H5B2_DEBUG @@ -478,9 +468,9 @@ H5_DLL herr_t H5B2__assert_leaf2(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf, /* Testing routines */ #ifdef H5B2_TESTING H5_DLL herr_t H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr); -H5_DLL int H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, - void *udata, H5B2_node_info_test_t *ninfo); +H5_DLL int H5B2__get_node_depth_test(H5B2_t *bt2, void *udata); +H5_DLL herr_t H5B2__get_node_info_test(H5B2_t *bt2, void *udata, + H5B2_node_info_test_t *ninfo); #endif /* H5B2_TESTING */ #endif /* _H5B2pkg_H */ diff --git a/src/H5B2private.h b/src/H5B2private.h index e4bbffa..83a5272 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -125,34 +125,31 @@ typedef struct H5B2_t H5B2_t; /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL H5B2_t *H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, +H5_DLL H5B2_t *H5B2_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata); -H5_DLL H5B2_t *H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata); +H5_DLL H5B2_t *H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata); H5_DLL herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr/*out*/); -H5_DLL herr_t H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata); -H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, - void *op_data); -H5_DLL htri_t H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, +H5_DLL herr_t H5B2_insert(H5B2_t *bt2, void *udata); +H5_DLL herr_t H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data); +H5_DLL htri_t H5B2_find(H5B2_t *bt2, void *udata, H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, - hsize_t idx, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, - void *udata, H5B2_found_t op, void *op_data); -H5_DLL herr_t H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_update(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_modify_t op, void *op_data); -H5_DLL herr_t H5B2_remove(H5B2_t *b2, hid_t dxpl_id, void *udata, - H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, - H5_iter_order_t order, hsize_t idx, H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, + H5B2_found_t op, void *op_data); +H5_DLL herr_t H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, + void *op_data); +H5_DLL herr_t H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, + void *op_data); +H5_DLL herr_t H5B2_remove(H5B2_t *b2, void *udata, H5B2_remove_t op, + void *op_data); +H5_DLL herr_t H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, + hsize_t idx, H5B2_remove_t op, void *op_data); H5_DLL herr_t H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec); -H5_DLL herr_t H5B2_size(H5B2_t *bt2, hid_t dxpl_id, - hsize_t *btree_size); -H5_DLL herr_t H5B2_close(H5B2_t *bt2, hid_t dxpl_id); -H5_DLL herr_t H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void *ctx_udata, H5B2_remove_t op, void *op_data); -H5_DLL herr_t H5B2_depend(H5B2_t *bt2, hid_t dxpl_id, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5B2_size(H5B2_t *bt2, hsize_t *btree_size); +H5_DLL herr_t H5B2_close(H5B2_t *bt2); +H5_DLL herr_t H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, + H5B2_remove_t op, void *op_data); +H5_DLL herr_t H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent); H5_DLL herr_t H5B2_patch_file(H5B2_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5B2stat.c b/src/H5B2stat.c index df99ad5..5dd9cc2 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -110,7 +110,7 @@ H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info) *------------------------------------------------------------------------- */ herr_t -H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) +H5B2_size(H5B2_t *bt2, hsize_t *btree_size) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -137,7 +137,7 @@ H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) *btree_size += hdr->node_size; else /* Iterate through nodes */ - if(H5B2__node_size(hdr, dxpl_id, hdr->depth, &hdr->root, hdr, btree_size) < 0) + if(H5B2__node_size(hdr, hdr->depth, &hdr->root, hdr, btree_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTLIST, FAIL, "node iteration failed") } /* end if */ diff --git a/src/H5B2test.c b/src/H5B2test.c index c10e5a8..49fe3af 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -498,7 +498,7 @@ H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) /*------------------------------------------------------------------------- - * Function: H5B2_get_node_info_test + * Function: H5B2__get_node_info_test * * Purpose: Determine information about a node holding a record in the B-tree * @@ -511,8 +511,7 @@ H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) *------------------------------------------------------------------------- */ herr_t -H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, - H5B2_node_info_test_t *ninfo) +H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) { H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ H5B2_node_ptr_t curr_node_ptr; /* Node pointer info for current node */ @@ -522,7 +521,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(bt2); @@ -554,7 +553,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */ /* Lock B-tree current node */ - if(NULL == (internal = H5B2__protect_internal(hdr, dxpl_id, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (internal = H5B2__protect_internal(hdr, parent, &curr_node_ptr, depth, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node") /* Unpin parent if necessary */ @@ -577,7 +576,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, next_node_ptr = internal->node_ptrs[idx]; /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, (unsigned)(hdr->swmr_write ? H5AC__PIN_ENTRY_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Keep track of parent if necessary */ @@ -589,7 +588,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, } /* end if */ else { /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Fill in information about the node */ @@ -608,7 +607,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_leaf_t *leaf; /* Pointer to leaf node in B-tree */ /* Lock B-tree leaf node */ - if(NULL == (leaf = H5B2__protect_leaf(hdr, dxpl_id, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) + if(NULL == (leaf = H5B2__protect_leaf(hdr, parent, &curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Unpin parent if necessary */ @@ -624,7 +623,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, HGOTO_ERROR(H5E_BTREE, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Unlock current node */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") /* Indicate the depth that the record was found */ @@ -644,11 +643,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_info_test() */ +} /* H5B2__get_node_info_test() */ /*------------------------------------------------------------------------- - * Function: H5B2_get_node_depth_test + * Function: H5B2__get_node_depth_test * * Purpose: Determine the depth of a node holding a record in the B-tree * @@ -664,18 +663,18 @@ done: *------------------------------------------------------------------------- */ int -H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) +H5B2__get_node_depth_test(H5B2_t *bt2, void *udata) { H5B2_node_info_test_t ninfo; /* Node information */ int ret_value = -1; /* Return information */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(bt2); /* Get information abou the node */ - if(H5B2_get_node_info_test(bt2, dxpl_id, udata, &ninfo) < 0) + if(H5B2__get_node_info_test(bt2, udata, &ninfo) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "error looking up node info") /* Set return value */ @@ -683,5 +682,5 @@ H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_get_node_depth_test() */ +} /* H5B2__get_node_depth_test() */ diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 3881b44..5cad81b 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -53,7 +53,7 @@ *------------------------------------------------------------------------- */ herr_t -H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, +H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; @@ -90,7 +90,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - if(NULL == (bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree node") /* @@ -149,7 +149,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f } /* end for */ done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + if(bt && H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -172,7 +172,7 @@ done: */ #ifdef H5B_DEBUG herr_t -H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void *udata) +H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ @@ -207,7 +207,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); + bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); HDassert(shared); @@ -217,7 +217,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cur->level = bt->level; head = tail = cur; - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ @@ -228,7 +228,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void * test. */ for(ncell = 0; cur; ncell++) { - bt = (H5B_t *)H5AC_protect(f, dxpl_id, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); + bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); HDassert(bt); /* Check node header */ @@ -268,7 +268,7 @@ H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void } /* end if */ /* Release node */ - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); HDassert(status >= 0); bt = NULL; /* Make certain future references will be caught */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 14dce4f..a451cab 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -86,8 +86,7 @@ H5FL_EXTERN(H5B_t); /******************************/ H5_DLL herr_t H5B__node_dest(H5B_t *bt); #ifdef H5B_DEBUG -herr_t H5B__assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, - void *udata); +herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata); #endif #endif /*_H5Bpkg_H*/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index cb038ec..270b4e6 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -82,8 +82,8 @@ typedef enum H5B_dir_t { } H5B_dir_t; /* Define the operator callback function pointer for H5B_iterate() */ -typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); +typedef int (*H5B_operator_t)(H5F_t *f, const void *_lt_key, haddr_t addr, + const void *_rt_key, void *_udata); /* Each B-tree has certain information that can be shared across all * the instances of nodes in that B-tree. @@ -113,13 +113,13 @@ typedef struct H5B_class_t { H5B_subid_t id; /*id as found in file*/ size_t sizeof_nkey; /*size of native (memory) key*/ H5UC_t * (*get_shared)(const H5F_t*, const void*); /*shared info for node */ - herr_t (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_t*); + herr_t (*new_node)(H5F_t*, H5B_ins_t, void*, void*, void*, haddr_t*); int (*cmp2)(void*, void*, void*); /*compare 2 keys */ int (*cmp3)(void*, void*, void*); /*compare 3 keys */ - htri_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); + htri_t (*found)(H5F_t*, haddr_t, const void*, void*); /* insert new data */ - H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, + H5B_ins_t (*insert)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, void*, hbool_t*, haddr_t*); /* min insert uses min leaf, not new(), similarily for max insert */ @@ -130,8 +130,7 @@ typedef struct H5B_class_t { H5B_dir_t critical_key; /* remove existing data */ - H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, - hbool_t*); + H5B_ins_t (*remove)(H5F_t*, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); /* encode, decode, debug key values */ herr_t (*decode)(const H5B_shared_t*, const uint8_t*, void*); @@ -155,26 +154,25 @@ typedef struct H5B_info_t { /***************************************/ /* Library-private Function Prototypes */ /***************************************/ -H5_DLL herr_t H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - void *udata, haddr_t *addr_p/*out*/); -H5_DLL herr_t H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, H5B_info_t *bt_info, H5B_operator_t op, void *udata); -H5_DLL herr_t H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); -H5_DLL herr_t H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr, void *udata); +H5_DLL herr_t H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, + haddr_t *addr_p/*out*/); +H5_DLL herr_t H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, + H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, + H5B_info_t *bt_info, H5B_operator_t op, void *udata); +H5_DLL herr_t H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); +H5_DLL herr_t H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, + void *udata); H5_DLL H5B_shared_t *H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey); H5_DLL herr_t H5B_shared_free(void *_shared); -H5_DLL herr_t H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, +H5_DLL herr_t H5B_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, const H5B_class_t *type, void *udata); -H5_DLL htri_t H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, - haddr_t addr); +H5_DLL htri_t H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr); #endif /* _H5Bprivate_H */ diff --git a/src/H5C.c b/src/H5C.c index 0d8cc75..729b267 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -81,6 +81,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FLprivate.h" /* Free Lists */ @@ -110,12 +111,18 @@ /* Local Prototypes */ /********************/ -static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted); +static herr_t H5C__pin_entry_from_client(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr); + +static herr_t H5C__unpin_entry_real(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr, hbool_t update_rp); + +static herr_t H5C__unpin_entry_from_client(H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr, hbool_t update_rp); + +static herr_t H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted); static herr_t H5C__autoadjust__ageout(H5F_t * f, - hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, @@ -124,7 +131,6 @@ static herr_t H5C__autoadjust__ageout(H5F_t * f, static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr); static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t dxpl_id, hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr); @@ -136,16 +142,13 @@ static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr); static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, size_t old_entry_size, size_t new_entry_size); -static herr_t H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); +static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags); -static herr_t H5C_flush_invalidate_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags); +static herr_t H5C_flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); -static herr_t H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags); +static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags); static void * H5C_load_entry(H5F_t * f, - hid_t dxpl_id, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -157,9 +160,9 @@ static herr_t H5C__mark_flush_dep_dirty(H5C_cache_entry_t * entry); static herr_t H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry); -static herr_t H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring); -static herr_t H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr); +static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring); +static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, + H5C_cache_entry_t *entry_ptr); static herr_t H5C__verify_len_eoa(H5F_t *f, const H5C_class_t * type, haddr_t addr, size_t *len, hbool_t actual); @@ -729,7 +732,7 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ herr_t -H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) +H5C_prep_for_file_close(H5F_t *f) { H5C_t * cache_ptr; hbool_t image_generated = FALSE; /* Whether a cache image was generated */ @@ -757,7 +760,7 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) HDassert(cache_ptr->pl_len == 0); /* Prepare cache image */ - if(H5C__prep_image_for_file_close(f, dxpl_id, &image_generated) < 0) + if(H5C__prep_image_for_file_close(f, &image_generated) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cache image") #ifdef H5_HAVE_PARALLEL @@ -798,7 +801,7 @@ H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id) * during a flush, and thus avoid any resulting entrie dirties, * deletions, insertion, or moves during the flush. */ - if(H5C__serialize_cache(f, dxpl_id) < 0) + if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialization of the cache failed") } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -816,13 +819,6 @@ done: * This function fails if any object are protected since the * resulting file might not be consistent. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the destroy (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the - * same dxpl_id for both parameters. - * * Note that *cache_ptr has been freed upon successful return. * * Return: Non-negative on success/Negative on failure @@ -833,7 +829,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, hid_t dxpl_id) +H5C_dest(H5F_t * f) { H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ @@ -851,12 +847,12 @@ H5C_dest(H5F_t * f, hid_t dxpl_id) #endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ /* Flush and invalidate all cache entries */ - if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__NO_FLAGS_SET) < 0 ) + if(H5C__flush_invalidate_cache(f, H5C__NO_FLAGS_SET) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") /* Generate & write cache image if requested */ if(cache_ptr->image_ctl.generate_image) - if(H5C__generate_cache_image(f, dxpl_id, cache_ptr) < 0) + if(H5C__generate_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "Can't generate metadata cache image") if(cache_ptr->slist_ptr != NULL) { @@ -899,7 +895,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_evict(H5F_t * f, hid_t dxpl_id) +H5C_evict(H5F_t * f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -909,7 +905,7 @@ H5C_evict(H5F_t * f, hid_t dxpl_id) HDassert(f); /* Flush and invalidate all cache entries except the pinned entries */ - if(H5C_flush_invalidate_cache(f, dxpl_id, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) + if(H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache") done: @@ -932,8 +928,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, unsigned flags) +H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = NULL; @@ -981,7 +976,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't flush entry") done: @@ -1042,7 +1037,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) +H5C_flush_cache(H5F_t *f, unsigned flags) { #if H5C_DO_SANITY_CHECKS int i; @@ -1109,7 +1104,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) cache_ptr->flush_in_progress = TRUE; if(destroy) { - if(H5C_flush_invalidate_cache(f, dxpl_id, flags) < 0) + if(H5C__flush_invalidate_cache(f, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { @@ -1130,14 +1125,14 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) case H5C_RING_RDFSM: /* Settle raw data FSM */ if(!cache_ptr->rdfsm_settled) - if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) + if(H5MF_settle_raw_data_fsm(f, &cache_ptr->rdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") break; case H5C_RING_MDFSM: /* Settle metadata FSM */ if(!cache_ptr->mdfsm_settled) - if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) + if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") break; @@ -1151,7 +1146,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } /* end switch */ } /* end if */ - if(H5C_flush_ring(f, dxpl_id, ring, flags) < 0) + if(H5C__flush_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed") ring++; } /* end while */ @@ -1189,19 +1184,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_to_min_clean(H5F_t * f, - hid_t dxpl_id) +H5C_flush_to_min_clean(H5F_t * f) { H5C_t * cache_ptr; hbool_t write_permitted; -#if 0 /* modified code -- commented out for now */ /* JRM */ - int i; - int flushed_entries_count = 0; - size_t flushed_entries_size = 0; - size_t space_needed = 0; - haddr_t * flushed_entries_list = NULL; - H5C_cache_entry_t * entry_ptr = NULL; -#endif /* JRM */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1224,101 +1210,8 @@ H5C_flush_to_min_clean(H5F_t * f, if(!write_permitted) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache write is not permitted!?!") -#if 1 /* original code */ - if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0) + if(H5C__make_space_in_cache(f, (size_t)0, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C__make_space_in_cache failed") -#else /* modified code -- commented out for now */ - if ( cache_ptr->max_cache_size > cache_ptr->index_size ) { - - if ( ((cache_ptr->max_cache_size - cache_ptr->index_size) + - cache_ptr->cLRU_list_size) >= cache_ptr->min_clean_size ) { - - space_needed = 0; - - } else { - - space_needed = cache_ptr->min_clean_size - - ((cache_ptr->max_cache_size - cache_ptr->index_size) + - cache_ptr->cLRU_list_size); - } - } else { - - if ( cache_ptr->min_clean_size <= cache_ptr->cLRU_list_size ) { - - space_needed = 0; - - } else { - - space_needed = cache_ptr->min_clean_size - - cache_ptr->cLRU_list_size; - } - } - - if ( space_needed > 0 ) { /* we have work to do */ - - HDassert( cache_ptr->slist_len > 0 ); - - /* allocate an array to keep a list of the entries that we - * mark for flush. We need this list to touch up the LRU - * list after the flush. - */ - flushed_entries_list = (haddr_t *)H5MM_malloc(sizeof(haddr_t) * - (size_t)(cache_ptr->slist_len)); - if(flushed_entries_list == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for flushed entries list") - - /* Scan the dirty LRU list from tail forward and mark sufficient - * entries to free up the necessary space. Keep a list of the - * entries marked in the order in which they are encountered. - */ - entry_ptr = cache_ptr->dLRU_tail_ptr; - - while ( ( flushed_entries_size < space_needed ) && - ( flushed_entries_count < cache_ptr->slist_len ) && - ( entry_ptr != NULL ) ) - { - HDassert( ! (entry_ptr->is_protected) ); - HDassert( ! (entry_ptr->is_read_only) ); - HDassert( entry_ptr->ro_ref_count == 0 ); - HDassert( entry_ptr->is_dirty ); - HDassert( entry_ptr->in_slist ); - - entry_ptr->flush_marker = TRUE; - flushed_entries_size += entry_ptr->size; - flushed_entries_list[flushed_entries_count] = entry_ptr->addr; - flushed_entries_count++; - entry_ptr = entry_ptr->aux_prev; - } - - HDassert( flushed_entries_count <= cache_ptr->slist_len ); - HDassert( flushed_entries_size >= space_needed ); - - - /* Flush the marked entries */ - if(H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_flush_cache failed") - - /* Now touch up the LRU list so as to place the flushed entries in - * the order they they would be in if we had flushed them in the - * order we encountered them in. - */ - - i = 0; - while ( i < flushed_entries_count ) - { - H5C__SEARCH_INDEX_NO_STATS(cache_ptr, flushed_entries_list[i], \ - entry_ptr, FAIL) - - /* At present, the above search must always succeed. However, - * that may change. Write the code so we need only remove the - * following assert in that event. - */ - HDassert( entry_ptr != NULL ); - H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS(cache_ptr, entry_ptr, FAIL) - i++; - } - } /* if ( space_needed > 0 ) */ -#endif /* end modified code -- commented out for now */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1332,17 +1225,6 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, - * just use the same dxpl_id for both parameters. - * - * The primary_dxpl_id is the dxpl_id passed to the - * check_write_permitted function if such a function has been - * provided. - * * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure @@ -1354,14 +1236,12 @@ done: */ herr_t H5C_insert_entry(H5F_t * f, - hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, unsigned int flags) { H5C_t *cache_ptr; - H5P_genplist_t *dxpl; H5AC_ring_t ring = H5C_RING_UNDEFINED; hbool_t insert_pinned; hbool_t flush_last; @@ -1404,13 +1284,8 @@ H5C_insert_entry(H5F_t * f, insert_pinned = ( (flags & H5C__PIN_ENTRY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a property list") - /* Get the ring type from the DXPL */ - if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to query ring value") + ring = H5CX_get_ring(); entry_ptr = (H5C_cache_entry_t *)thing; @@ -1515,7 +1390,7 @@ H5C_insert_entry(H5F_t * f, entry_ptr->tag_info = NULL; /* Apply tag to newly inserted entry */ - if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") entry_tagged = TRUE; @@ -1577,7 +1452,7 @@ H5C_insert_entry(H5F_t * f, * no point in worrying about the third. */ - if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0) + if(H5C__make_space_in_cache(f, space_needed, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C__make_space_in_cache failed") } /* end if */ @@ -1606,21 +1481,12 @@ H5C_insert_entry(H5F_t * f, H5C__UPDATE_STATS_FOR_INSERTION(cache_ptr, entry_ptr) #ifdef H5_HAVE_PARALLEL - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { coll_access = (H5P_USER_TRUE == f->coll_md_read ? TRUE : FALSE); - if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) { - H5P_coll_md_read_flag_t prop_value; - - /* Get the property value */ - if(H5P_get(dxpl, H5_COLL_MD_READ_FLAG_NAME, &prop_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't get collective metadata access flag") - coll_access = (H5P_USER_TRUE == prop_value ? TRUE : FALSE); - } /* end if */ + /* If not explicitly disabled, get the cmdr setting from the API context */ + if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) + coll_access = H5CX_get_coll_metadata_read(); } /* end if */ entry_ptr->coll_access = coll_access; @@ -2236,62 +2102,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_pin_entry_from_client() - * - * Purpose: Internal routine to pin a cache entry from a client action. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 3/26/09 - * - * Changes: Added sanity checks to clarify the circumstances under - * which an entry can be pinned. JRM -- 4/27/14 - * - *------------------------------------------------------------------------- - */ -#ifndef NDEBUG -static herr_t -H5C_pin_entry_from_client(H5C_t * cache_ptr, - H5C_cache_entry_t * entry_ptr) -#else -static herr_t -H5C_pin_entry_from_client(H5C_t H5_ATTR_UNUSED * cache_ptr, - H5C_cache_entry_t * entry_ptr) -#endif -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity checks */ - HDassert( cache_ptr ); - HDassert( entry_ptr ); - HDassert( entry_ptr->is_protected ); - - /* Check if the entry is already pinned */ - if(entry_ptr->is_pinned) { - /* Check if the entry was pinned through an explicit pin from a client */ - if(entry_ptr->pinned_from_client) - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry is already pinned") - } /* end if */ - else { - entry_ptr->is_pinned = TRUE; - - H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) - } /* end else */ - - /* Mark that the entry was pinned through an explicit pin from a client */ - entry_ptr->pinned_from_client = TRUE; - -done: - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_pin_entry_from_client() */ - - -/*------------------------------------------------------------------------- * Function: H5C_pin_protected_entry() * * Purpose: Pin a protected cache entry. The entry must be protected @@ -2336,7 +2146,7 @@ H5C_pin_protected_entry(void *thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry isn't protected") /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") done: @@ -2375,7 +2185,6 @@ done: */ void * H5C_protect(H5F_t * f, - hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * udata, @@ -2395,7 +2204,6 @@ H5C_protect(H5F_t * f, size_t empty_space; void * thing; H5C_cache_entry_t * entry_ptr; - H5P_genplist_t * dxpl; /* dataset transfer property list */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2422,33 +2230,23 @@ H5C_protect(H5F_t * f, /* Load the cache image, if requested */ if(cache_ptr->load_image) { cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f, dxpl_id) < 0) + if(H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't load cache image") } /* end if */ read_only = ( (flags & H5C__READ_ONLY_FLAG) != 0 ); flush_last = ( (flags & H5C__FLUSH_LAST_FLAG) != 0 ); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, NULL, "not a property list") - - /* Get the ring type from the DXPL */ - if((H5P_get(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "unable to query ring value") + /* Get the ring type from the API context */ + ring = H5CX_get_ring(); #ifdef H5_HAVE_PARALLEL if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { coll_access = (H5P_USER_TRUE == f->coll_md_read ? TRUE : FALSE); - if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) { - H5P_coll_md_read_flag_t prop_value; - - /* get the property value */ - if(H5P_get(dxpl, H5_COLL_MD_READ_FLAG_NAME, &prop_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "Can't get collective metadata access flag") - coll_access = (H5P_USER_TRUE == prop_value ? TRUE : FALSE); - } /* end if */ + /* If not explicitly disabled, get the cmdr setting from the API context */ + if(!coll_access && H5P_FORCE_FALSE != f->coll_md_read) + coll_access = H5CX_get_coll_metadata_read(); } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -2466,7 +2264,7 @@ H5C_protect(H5F_t * f, * and replaces it with an entry deserialized from the * image of the prefetched entry. */ - if(H5C__deserialize_prefetched_entry(f, dxpl_id, cache_ptr, &entry_ptr, type, addr, udata) < 0) + if(H5C__deserialize_prefetched_entry(f, cache_ptr, &entry_ptr, type, addr, udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't deserialize prefetched entry") HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); @@ -2507,7 +2305,7 @@ H5C_protect(H5F_t * f, HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ if(0 == mpi_rank) - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't generate entry's image") } /* end if */ HDassert(entry_ptr->image_ptr); @@ -2533,14 +2331,13 @@ H5C_protect(H5F_t * f, haddr_t tag; /* Tag value */ /* The entry is already in the cache, but make sure that the tag value - being passed in via dxpl is still legal. This will ensure that had + is still legal. This will ensure that had the entry NOT been in the cache, tagging was still set up correctly and it would have received a legal tag value after getting loaded from disk. */ - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to query property value") + /* Get the tag */ + tag = H5CX_get_tag(); if(H5C_verify_tag(entry_ptr->type->id, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed") @@ -2557,7 +2354,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - if(NULL == (thing = H5C_load_entry(f, dxpl_id, + if(NULL == (thing = H5C_load_entry(f, #ifdef H5_HAVE_PARALLEL coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -2574,7 +2371,7 @@ H5C_protect(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ /* Apply tag to newly protected entry */ - if(H5C__tag_entry(cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, NULL, "Cannot tag metadata entry") /* If the entry is very large, and we are configured to allow it, @@ -2655,7 +2452,7 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - if(H5C__make_space_in_cache(f, dxpl_id, space_needed, write_permitted) < 0 ) + if(H5C__make_space_in_cache(f, space_needed, write_permitted) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } /* end if */ @@ -2752,7 +2549,7 @@ H5C_protect(H5F_t * f, if(cache_ptr->resize_enabled && (cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length)) { - if(H5C__auto_adjust_cache_size(f, dxpl_id, write_permitted) < 0) + if(H5C__auto_adjust_cache_size(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Cache auto-resize failed") } /* end if */ @@ -2781,7 +2578,7 @@ H5C_protect(H5F_t * f, if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; - if(H5C__make_space_in_cache(f, dxpl_id, (size_t)0, write_permitted) < 0 ) + if(H5C__make_space_in_cache(f, (size_t)0, write_permitted) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C__make_space_in_cache failed") } } /* end if */ @@ -3108,60 +2905,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_unpin_entry_from_client() - * - * Purpose: Internal routine to unpin a cache entry from a client action. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * 3/24/09 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5C_unpin_entry_from_client(H5C_t * cache_ptr, - H5C_cache_entry_t * entry_ptr, - hbool_t update_rp) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Sanity checking */ - HDassert( cache_ptr ); - HDassert( entry_ptr ); - - /* Error checking (should be sanity checks?) */ - if(!entry_ptr->is_pinned) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Entry isn't pinned") - if(!entry_ptr->pinned_from_client) - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Entry wasn't pinned by cache client") - - /* Check if the entry is not pinned from a flush dependency */ - if(!entry_ptr->pinned_from_cache) { - /* If requested, update the replacement policy if the entry is not protected */ - if(update_rp && !entry_ptr->is_protected) - H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL) - - /* Unpin the entry now */ - entry_ptr->is_pinned = FALSE; - - /* Update the stats for an unpin operation */ - H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) - } /* end if */ - - /* Mark the entry as explicitly unpinned by the client */ - entry_ptr->pinned_from_client = FALSE; - -done: - - FUNC_LEAVE_NOAPI(ret_value) - -} /* H5C_unpin_entry_from_client() */ - - -/*------------------------------------------------------------------------- * Function: H5C_unpin_entry() * * Purpose: Unpin a cache entry. The entry can be either protected or @@ -3201,7 +2944,7 @@ H5C_unpin_entry(void *_entry_ptr) /* Unpin the entry */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry from client") done: @@ -3242,11 +2985,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t * f, - hid_t dxpl_id, - haddr_t addr, - void * thing, - unsigned int flags) +H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) { H5C_t * cache_ptr; hbool_t deleted; @@ -3323,11 +3062,11 @@ H5C_unprotect(H5F_t * f, /* Pin or unpin the entry as requested. */ if(pin_entry) { /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if(unpin_entry) { /* Unpin the entry from a client */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") } /* end if */ } else { @@ -3419,11 +3158,11 @@ H5C_unprotect(H5F_t * f, /* Pin or unpin the entry as requested. */ if(pin_entry) { /* Pin the entry from a client */ - if(H5C_pin_entry_from_client(cache_ptr, entry_ptr) < 0) + if(H5C__pin_entry_from_client(cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Can't pin entry by client") } else if(unpin_entry) { /* Unpin the entry from a client */ - if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) + if(H5C__unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client") } /* end if */ @@ -3475,7 +3214,7 @@ H5C_unprotect(H5F_t * f, flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; HDassert(((!was_clean) || dirtied) == entry_ptr->in_slist); - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") } /* end if */ #ifdef H5_HAVE_PARALLEL @@ -3488,7 +3227,7 @@ H5C_unprotect(H5F_t * f, else if(test_entry_ptr != entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?") - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") } /* end else if */ #endif /* H5_HAVE_PARALLEL */ @@ -4019,17 +3758,9 @@ H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) HDassert(parent_entry->pinned_from_cache); /* Check if we should unpin parent entry now */ - if(!parent_entry->pinned_from_client) { - /* Update the replacement policy if the entry is not protected */ - if(!parent_entry->is_protected) - H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, parent_entry, FAIL) - - /* Unpin the entry now */ - parent_entry->is_pinned = FALSE; - - /* Update the stats for an unpin operation */ - H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, parent_entry) - } /* end if */ + if(!parent_entry->pinned_from_client) + if(H5C__unpin_entry_real(cache_ptr, parent_entry, TRUE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry") /* Mark the entry as unpinned from the cache's action */ parent_entry->pinned_from_cache = FALSE; @@ -4081,6 +3812,138 @@ done: /**************************** Private Functions: *************************/ /*************************************************************************/ + +/*------------------------------------------------------------------------- + * Function: H5C__pin_entry_from_client() + * + * Purpose: Internal routine to pin a cache entry from a client action. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/26/09 + * + *------------------------------------------------------------------------- + */ +#if H5C_COLLECT_CACHE_STATS +static herr_t +H5C__pin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) +#else +static herr_t +H5C__pin_entry_from_client(H5C_t H5_ATTR_UNUSED *cache_ptr, H5C_cache_entry_t *entry_ptr) +#endif +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(entry_ptr); + HDassert(entry_ptr->is_protected); + + /* Check if the entry is already pinned */ + if(entry_ptr->is_pinned) { + /* Check if the entry was pinned through an explicit pin from a client */ + if(entry_ptr->pinned_from_client) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "entry is already pinned") + } /* end if */ + else { + entry_ptr->is_pinned = TRUE; + + H5C__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) + } /* end else */ + + /* Mark that the entry was pinned through an explicit pin from a client */ + entry_ptr->pinned_from_client = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__pin_entry_from_client() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__unpin_entry_real() + * + * Purpose: Internal routine to unpin a cache entry. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 1/6/18 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, + hbool_t update_rp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checking */ + HDassert(cache_ptr); + HDassert(entry_ptr); + HDassert(entry_ptr->is_pinned); + + /* If requested, update the replacement policy if the entry is not protected */ + if(update_rp && !entry_ptr->is_protected) + H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL) + + /* Unpin the entry now */ + entry_ptr->is_pinned = FALSE; + + /* Update the stats for an unpin operation */ + H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__unpin_entry_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5C__unpin_entry_from_client() + * + * Purpose: Internal routine to unpin a cache entry from a client action. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * 3/24/09 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, + hbool_t update_rp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity checking */ + HDassert(cache_ptr); + HDassert(entry_ptr); + + /* Error checking (should be sanity checks?) */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "entry isn't pinned") + if(!entry_ptr->pinned_from_client) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "entry wasn't pinned by cache client") + + /* Check if the entry is not pinned from a flush dependency */ + if(!entry_ptr->pinned_from_cache) + if(H5C__unpin_entry_real(cache_ptr, entry_ptr, update_rp) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry") + + /* Mark the entry as explicitly unpinned by the client */ + entry_ptr->pinned_from_client = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C__unpin_entry_from_client() */ + /*------------------------------------------------------------------------- * * Function: H5C__auto_adjust_cache_size @@ -4102,9 +3965,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__auto_adjust_cache_size(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted) +H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; hbool_t reentrant_call = FALSE; @@ -4297,7 +4158,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, if(!cache_ptr->size_decrease_possible) status = decrease_disabled; else { - if(H5C__autoadjust__ageout(f, dxpl_id, hit_rate, &status, &new_max_cache_size, write_permitted) < 0) + if(H5C__autoadjust__ageout(f, hit_rate, &status, &new_max_cache_size, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "ageout code failed") } /* end else */ } /* end if */ @@ -4427,7 +4288,6 @@ done: */ static herr_t H5C__autoadjust__ageout(H5F_t * f, - hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, @@ -4463,7 +4323,7 @@ H5C__autoadjust__ageout(H5F_t * f, if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size ){ /* evict aged out cache entries if appropriate... */ - if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) + if(H5C__autoadjust__ageout__evict_aged_out_entries(f, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries") /* ... and then reduce cache size if appropriate */ @@ -4634,16 +4494,6 @@ done: * will be re-calculated, and will be enforced the next time * we have to make space in the cache. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used depending on the value of - * *first_flush_ptr. The idea is to use the primary_dxpl_id - * on the first write in a sequence of writes, and to use - * the secondary_dxpl_id on all subsequent writes. - * - * This is useful in the metadata cache, but may not be - * needed elsewhere. If so, just use the same dxpl_id for - * both parameters. - * * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure. @@ -4653,9 +4503,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t dxpl_id, - hbool_t write_permitted) +H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; size_t eviction_size_limit; @@ -4728,7 +4576,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if(cache_ptr->entries_removed_counter > 1 || cache_ptr->last_entry_removed_ptr == prev_ptr) @@ -4739,7 +4587,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, bytes_evicted += entry_ptr->size; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } /* end else-if */ else { @@ -4811,7 +4659,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, prev_ptr = entry_ptr->prev; if(!(entry_ptr->is_dirty) && !(entry_ptr->prefetched_dirty)) - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush clean entry") /* just skip the entry if it is dirty, as we can't do @@ -5210,7 +5058,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_invalidate_cache + * Function: H5C__flush_invalidate_cache * * Purpose: Flush and destroy the entries contained in the target * cache. @@ -5233,11 +5081,6 @@ done: * until either the cache is empty, or the number of pinned * entries stops decreasing on each pass. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). - * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * @@ -5247,13 +5090,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) +H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) { H5C_t * cache_ptr; H5C_ring_t ring; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(f); HDassert(f->shared); @@ -5308,7 +5151,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - if(H5C_flush_invalidate_ring(f, dxpl_id, ring, flags) < 0) + if(H5C_flush_invalidate_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; } /* end while */ @@ -5352,7 +5195,7 @@ H5C_flush_invalidate_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_invalidate_cache() */ +} /* H5C__flush_invalidate_cache() */ /*------------------------------------------------------------------------- @@ -5392,8 +5235,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, - unsigned flags) +H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) { H5C_t *cache_ptr; hbool_t restart_slist_scan; @@ -5594,7 +5436,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, protected_entries++; } /* end if */ else if(entry_ptr->is_pinned) { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed") if(cache_ptr->slist_changed) { @@ -5611,7 +5453,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, } /* end if */ } /* end else-if */ else { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) + if(H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") if(cache_ptr->slist_changed) { @@ -5715,7 +5557,7 @@ H5C_flush_invalidate_ring(H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, */ cache_ptr->entry_watched_for_removal = next_entry_ptr; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) + if(H5C__flush_single_entry(f, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed") /* Restart the index list scan if necessary. Must @@ -5807,7 +5649,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5C_flush_ring + * Function: H5C__flush_ring * * Purpose: Flush the entries contained in the specified cache and * ring. All entries in rings outside the specified ring @@ -5830,8 +5672,8 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) +static herr_t +H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; hbool_t flushed_entries_last_pass; @@ -5850,7 +5692,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) int i; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -6026,7 +5868,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) protected_entries++; } /* end if */ else { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) + if(H5C__flush_single_entry(f, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry") if(cache_ptr->slist_changed) { @@ -6068,7 +5910,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5C_flush_ring() */ +} /* H5C__flush_ring() */ /*------------------------------------------------------------------------- @@ -6105,8 +5947,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, - unsigned flags) +H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) { H5C_t * cache_ptr; /* Cache for file */ hbool_t destroy; /* external flag */ @@ -6240,7 +6081,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, HDassert(!entry_ptr->prefetched); /* Generate the entry's image */ - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") } /* end if ( ! (entry_ptr->image_up_to_date) ) */ } /* end if */ @@ -6288,12 +6129,8 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, else mem_type = entry_ptr->type->mem_type; - if(H5F_block_write(f, mem_type, entry_ptr->addr, - entry_ptr->size, dxpl_id, - entry_ptr->image_ptr) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Can't write image to file") + if(H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file") #ifdef H5_HAVE_PARALLEL } #endif /* H5_HAVE_PARALLEL */ @@ -6478,7 +6315,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, * the entry occupies */ if(free_file_space) { - size_t fsf_size; + hsize_t fsf_size; /* Sanity checks */ HDassert(H5F_addr_defined(entry_ptr->addr)); @@ -6505,7 +6342,7 @@ H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, fsf_size = entry_ptr->size; /* Release the space on disk */ - if(H5MF_xfree(f, entry_ptr->type->mem_type, dxpl_id, entry_ptr->addr, (hsize_t)fsf_size) < 0) + if(H5MF_xfree(f, entry_ptr->type->mem_type, entry_ptr->addr, fsf_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to free file space for cache entry") } /* end if ( free_file_space ) */ @@ -6681,7 +6518,6 @@ done: */ static void * H5C_load_entry(H5F_t * f, - hid_t dxpl_id, #ifdef H5_HAVE_PARALLEL hbool_t coll_access, #endif /* H5_HAVE_PARALLEL */ @@ -6781,7 +6617,7 @@ H5C_load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL if(!coll_access || 0 == mpi_rank) { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_read(f, type->mem_type, addr, len, dxpl_id, image) < 0) + if(H5F_block_read(f, type->mem_type, addr, len, image) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*") #ifdef H5_HAVE_PARALLEL } /* end if */ @@ -6828,7 +6664,7 @@ H5C_load_entry(H5F_t * f, /* If the thing's image needs to be bigger for a speculatively * loaded thing, go get the on-disk image again (the extra portion). */ - if(H5F_block_read(f, type->mem_type, addr + len, actual_len - len, dxpl_id, image + len) < 0) + if(H5F_block_read(f, type->mem_type, addr + len, actual_len - len, image + len) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't read image") #ifdef H5_HAVE_PARALLEL } @@ -7031,8 +6867,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, - hbool_t write_permitted) +H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS @@ -7146,7 +6981,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if ( ( cache_ptr->entries_removed_counter > 1 ) || @@ -7163,7 +6998,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, cache_ptr->entries_scanned_to_make_space++; #endif /* H5C_COLLECT_CACHE_STATS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(f, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } else { /* We have enough space so don't flush clean entry. */ @@ -7317,13 +7152,9 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed, && ( ! (entry_ptr->coll_access) ) #endif /* H5_HAVE_PARALLEL */ ) { - - if ( H5C__flush_single_entry(f, dxpl_id, entry_ptr, - H5C__FLUSH_INVALIDATE_FLAG | - H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to flush entry") + if(H5C__flush_single_entry(f, entry_ptr, + H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } /* end if */ @@ -7808,7 +7639,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) *------------------------------------------------------------------------- */ herr_t -H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id) +H5C__flush_marked_entries(H5F_t * f) { herr_t ret_value = SUCCEED; @@ -7818,7 +7649,7 @@ H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id) HDassert(f != NULL); /* Flush all marked entries */ - if(H5C_flush_cache(f, dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) + if(H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") done: @@ -8199,7 +8030,7 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, *------------------------------------------------------------------------- */ herr_t -H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) +H5C__serialize_cache(H5F_t *f) { #if H5C_DO_SANITY_CHECKS int i; @@ -8299,14 +8130,14 @@ H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) case H5C_RING_RDFSM: /* Settle raw data FSM */ if(!cache_ptr->rdfsm_settled) - if(H5MF_settle_raw_data_fsm(f, dxpl_id, &cache_ptr->rdfsm_settled) < 0) + if(H5MF_settle_raw_data_fsm(f, &cache_ptr->rdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") break; case H5C_RING_MDFSM: /* Settle metadata FSM */ if(!cache_ptr->mdfsm_settled) - if(H5MF_settle_meta_data_fsm(f, dxpl_id, &cache_ptr->mdfsm_settled) < 0) + if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") break; @@ -8319,7 +8150,7 @@ H5C__serialize_cache(H5F_t *f, hid_t dxpl_id) break; } /* end switch */ - if(H5C__serialize_ring(f, dxpl_id, ring) < 0) + if(H5C__serialize_ring(f, ring) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "serialize ring failed") ring++; @@ -8379,7 +8210,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) +H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) { hbool_t done = FALSE; H5C_t * cache_ptr; @@ -8510,7 +8341,7 @@ H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) HDassert(entry_ptr->serialization_count == 0); /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") HDassert(entry_ptr->flush_dep_nunser_children == 0); @@ -8575,7 +8406,7 @@ H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring) HDassert(entry_ptr->flush_dep_nunser_children == 0); /* Serialize the entry */ - if(H5C__serialize_single_entry(f, dxpl_id, cache_ptr, entry_ptr) < 0) + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") /* Check for the cache changing */ @@ -8621,8 +8452,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr) +H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -8658,7 +8488,7 @@ H5C__serialize_single_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, } /* end if */ /* Generate image for entry */ - if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) + if(H5C__generate_image(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "Can't generate image for cache entry") /* Reset the flush_in progress flag */ @@ -8693,8 +8523,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, - hid_t dxpl_id) +H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { haddr_t new_addr = HADDR_UNDEF; haddr_t old_addr = HADDR_UNDEF; @@ -8720,7 +8549,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Call client's pre-serialize callback, if there's one */ if(entry_ptr->type->pre_serialize && - (entry_ptr->type->pre_serialize)(f, dxpl_id, (void *)entry_ptr, + (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry") diff --git a/src/H5CX.c b/src/H5CX.c new file mode 100644 index 0000000..3bf732b --- /dev/null +++ b/src/H5CX.c @@ -0,0 +1,3308 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Monday, February 19, 2018 + * + * Purpose: + * Keep a set of "psuedo-global" information for an API call. This + * general corresponds to the DXPL for the call, along with cached + * information from them. + */ + +/****************/ +/* Module Setup */ +/****************/ + +#include "H5CXmodule.h" /* This source code file is part of the H5CX module */ + + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ + + +/****************/ +/* Local Macros */ +/****************/ + +#ifdef H5_HAVE_THREADSAFE +/* + * The per-thread API context. pthread_once() initializes a special + * key that will be used by all threads to create a stack specific to + * each thread individually. The association of contexts to threads will + * be handled by the pthread library. + * + * In order for this macro to work, H5E_get_my_stack() must be preceeded + * by "H5CX_node_t *ctx =". + */ +#define H5CX_get_my_context() H5CX__get_context() +#else /* H5_HAVE_THREADSAFE */ +/* + * The current API context. + */ +#define H5CX_get_my_context() (H5CX_head_g) +#endif /* H5_HAVE_THREADSAFE */ + + +/******************/ +/* Local Typedefs */ +/******************/ + +/* Context stored for each I/O-related API call */ +typedef struct H5CX_t { + /* DXPL */ + hid_t dxpl_id; /* DXPL ID for API operation */ + H5P_genplist_t *dxpl; /* Dataset Transfer Property List */ + + /* LAPL */ + hid_t lapl_id; /* LAPL ID for API operation */ + H5P_genplist_t *lapl; /* Link Access Property List */ + + /* Object tagging info */ + haddr_t tag; /* Current object's tag (ohdr chunk #0 address) */ + + /* Metadata cache info */ + H5AC_ring_t ring; /* Current metadata cache ring for entries*/ + +#ifdef H5_HAVE_PARALLEL + /* Parallel I/O settings */ + hbool_t coll_metadata_read; /* Whether to use collective I/O for metadata read */ + MPI_Datatype btype; /* MPI datatype for buffer, when using collective I/O */ + MPI_Datatype ftype; /* MPI datatype for file, when using collective I/O */ +#endif /* H5_HAVE_PARALLEL */ + + /* Cached DXPL properties */ + size_t max_temp_buf; /* Maximum temporary buffer size */ + hbool_t max_temp_buf_valid; /* Whether maximum temporary buffer size is valid */ + void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ + hbool_t tconv_buf_valid; /* Whether temporary conversion buffer is valid */ + void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ + hbool_t bkgr_buf_valid; /* Whether background conversion buffer is valid */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ + hbool_t bkgr_buf_type_valid;/* Whether background buffer type is valid */ + double btree_split_ratio[3]; /* B-tree split ratios */ + hbool_t btree_split_ratio_valid; /* Whether B-tree split ratios are valid */ + size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ + hbool_t vec_size_valid; /* Whether hyperslab vector is valid */ +#ifdef H5_HAVE_PARALLEL + H5FD_mpio_xfer_t io_xfer_mode; /* Parallel transfer mode for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + hbool_t io_xfer_mode_valid; /* Whether parallel transfer mode is valid */ + H5FD_mpio_collective_opt_t mpio_coll_opt; /* Parallel transfer with independent IO or collective IO with this mode (H5D_XFER_MPIO_COLLECTIVE_OPT_NAME) */ + hbool_t mpio_coll_opt_valid; /* Whether parallel transfer option is valid */ + H5FD_mpio_chunk_opt_t mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ + hbool_t mpio_chunk_opt_mode_valid; /* Whether collective chunk option is valid */ + unsigned mpio_chunk_opt_num; /* Collective chunk thrreshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ + hbool_t mpio_chunk_opt_num_valid; /* Whether collective chunk threshold is valid */ + unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ + hbool_t mpio_chunk_opt_ratio_valid; /* Whether collective chunk ratio is valid */ +#endif /* H5_HAVE_PARALLEL */ + H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ + hbool_t err_detect_valid; /* Whether error detection info is valid */ + H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ + hbool_t filter_cb_valid; /* Whether filter callback function is valid */ + H5Z_data_xform_t *data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ + hbool_t data_transform_valid; /* Whether data transform info is valid */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL datatype alloc info (H5D_XFER_VLEN_*_NAME) */ + hbool_t vl_alloc_info_valid; /* Whether VL datatype alloc info is valid */ + hbool_t dcr_flag; /* Direct chunk read flag (H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME) */ + hbool_t dcr_flag_valid; /* Whether direct chunk read flag is valid */ + hsize_t *dcr_offset; /* Direct chunk read offset (H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME) */ + hbool_t dcr_offset_valid; /* Whether direct chunk read offset is valid */ + hbool_t dcw_flag; /* Direct chunk write flag (H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME) */ + hbool_t dcw_flag_valid; /* Whether direct chunk write flag is valid */ + uint32_t dcw_filters; /* Direct chunk write filter flags (H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME) */ + hbool_t dcw_filters_valid; /* Whether direct chunk write filter flags is valid */ + hsize_t *dcw_offset; /* Direct chunk write offset (H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME) */ + hbool_t dcw_offset_valid; /* Whether direct chunk write offset is valid */ + uint32_t dcw_datasize; /* Direct chunk write data size (H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME) */ + hbool_t dcw_datasize_valid; /* Whether direct chunk write data size is valid */ + H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ + hbool_t dt_conv_cb_valid; /* Whether datatype conversion struct is valid */ + + /* Set DXPL properties to return to application */ + uint32_t dcr_filters; /* Direct chunk read filter flags (H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME) */ + hbool_t dcr_filters_set; /* Whether direct chunk read filter flags are set */ +#ifdef H5_HAVE_PARALLEL + H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt; /* Chunk optimization mode used for parallel I/O (H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME) */ + hbool_t mpio_actual_chunk_opt_set; /* Whether chunk optimization mode used for parallel I/O is set */ + H5D_mpio_actual_io_mode_t mpio_actual_io_mode; /* Actual I/O mode used for parallel I/O (H5D_MPIO_ACTUAL_IO_MODE_NAME) */ + hbool_t mpio_actual_io_mode_set; /* Whether actual I/O mode used for parallel I/O is set */ + uint32_t mpio_local_no_coll_cause; /* Local reason for breaking collective I/O (H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME) */ + hbool_t mpio_local_no_coll_cause_set; /* Whether local reason for breaking collective I/O is set */ + hbool_t mpio_local_no_coll_cause_valid; /* Whether local reason for breaking collective I/O is valid */ + uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ + hbool_t mpio_global_no_coll_cause_set; /* Whether global reason for breaking collective I/O is set */ + hbool_t mpio_global_no_coll_cause_valid; /* Whether global reason for breaking collective I/O is valid */ + int mpio_coll_chunk_link_hard; /* Instrumented "collective chunk link hard" value (H5D_XFER_COLL_CHUNK_LINK_HARD_NAME) */ + hbool_t mpio_coll_chunk_link_hard_set; /* Whether instrumented "collective chunk link hard" value is set */ + int mpio_coll_chunk_multi_hard; /* Instrumented "collective chunk multi hard" value (H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME) */ + hbool_t mpio_coll_chunk_multi_hard_set; /* Whether instrumented "collective chunk multi hard" value is set */ + int mpio_coll_chunk_link_num_true; /* Instrumented "collective chunk link num true" value (H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME) */ + hbool_t mpio_coll_chunk_link_num_true_set; /* Whether instrumented "collective chunk link num true" value is set */ + int mpio_coll_chunk_link_num_false; /* Instrumented "collective chunk link num false" value (H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME) */ + hbool_t mpio_coll_chunk_link_num_false_set; /* Whether instrumented "collective chunk link num false" value is set */ + int mpio_coll_chunk_multi_ratio_coll; /* Instrumented "collective chunk multi ratio coll" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME) */ + hbool_t mpio_coll_chunk_multi_ratio_coll_set; /* Whether instrumented "collective chunk multi ratio coll" value is set */ + int mpio_coll_chunk_multi_ratio_ind; /* Instrumented "collective chunk multi ratio ind" value (H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME) */ + hbool_t mpio_coll_chunk_multi_ratio_ind_set; /* Whether instrumented "collective chunk multi ratio ind" value is set */ +#endif /* H5_HAVE_PARALLEL */ + + /* Cached LAPL properties */ + size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ + hbool_t nlinks_valid; /* Whether number of soft / UD links to traverse is valid */ +} H5CX_t; + +/* Typedef for nodes on the API context stack */ +typedef struct H5CX_node_t { + H5CX_t ctx; /* Context for current API call */ + struct H5CX_node_t *next; /* Pointer to previous context, on stack */ +} H5CX_node_t; + +/* Typedef for cached default dataset transfer property list information */ +typedef struct H5CX_dxpl_cache_t { + size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ + void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ + void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ + double btree_split_ratio[3]; /* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */ + size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ +#ifdef H5_HAVE_PARALLEL + H5FD_mpio_xfer_t io_xfer_mode; /* Parallel transfer mode for this request (H5D_XFER_IO_XFER_MODE_NAME) */ + H5FD_mpio_collective_opt_t mpio_coll_opt; /* Parallel transfer with independent IO or collective IO with this mode (H5D_XFER_MPIO_COLLECTIVE_OPT_NAME) */ + uint32_t mpio_local_no_coll_cause; /* Local reason for breaking collective I/O (H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME) */ + uint32_t mpio_global_no_coll_cause; /* Global reason for breaking collective I/O (H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME) */ + H5FD_mpio_chunk_opt_t mpio_chunk_opt_mode; /* Collective chunk option (H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME) */ + unsigned mpio_chunk_opt_num; /* Collective chunk thrreshold (H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME) */ + unsigned mpio_chunk_opt_ratio; /* Collective chunk ratio (H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME) */ +#endif /* H5_HAVE_PARALLEL */ + H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ + H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ + H5Z_data_xform_t *data_transform; /* Data transform info (H5D_XFER_XFORM_NAME) */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL datatype alloc info (H5D_XFER_VLEN_*_NAME) */ + hbool_t dcr_flag; /* Direct chunk read flag (H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME) */ + hsize_t *dcr_offset; /* Direct chunk read offset (H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME) */ + hbool_t dcw_flag; /* Direct chunk write flag (H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME) */ + uint32_t dcw_datasize; /* Direct chunk write data size (H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME) */ + hsize_t *dcw_offset; /* Direct chunk write offset (H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME) */ + uint32_t dcw_filters; /* Direct chunk write filter flags (H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME) */ + H5T_conv_cb_t dt_conv_cb; /* Datatype conversion struct (H5D_XFER_CONV_CB_NAME) */ +} H5CX_dxpl_cache_t; + +/* Typedef for cached default link access property list information */ +typedef struct H5CX_lapl_cache_t { + size_t nlinks; /* Number of soft / UD links to traverse (H5L_ACS_NLINKS_NAME) */ +} H5CX_lapl_cache_t; + + +/********************/ +/* Local Prototypes */ +/********************/ +static H5CX_node_t **H5CX__get_context(void); +static void H5CX__push_common(H5CX_node_t *cnode); +static H5CX_node_t *H5CX__pop_common(void); + + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Package initialization variable */ +hbool_t H5_PKG_INIT_VAR = FALSE; + + +/*******************/ +/* Local Variables */ +/*******************/ + +#ifndef H5_HAVE_THREADSAFE +static H5CX_node_t **H5CX_head_g = NULL; /* Pointer to head of context stack */ +#endif /* H5_HAVE_THREADSAFE */ + +/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ +static H5CX_dxpl_cache_t H5CX_def_dxpl_cache; + +/* Define a "default" link access property list cache structure to use for default LAPLs */ +static H5CX_lapl_cache_t H5CX_def_lapl_cache; + +/* Declare a static free list to manage H5CX_node_t structs */ +H5FL_DEFINE_STATIC(H5CX_node_t); + + + +/*-------------------------------------------------------------------------- +NAME + H5CX__init_package -- Initialize interface-specific information +USAGE + herr_t H5CX__init_package() +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. +--------------------------------------------------------------------------*/ +herr_t +H5CX__init_package(void) +{ + H5P_genplist_t *dx_plist; /* Data transfer property list */ + H5P_genplist_t *la_plist; /* Link access property list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + +#ifndef H5_HAVE_THREADSAFE + /* Allocate the context stack head pointer */ + if(NULL = (H5CX_head_g = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)))) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "can't allocate pointer to head of context stack") + *H5CX_head_g = NULL; +#endif /* H5_HAVE_THREADSAFE */ + + /* Reset the "default DXPL cache" information */ + HDmemset(&H5CX_def_dxpl_cache, 0, sizeof(H5CX_dxpl_cache_t)); + + /* Get the default DXPL cache information */ + + /* Get the default dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(H5P_DATASET_XFER_DEFAULT))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Get B-tree split ratios */ + if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &H5CX_def_dxpl_cache.btree_split_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") + + /* Get maximum temporary buffer size value */ + if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &H5CX_def_dxpl_cache.max_temp_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") + + /* Get temporary buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &H5CX_def_dxpl_cache.tconv_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") + + /* Get background buffer pointer */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &H5CX_def_dxpl_cache.bkgr_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") + + /* Get background buffer type */ + if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &H5CX_def_dxpl_cache.bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") + + /* Get I/O vector size */ + if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &H5CX_def_dxpl_cache.vec_size) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") + +#ifdef H5_HAVE_PARALLEL + /* Collect Parallel I/O information for possible later use */ + if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &H5CX_def_dxpl_cache.io_xfer_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + if(H5P_get(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &H5CX_def_dxpl_cache.mpio_coll_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization option") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_num) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization threshold") + if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &H5CX_def_dxpl_cache.mpio_chunk_opt_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization ratio") + + /* Get the local & global reasons for breaking collective I/O values */ + if(H5P_get(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &H5CX_def_dxpl_cache.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve local cause for breaking collective I/O") + if(H5P_get(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &H5CX_def_dxpl_cache.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve global cause for breaking collective I/O") +#endif /* H5_HAVE_PARALLEL */ + + /* Get error detection properties */ + if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &H5CX_def_dxpl_cache.err_detect) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve error detection info") + + /* Get filter callback function */ + if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &H5CX_def_dxpl_cache.filter_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") + + /* Look at the data transform property */ + /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need + * to copy it and free this in the H5CX terminate routine. -QAK) + */ + if(H5P_peek(dx_plist, H5D_XFER_XFORM_NAME, &H5CX_def_dxpl_cache.data_transform) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve data transform info") + + /* Get VL datatype alloc info */ + if(H5P_get(dx_plist, H5D_XFER_VLEN_ALLOC_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.alloc_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_ALLOC_INFO_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.alloc_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_FREE_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.free_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get(dx_plist, H5D_XFER_VLEN_FREE_INFO_NAME, &H5CX_def_dxpl_cache.vl_alloc_info.free_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + + /* Get direct chunk read info */ + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &H5CX_def_dxpl_cache.dcr_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read flag") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &H5CX_def_dxpl_cache.dcr_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read offset") + + /* Get direct chunk write info */ + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &H5CX_def_dxpl_cache.dcw_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write flag") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &H5CX_def_dxpl_cache.dcw_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write filter mask") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &H5CX_def_dxpl_cache.dcw_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write offset") + if(H5P_get(dx_plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &H5CX_def_dxpl_cache.dcw_datasize) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write data size") + + /* Get datatype conversion struct */ + if(H5P_get(dx_plist, H5D_XFER_CONV_CB_NAME, &H5CX_def_dxpl_cache.dt_conv_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback") + + + /* Reset the "default LAPL cache" information */ + HDmemset(&H5CX_def_lapl_cache, 0, sizeof(H5CX_lapl_cache_t)); + + /* Get the default LAPL cache information */ + + /* Get the default link access property list */ + if(NULL == (la_plist = (H5P_genplist_t *)H5I_object(H5P_LINK_ACCESS_DEFAULT))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not a link access property list") + + /* Get number of soft / UD links to traverse */ + if(H5P_get(la_plist, H5L_ACS_NLINKS_NAME, &H5CX_def_lapl_cache.nlinks) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX__init_package() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_term_package + * + * Purpose: Terminate this interface. + * + * Return: Success: Positive if anything was done that might + * affect other interfaces; zero otherwise. + * Failure: Negative. + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +int +H5CX_term_package(void) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_PKG_INIT_VAR) { +#ifndef H5_HAVE_THREADSAFE + /* Release pointer to head of API context stack */ + HDfree(H5CX_head_g); + H5CX_head_g = NULL; +#endif /* H5_HAVE_THREADSAFE */ + + H5_PKG_INIT_VAR = FALSE; + } /* end if */ + + FUNC_LEAVE_NOAPI(0) +} /* end H5CX_term_package() */ + + +#ifdef H5_HAVE_THREADSAFE +/*------------------------------------------------------------------------- + * Function: H5CX__get_context + * + * Purpose: Support function for H5CX_get_my_context() to initialize and + * acquire per-thread API context stack. + * + * Return: Success: Non-NULL pointer to head pointer of API context stack for thread + * Failure: NULL + * + * Programmer: Quincey Koziol + * March 12, 2018 + * + *------------------------------------------------------------------------- + */ +static H5CX_node_t ** +H5CX__get_context(void) +{ + H5CX_node_t **ctx = NULL; + + FUNC_ENTER_STATIC_NOERR + + ctx = (H5CX_node_t **)H5TS_get_thread_local_value(H5TS_apictx_key_g); + + if(!ctx) { + /* No associated value with current thread - create one */ +#ifdef H5_HAVE_WIN_THREADS + /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ + ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); +#else + /* Use HDmalloc here since this has to match the HDfree in the + * destructor and we want to avoid the codestack there. + */ + ctx = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)); +#endif /* H5_HAVE_WIN_THREADS */ + HDassert(ctx); + + /* Reset the thread-specific info */ + *ctx = NULL; + + /* (It's not necessary to release this in this API, it is + * released by the "key destructor" set up in the H5TS + * routines. See calls to pthread_key_create() in H5TS.c -QAK) + */ + H5TS_set_thread_local_value(H5TS_apictx_key_g, (void *)ctx); + } /* end if */ + + /* Set return value */ + FUNC_LEAVE_NOAPI(ctx) +} /* end H5CX__get_context() */ +#endif /* H5_HAVE_THREADSAFE */ + + +/*------------------------------------------------------------------------- + * Function: H5CX__push_common + * + * Purpose: Internal routine to push a context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +static void +H5CX__push_common(H5CX_node_t *cnode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity check */ + HDassert(cnode); + + /* Set non-zero context info */ + cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT; + cnode->ctx.lapl_id = H5P_LINK_ACCESS_DEFAULT; + cnode->ctx.tag = H5AC__INVALID_TAG; + cnode->ctx.ring = H5AC_RING_USER; + + /* Push context node onto stack */ + cnode->next = *head; + *head = cnode; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX__push_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_push + * + * Purpose: Pushes a context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_push(void) +{ + H5CX_node_t *cnode = NULL; /* Context node */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Allocate & clear API context node */ + if(NULL == (cnode = H5FL_CALLOC(H5CX_node_t))) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTALLOC, FAIL, "unable to allocate new struct") + + /* Set context info */ + H5CX__push_common(cnode); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_push() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_push_special + * + * Purpose: Pushes a context for an API call, without using library routines. + * + * Note: This should only be called in special circumstances, like H5close. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_push_special(void) +{ + H5CX_node_t *cnode; /* Context node */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Allocate & clear API context node, without using library API routines */ + cnode = (H5CX_node_t *)HDcalloc(1, sizeof(H5CX_node_t)); + HDassert(cnode); + + /* Set context info */ + H5CX__push_common(cnode); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_push_special() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_is_def_dxpl + * + * Purpose: Checks if the API context is using the library's default DXPL + * + * Return: TRUE / FALSE (can't fail) + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5CX_is_def_dxpl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT); +} /* end H5CX_is_def_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_dxpl + * + * Purpose: Sets the DXPL for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_dxpl(hid_t dxpl_id) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(*head); + + /* Set the API context's DXPL to a new value */ + (*head)->ctx.dxpl_id = dxpl_id; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_lapl + * + * Purpose: Sets the LAPL for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_lapl(hid_t lapl_id) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context's LAPL to a new value */ + (*head)->ctx.lapl_id = lapl_id; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_lapl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_apl + * + * Purpose: Validaties an access property list, and sanity checking & + * setting up collective operations. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, + hid_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + loc_id, hbool_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + is_collective) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(acspl_id); + HDassert(libclass); + HDassert(head && *head); + + /* Set access plist to the default property list of the appropriate class if it's the generic default */ + if(H5P_DEFAULT == *acspl_id) + *acspl_id = *libclass->def_plist_id; + else { + htri_t is_lapl; /* Whether the access property list is (or is derived from) a link access property list */ + +#ifdef H5_DEBUG_BUILD + /* Sanity check the access property list class */ + if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "not the required access property list") +#endif /* H5_DEBUG_BUILD */ + + /* Check for link access property and set API context if so */ + if((is_lapl = H5P_class_isa(*libclass->pclass, *H5P_CLS_LACC->pclass)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't check for link access class") + else if(is_lapl) + (*head)->ctx.lapl_id = *acspl_id; + +#ifdef H5_HAVE_PARALLEL + /* If this routine is not guaranteed to be collective (i.e. it doesn't + * modify the structural metadata in a file), check if we should use + * a collective metadata read. + */ + if(!is_collective) { + H5P_genplist_t *plist; /* Property list pointer */ + H5P_coll_md_read_flag_t md_coll_read; /* Collective metadata read flag */ + + /* Get the plist structure for the access property list */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get the collective metadata read flag */ + if(H5P_peek(plist, H5_COLL_MD_READ_FLAG_NAME, &md_coll_read) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't get core collective metadata read flag") + + /* If collective metadata read requested, set collective metadata read flag */ + if(H5P_USER_TRUE == md_coll_read) + is_collective = TRUE; + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + } /* end else */ + +#ifdef H5_HAVE_PARALLEL + /* Check for collective operation */ + if(is_collective) { + /* Set collective metadata read flag */ + (*head)->ctx.coll_metadata_read = TRUE; + + /* If parallel is enabled and the file driver used is the MPI-IO + * VFD, issue an MPI barrier for easier debugging if the API function + * calling this is supposed to be called collectively. Note that this + * happens only when the environment variable H5_COLL_BARRIER is set + * to non 0. + */ + if(H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; /* File communicator */ + + /* Retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, *acspl_id, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_apl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_loc + * + * Purpose: Sanity checks and sets up collective operations. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_loc(hid_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + loc_id, hbool_t +#ifndef H5_HAVE_PARALLEL + H5_ATTR_UNUSED +#endif /* H5_HAVE_PARALLEL */ + is_collective) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + +#ifdef H5_HAVE_PARALLEL + /* Check for collective operation */ + if(is_collective) { + /* Set collective metadata read flag */ + (*head)->ctx.coll_metadata_read = TRUE; + + /* If parallel is enabled and the file driver used is the MPI-IO + * VFD, issue an MPI barrier for easier debugging if the API function + * calling this is supposed to be called collectively. Note that this + * happens only when the environment variable H5_COLL_BARRIER is set + * to non 0. + */ + if(H5_coll_api_sanity_check_g) { + MPI_Comm mpi_comm; /* File communicator */ + + /* Retrieve the MPI communicator from the loc_id or the fapl_id */ + if(H5F_mpi_retrieve_comm(loc_id, H5P_DEFAULT, &mpi_comm) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + + /* issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dxpl + * + * Purpose: Retrieves the DXPL ID for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +hid_t +H5CX_get_dxpl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.dxpl_id) +} /* end H5CX_get_dxpl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_lapl + * + * Purpose: Retrieves the LAPL ID for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +hid_t +H5CX_get_lapl(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.lapl_id) +} /* end H5CX_get_lapl() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_tag + * + * Purpose: Retrieves the object tag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +haddr_t +H5CX_get_tag(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.tag) +} /* end H5CX_get_tag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_ring + * + * Purpose: Retrieves the metadata cache ring for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +H5AC_ring_t +H5CX_get_ring(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.ring) +} /* end H5CX_get_ring() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_get_coll_metadata_read + * + * Purpose: Retrieves the "do collective metadata reads" flag for the current API call context. + * + * Return: TRUE / FALSE on success / + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5CX_get_coll_metadata_read(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + FUNC_LEAVE_NOAPI((*head)->ctx.coll_metadata_read) +} /* end H5CX_get_coll_metadata_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpi_coll_datatypes + * + * Purpose: Retrieves the MPI datatypes for collective I/O for the current API call context. + * + * Note: This is only a shallow copy, the datatypes are not duplicated. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(btype); + HDassert(ftype); + HDassert(head && *head); + + /* Set the API context values */ + *btype = (*head)->ctx.btype; + *ftype = (*head)->ctx.ftype; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpi_coll_datatypes() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_btree_split_ratios + * + * Purpose: Retrieves the B-tree split ratios for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_btree_split_ratios(double split_ratio[3]) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(split_ratio); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.btree_split_ratio_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + HDmemcpy((*head)->ctx.btree_split_ratio, &H5CX_def_dxpl_cache.btree_split_ratio, sizeof(H5CX_def_dxpl_cache.btree_split_ratio)); + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get B-tree split ratios */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BTREE_SPLIT_RATIO_NAME, (*head)->ctx.btree_split_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios") + } /* end else */ + + /* Mark the B-tree split ratio values as valid */ + (*head)->ctx.btree_split_ratio_valid = TRUE; + } /* end if */ + + /* Get the B-tree split ratio values */ + HDmemcpy(split_ratio, &(*head)->ctx.btree_split_ratio, sizeof((*head)->ctx.btree_split_ratio)); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_btree_split_ratios() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_max_temp_buf + * + * Purpose: Retrieves the maximum temporary buffer size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_max_temp_buf(size_t *max_temp_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(max_temp_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.max_temp_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.max_temp_buf = H5CX_def_dxpl_cache.max_temp_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get maximum temporary buffer size value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MAX_TEMP_BUF_NAME, &(*head)->ctx.max_temp_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.max_temp_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *max_temp_buf = (*head)->ctx.max_temp_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_max_temp_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_tconv_buf + * + * Purpose: Retrieves the temporary buffer pointer for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_tconv_buf(void **tconv_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(tconv_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.tconv_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.tconv_buf = H5CX_def_dxpl_cache.tconv_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get temporary conversion buffer pointer value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_TCONV_BUF_NAME, &(*head)->ctx.tconv_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.tconv_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *tconv_buf = (*head)->ctx.tconv_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_tconv_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_bkgr_buf + * + * Purpose: Retrieves the background buffer pointer for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_bkgr_buf(void **bkgr_buf) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(bkgr_buf); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.bkgr_buf_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.bkgr_buf = H5CX_def_dxpl_cache.bkgr_buf; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get background conversion buffer pointer value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_NAME, &(*head)->ctx.bkgr_buf) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.bkgr_buf_valid = TRUE; + } /* end if */ + + /* Get the value */ + *bkgr_buf = (*head)->ctx.bkgr_buf; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_bkgr_buf() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_bkgr_buf_type + * + * Purpose: Retrieves the background buffer type for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(bkgr_buf_type); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.bkgr_buf_type_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.bkgr_buf_type = H5CX_def_dxpl_cache.bkgr_buf_type; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get background buffer type value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_BKGR_BUF_TYPE_NAME, &(*head)->ctx.bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.bkgr_buf_type_valid = TRUE; + } /* end if */ + + /* Get the value */ + *bkgr_buf_type = (*head)->ctx.bkgr_buf_type; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_bkgr_buf_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_vec_size + * + * Purpose: Retrieves the hyperslab vector size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_vec_size(size_t *vec_size) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(vec_size); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.vec_size_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.vec_size = H5CX_def_dxpl_cache.vec_size; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get hyperslab vector size value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &(*head)->ctx.vec_size) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.vec_size_valid = TRUE; + } /* end if */ + + /* Get the value */ + *vec_size = (*head)->ctx.vec_size; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_vec_size() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_get_io_xfer_mode + * + * Purpose: Retrieves the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 25, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(io_xfer_mode); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.io_xfer_mode_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.io_xfer_mode = H5CX_def_dxpl_cache.io_xfer_mode; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get parallel transfer mode value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_IO_XFER_MODE_NAME, &(*head)->ctx.io_xfer_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.io_xfer_mode_valid = TRUE; + } /* end if */ + + /* Get the value */ + *io_xfer_mode = (*head)->ctx.io_xfer_mode; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_io_xfer_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_coll_opt + * + * Purpose: Retrieves the collective / independent parallel I/O option for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_coll_opt); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.mpio_coll_opt_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_coll_opt = H5CX_def_dxpl_cache.mpio_coll_opt; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get collective I/O option value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &(*head)->ctx.mpio_coll_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_coll_opt_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_coll_opt = (*head)->ctx.mpio_coll_opt; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_coll_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_local_no_coll_cause + * + * Purpose: Retrieves the local cause for breaking collective I/O for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_local_no_coll_cause); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!((*head)->ctx.mpio_local_no_coll_cause_valid || (*head)->ctx.mpio_local_no_coll_cause_set)) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_local_no_coll_cause = H5CX_def_dxpl_cache.mpio_local_no_coll_cause; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve local cause for breaking collective I/O") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_local_no_coll_cause_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_local_no_coll_cause = (*head)->ctx.mpio_local_no_coll_cause; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_local_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_global_no_coll_cause + * + * Purpose: Retrieves the global cause for breaking collective I/O for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_global_no_coll_cause); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!((*head)->ctx.mpio_global_no_coll_cause_valid || (*head)->ctx.mpio_global_no_coll_cause_set)) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_global_no_coll_cause = H5CX_def_dxpl_cache.mpio_global_no_coll_cause; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve global cause for breaking collective I/O") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_global_no_coll_cause_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_global_no_coll_cause = (*head)->ctx.mpio_global_no_coll_cause; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_global_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_mode + * + * Purpose: Retrieves the collective chunk optimization mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_mode); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_mode_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_mode = H5CX_def_dxpl_cache.mpio_chunk_opt_mode; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &(*head)->ctx.mpio_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization option") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_mode_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_mode = (*head)->ctx.mpio_chunk_opt_mode; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_num + * + * Purpose: Retrieves the collective chunk optimization threshold for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_num); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_num_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_num = H5CX_def_dxpl_cache.mpio_chunk_opt_num; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &(*head)->ctx.mpio_chunk_opt_num) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization threshold") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_num_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_num = (*head)->ctx.mpio_chunk_opt_num; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_num() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_mpio_chunk_opt_ratio + * + * Purpose: Retrieves the collective chunk optimization ratio for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(mpio_chunk_opt_ratio); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved or set already */ + if(!(*head)->ctx.mpio_chunk_opt_ratio_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.mpio_chunk_opt_ratio = H5CX_def_dxpl_cache.mpio_chunk_opt_ratio; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get the value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &(*head)->ctx.mpio_chunk_opt_ratio) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve chunk optimization ratio") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.mpio_chunk_opt_ratio_valid = TRUE; + } /* end if */ + + /* Get the value */ + *mpio_chunk_opt_ratio = (*head)->ctx.mpio_chunk_opt_ratio; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_mpio_chunk_opt_ratio() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_err_detect + * + * Purpose: Retrieves the error detection info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_err_detect(H5Z_EDC_t *err_detect) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(err_detect); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.err_detect_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.err_detect = H5CX_def_dxpl_cache.err_detect; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get error detection info value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_EDC_NAME, &(*head)->ctx.err_detect) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve error detection info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.err_detect_valid = TRUE; + } /* end if */ + + /* Get the value */ + *err_detect = (*head)->ctx.err_detect; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_err_detect() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_filter_cb + * + * Purpose: Retrieves the I/O filter callback function for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_filter_cb(H5Z_cb_t *filter_cb) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(filter_cb); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.filter_cb_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.filter_cb = H5CX_def_dxpl_cache.filter_cb; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get I/O filter callback function value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_FILTER_CB_NAME, &(*head)->ctx.filter_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.filter_cb_valid = TRUE; + } /* end if */ + + /* Get the value */ + *filter_cb = (*head)->ctx.filter_cb; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_filter_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_data_transform + * + * Purpose: Retrieves the I/O filter callback function for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_data_transform(H5Z_data_xform_t **data_transform) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(data_transform); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.data_transform_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.data_transform = H5CX_def_dxpl_cache.data_transform; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get data transform info value */ + /* (Note: 'peek', not 'get' - if this turns out to be a problem, we may need + * to copy it and free this in the H5CX pop routine. -QAK) + */ + if(H5P_peek((*head)->ctx.dxpl, H5D_XFER_XFORM_NAME, &(*head)->ctx.data_transform) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve data transform info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.data_transform_valid = TRUE; + } /* end if */ + + /* Get the value */ + *data_transform = (*head)->ctx.data_transform; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_data_transform() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_vlen_alloc_info + * + * Purpose: Retrieves the VL datatype alloc info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 5, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(vl_alloc_info); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.vl_alloc_info_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.vl_alloc_info = H5CX_def_dxpl_cache.vl_alloc_info; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get VL datatype alloc info values */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_ALLOC_NAME, &(*head)->ctx.vl_alloc_info.alloc_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_ALLOC_INFO_NAME, &(*head)->ctx.vl_alloc_info.alloc_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_FREE_NAME, &(*head)->ctx.vl_alloc_info.free_func) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_VLEN_FREE_INFO_NAME, &(*head)->ctx.vl_alloc_info.free_info) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve VL datatype alloc info") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.vl_alloc_info_valid = TRUE; + } /* end if */ + + /* Get the value */ + *vl_alloc_info = (*head)->ctx.vl_alloc_info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_vlen_alloc_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcr_flag + * + * Purpose: Retrieves the direct chunk read flag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcr_flag(hbool_t *dcr_flag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcr_flag); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcr_flag_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcr_flag = H5CX_def_dxpl_cache.dcr_flag; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk read flag */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &(*head)->ctx.dcr_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read flag") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcr_flag_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcr_flag = (*head)->ctx.dcr_flag; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcr_flag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcr_offset + * + * Purpose: Retrieves the direct chunk read offset for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcr_offset(hsize_t **dcr_offset) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcr_offset); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcr_offset_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcr_offset = H5CX_def_dxpl_cache.dcr_offset; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk read offset */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &(*head)->ctx.dcr_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk read offset") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcr_offset_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcr_offset = (*head)->ctx.dcr_offset; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcr_offset() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_flag + * + * Purpose: Retrieves the direct chunk write flag for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_flag(hbool_t *dcw_flag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_flag); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_flag_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_flag = H5CX_def_dxpl_cache.dcw_flag; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write flag */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &(*head)->ctx.dcw_flag) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write flag") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_flag_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_flag = (*head)->ctx.dcw_flag; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_flag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_filters + * + * Purpose: Retrieves the direct chunk write filter mask for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_filters(uint32_t *dcw_filters) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_filters); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_filters_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_filters = H5CX_def_dxpl_cache.dcw_filters; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write filter mask */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &(*head)->ctx.dcw_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write filters") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_filters_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_filters = (*head)->ctx.dcw_filters; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_filters() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_offset + * + * Purpose: Retrieves the direct chunk write offset for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_offset(hsize_t **dcw_offset) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_offset); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_offset_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_offset = H5CX_def_dxpl_cache.dcw_offset; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write offset */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &(*head)->ctx.dcw_offset) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write offset") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_offset_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_offset = (*head)->ctx.dcw_offset; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_offset() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dcw_datasize + * + * Purpose: Retrieves the direct chunk write data size for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dcw_datasize(uint32_t *dcw_datasize) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dcw_datasize); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dcw_datasize_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dcw_datasize = H5CX_def_dxpl_cache.dcw_datasize; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get direct chunk write data size */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &(*head)->ctx.dcw_datasize) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve direct chunk write datasize") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dcw_datasize_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dcw_datasize = (*head)->ctx.dcw_datasize; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dcw_datasize() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_dt_conv_cb + * + * Purpose: Retrieves the datatype conversion exception callback for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 8, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_dt_conv_cb(H5T_conv_cb_t *dt_conv_cb) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dt_conv_cb); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.dt_conv_cb_valid) { + /* Check for default DXPL */ + if((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT) + (*head)->ctx.dt_conv_cb = H5CX_def_dxpl_cache.dt_conv_cb; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + /* Get value */ + if(H5P_get((*head)->ctx.dxpl, H5D_XFER_CONV_CB_NAME, &(*head)->ctx.dt_conv_cb) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve datatype conversion exception callback") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.dt_conv_cb_valid = TRUE; + } /* end if */ + + /* Get the value */ + *dt_conv_cb = (*head)->ctx.dt_conv_cb; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_dt_conv_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_get_nlinks + * + * Purpose: Retrieves the # of soft / UD links to traverse for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_get_nlinks(size_t *nlinks) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(nlinks); + HDassert(head && *head); + HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + + /* Check if the value has been retrieved already */ + if(!(*head)->ctx.nlinks_valid) { + /* Check for default LAPL */ + if((*head)->ctx.lapl_id == H5P_LINK_ACCESS_DEFAULT) + (*head)->ctx.nlinks = H5CX_def_lapl_cache.nlinks; + else { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.lapl) + /* Get the link access property list pointer */ + if(NULL == ((*head)->ctx.lapl = (H5P_genplist_t *)H5I_object((*head)->ctx.lapl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default link access property list") + + /* Get value */ + if(H5P_get((*head)->ctx.lapl, H5L_ACS_NLINKS_NAME, &(*head)->ctx.nlinks) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "Can't retrieve number of soft / UD links to traverse") + } /* end else */ + + /* Mark the value as valid */ + (*head)->ctx.nlinks_valid = TRUE; + } /* end if */ + + /* Get the value */ + *nlinks = (*head)->ctx.nlinks; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_get_nlinks() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_tag + * + * Purpose: Sets the object tag for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_tag(haddr_t tag) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.tag = tag; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_tag() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_ring + * + * Purpose: Sets the metadata cache ring for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 20, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_ring(H5AC_ring_t ring) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.ring = ring; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_ring() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_set_coll_metadata_read + * + * Purpose: Sets the "do collective metadata reads" flag for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 23, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_coll_metadata_read(hbool_t cmdr) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(head && *head); + + (*head)->ctx.coll_metadata_read = cmdr; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_coll_metadata_read() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpi_coll_datatypes + * + * Purpose: Sets the MPI datatypes for collective I/O for the current API call context. + * + * Note: This is only a shallow copy, the datatypes are not duplicated. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context values */ + (*head)->ctx.btype = btype; + (*head)->ctx.ftype = ftype; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_mpi_coll_datatypes() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_io_xfer_mode + * + * Purpose: Sets the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.io_xfer_mode = io_xfer_mode; + + /* Mark the value as valid */ + (*head)->ctx.io_xfer_mode_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_io_xfer_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_coll_opt + * + * Purpose: Sets the parallel transfer mode for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 26, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.mpio_coll_opt = mpio_coll_opt; + + /* Mark the value as valid */ + (*head)->ctx.mpio_coll_opt_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_mpio_coll_opt() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_vlen_alloc_info + * + * Purpose: Sets the VL datatype alloc info for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, + void *alloc_info, H5MM_free_t free_func, void *free_info) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.vl_alloc_info.alloc_func = alloc_func; + (*head)->ctx.vl_alloc_info.alloc_info = alloc_info; + (*head)->ctx.vl_alloc_info.free_func = free_func; + (*head)->ctx.vl_alloc_info.free_info = free_info; + + /* Mark the value as valid */ + (*head)->ctx.vl_alloc_info_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_vlen_alloc_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_nlinks + * + * Purpose: Sets the # of soft / UD links to traverse for the current API call context. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 10, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_set_nlinks(size_t nlinks) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(head && *head); + + /* Set the API context value */ + (*head)->ctx.nlinks = nlinks; + + /* Mark the value as valid */ + (*head)->ctx.nlinks_valid = TRUE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_set_nlinks() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_dcr_filters + * + * Purpose: Sets the direct chunk read filter flags for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_dcr_filters(uint32_t direct_filters) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the filter mask for later, marking it to set in DXPL when context popped */ + (*head)->ctx.dcr_filters = direct_filters; + (*head)->ctx.dcr_filters_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_dcr_filters() */ + +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_actual_chunk_opt + * + * Purpose: Sets the actual chunk optimization used for parallel I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chunk_opt) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_actual_chunk_opt = mpio_actual_chunk_opt; + (*head)->ctx.mpio_actual_chunk_opt_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_actual_chunk_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_actual_io_mode + * + * Purpose: Sets the actual I/O mode used for parallel I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_actual_io_mode = mpio_actual_io_mode; + (*head)->ctx.mpio_actual_io_mode_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_actual_chunk_opt() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_local_no_coll_cause + * + * Purpose: Sets the local reason for breaking collective I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_local_no_coll_cause = mpio_local_no_coll_cause; + (*head)->ctx.mpio_local_no_coll_cause_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_local_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_set_mpio_global_no_coll_cause + * + * Purpose: Sets the global reason for breaking collective I/O for the current API call context. + * + * Return: + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_global_no_coll_cause = mpio_global_no_coll_cause; + (*head)->ctx.mpio_global_no_coll_cause_set = TRUE; + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_set_mpio_global_no_coll_cause() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_hard + * + * Purpose: Sets the instrumented "collective chunk link hard" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_hard_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_hard = mpio_coll_chunk_link_hard; + (*head)->ctx.mpio_coll_chunk_link_hard_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_hard() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_hard + * + * Purpose: Sets the instrumented "collective chunk multi hard" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_hard_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_hard = mpio_coll_chunk_multi_hard; + (*head)->ctx.mpio_coll_chunk_multi_hard_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_hard() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_num_true + * + * Purpose: Sets the instrumented "collective chunk link num tru" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_num_true_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_num_true_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_num_true = mpio_coll_chunk_link_num_true; + (*head)->ctx.mpio_coll_chunk_link_num_true_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_num_true() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_link_num_false + * + * Purpose: Sets the instrumented "collective chunk link num false" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_link_num_false_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_link_num_false_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_link_num_false = mpio_coll_chunk_link_num_false; + (*head)->ctx.mpio_coll_chunk_link_num_false_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_link_num_false() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_ratio_coll + * + * Purpose: Sets the instrumented "collective chunk multi ratio coll" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_ratio_coll = mpio_coll_chunk_multi_ratio_coll; + (*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_coll() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_test_set_mpio_coll_chunk_multi_ratio_ind + * + * Purpose: Sets the instrumented "collective chunk multi ratio ind" value for the current API call context. + * + * Note: Only sets value if property set in DXPL + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + htri_t check_prop = 0; /* Whether the property exists in the API context's DXPL */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(head && *head); + HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || + (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + + /* Check if property exists in DXPL */ + if(!(*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, FAIL, "can't get default dataset transfer property list") + + if((check_prop = H5P_exist_plist((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME)) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error checking for property") + } /* end if */ + + /* If property was already set or exists (for first set), update it */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set || check_prop > 0) { + /* Cache the value for later, marking it to set in DXPL when context popped */ + (*head)->ctx.mpio_coll_chunk_multi_ratio_ind = mpio_coll_chunk_multi_ratio_ind; + (*head)->ctx.mpio_coll_chunk_multi_ratio_ind_set = TRUE; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_test_set_mpio_coll_chunk_multi_ratio_ind() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- + * Function: H5CX__pop_common + * + * Purpose: Common code for popping the context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * March 6, 2018 + * + *------------------------------------------------------------------------- + */ +static H5CX_node_t * +H5CX__pop_common(void) +{ + H5CX_node_t **head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + H5CX_node_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_STATIC + + /* Sanity check */ + HDassert(head && *head); + + /* Check for cached DXPL properties to return to application */ + if((*head)->ctx.dcr_filters_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the chunk filter mask property */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &(*head)->ctx.dcr_filters) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting filter mask xfer property") + } /* end if */ +#ifdef H5_HAVE_PARALLEL + if((*head)->ctx.mpio_actual_chunk_opt_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the actual chunk optimization mode for parallel I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &(*head)->ctx.mpio_actual_chunk_opt) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual chunk optimization mode for parallel I/O") + } /* end if */ + if((*head)->ctx.mpio_actual_io_mode_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the actual chunk optimization mode for parallel I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_ACTUAL_IO_MODE_NAME, &(*head)->ctx.mpio_actual_io_mode) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting actual I/O mode for parallel I/O") + } /* end if */ + if((*head)->ctx.mpio_local_no_coll_cause_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the local reason for breaking collective I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_local_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting local reason for breaking collective I/O") + } /* end if */ + if((*head)->ctx.mpio_global_no_coll_cause_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the global reason for breaking collective I/O */ + if(H5P_set((*head)->ctx.dxpl, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &(*head)->ctx.mpio_global_no_coll_cause) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting global reason for breaking collective I/O") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk link hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_link_hard) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link hard value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_multi_hard_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &(*head)->ctx.mpio_coll_chunk_multi_hard) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi hard value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_num_true_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_true) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num true value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_link_num_false_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi hard" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &(*head)->ctx.mpio_coll_chunk_link_num_false) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk link num false value") + } /* end if */ + if((*head)->ctx.mpio_coll_chunk_multi_ratio_coll_set) { + /* Check if the property list is already available */ + if(NULL == (*head)->ctx.dxpl) + /* Get the dataset transfer property list pointer */ + if(NULL == ((*head)->ctx.dxpl = (H5P_genplist_t *)H5I_object((*head)->ctx.dxpl_id))) + HGOTO_ERROR(H5E_CONTEXT, H5E_BADTYPE, NULL, "can't get default dataset transfer property list") + + /* Set the instrumented "collective chunk multi ratio coll" value */ + if(H5P_set((*head)->ctx.dxpl, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &(*head)->ctx.mpio_coll_chunk_multi_ratio_coll) < 0) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTSET, NULL, "error setting instrumented collective chunk multi ratio coll value") + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + + /* Pop the top context node from the stack */ + ret_value = (*head); + (*head) = (*head)->next; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX__pop_common() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_pop + * + * Purpose: Pops the context for an API call. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Februrary 19, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5CX_pop(void) +{ + H5CX_node_t *cnode; /* Context node */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Perform common operations and get top context from stack */ + if(NULL == (cnode = H5CX__pop_common())) + HGOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, "error getting API context node") + + /* Free the context node */ + cnode = H5FL_FREE(H5CX_node_t, cnode); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5CX_pop() */ + + +/*------------------------------------------------------------------------- + * Function: H5CX_pop_special + * + * Purpose: Pops the context for an API call, without using library routines. + * + * Note: This should only be called in special circumstances, like H5close. + * + * Return: + * + * Programmer: Quincey Koziol + * Februrary 22, 2018 + * + *------------------------------------------------------------------------- + */ +void +H5CX_pop_special(void) +{ + H5CX_node_t *cnode; /* Context node */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Perform common operations and get top context from stack */ + cnode = H5CX__pop_common(); + HDassert(cnode); + + /* Free the context node */ + HDfree(cnode); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5CX_pop_special() */ + diff --git a/src/H5CXmodule.h b/src/H5CXmodule.h new file mode 100644 index 0000000..f6a8f29 --- /dev/null +++ b/src/H5CXmodule.h @@ -0,0 +1,33 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Sunday, February 25, 2018 + * + * Purpose: This file contains declarations which define macros for the + * H5CX package. Including this header means that the source file + * is part of the H5CX package. + */ +#ifndef _H5CXmodule_H +#define _H5CXmodule_H + +/* Define the proper control macros for the generic FUNC_ENTER/LEAVE and error + * reporting macros. + */ +#define H5CX_MODULE +#define H5_MY_PKG H5CX +#define H5_MY_PKG_ERR H5E_CONTEXT +#define H5_MY_PKG_INIT YES + +#endif /* _H5CXmodule_H */ + diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h new file mode 100644 index 0000000..b9f238b --- /dev/null +++ b/src/H5CXprivate.h @@ -0,0 +1,142 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Header file for API contexts, etc. + */ +#ifndef _H5CXprivate_H +#define _H5CXprivate_H + +/* Include package's public header */ +#ifdef NOT_YET +#include "H5CXpublic.h" +#endif /* NOT_YET */ + +/* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#ifdef H5_HAVE_PARALLEL +#include "H5FDprivate.h" /* File drivers */ +#endif /* H5_HAVE_PARALLEL */ +#include "H5Zprivate.h" /* Data filters */ + + +/**************************/ +/* Library Private Macros */ +/**************************/ + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ + + +/*****************************/ +/* Library-private Variables */ +/*****************************/ + + +/***************************************/ +/* Library-private Function Prototypes */ +/***************************************/ + +/* Library private routines */ +H5_DLL herr_t H5CX_push(void); +H5_DLL void H5CX_push_special(void); +H5_DLL hbool_t H5CX_is_def_dxpl(void); +H5_DLL herr_t H5CX_pop(void); +H5_DLL void H5CX_pop_special(void); + +/* "Setter" routines for API context info */ +H5_DLL void H5CX_set_dxpl(hid_t dxpl_id); +H5_DLL void H5CX_set_lapl(hid_t lapl_id); +H5_DLL herr_t H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, + hid_t loc_id, hbool_t is_collective); +H5_DLL herr_t H5CX_set_loc(hid_t loc_id, hbool_t is_collective); + +/* "Getter" routines for API context info */ +H5_DLL hid_t H5CX_get_dxpl(void); +H5_DLL hid_t H5CX_get_lapl(void); +H5_DLL haddr_t H5CX_get_tag(void); +H5_DLL H5AC_ring_t H5CX_get_ring(void); +#ifdef H5_HAVE_PARALLEL +H5_DLL hbool_t H5CX_get_coll_metadata_read(void); +H5_DLL herr_t H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype); +#endif /* H5_HAVE_PARALLEL */ + +/* "Getter" routines for DXPL properties cached in API context */ +H5_DLL herr_t H5CX_get_btree_split_ratios(double split_ratio[3]); +H5_DLL herr_t H5CX_get_max_temp_buf(size_t *max_temp_buf); +H5_DLL herr_t H5CX_get_tconv_buf(void **tconv_buf); +H5_DLL herr_t H5CX_get_bkgr_buf(void **bkgr_buf); +H5_DLL herr_t H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type); +H5_DLL herr_t H5CX_get_vec_size(size_t *vec_size); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode); +H5_DLL herr_t H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt); +H5_DLL herr_t H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause); +H5_DLL herr_t H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num); +H5_DLL herr_t H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio); +#endif /* H5_HAVE_PARALLEL */ +H5_DLL herr_t H5CX_get_err_detect(H5Z_EDC_t *err_detect); +H5_DLL herr_t H5CX_get_filter_cb(H5Z_cb_t *filter_cb); +H5_DLL herr_t H5CX_get_data_transform(H5Z_data_xform_t **data_transform); +H5_DLL herr_t H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info); +H5_DLL herr_t H5CX_get_dcr_flag(hbool_t *direct_read); +H5_DLL herr_t H5CX_get_dcr_offset(hsize_t **direct_offset); +H5_DLL herr_t H5CX_get_dcw_flag(hbool_t *direct_write); +H5_DLL herr_t H5CX_get_dcw_filters(uint32_t *direct_filters); +H5_DLL herr_t H5CX_get_dcw_offset(hsize_t **direct_offset); +H5_DLL herr_t H5CX_get_dcw_datasize(uint32_t *direct_datasize); +H5_DLL herr_t H5CX_get_dt_conv_cb(H5T_conv_cb_t *cb_struct); + +/* "Getter" routines for LAPL properties cached in API context */ +H5_DLL herr_t H5CX_get_nlinks(size_t *nlinks); + +/* "Setter" routines for API context info */ +H5_DLL void H5CX_set_tag(haddr_t tag); +H5_DLL void H5CX_set_ring(H5AC_ring_t ring); +#ifdef H5_HAVE_PARALLEL +H5_DLL void H5CX_set_coll_metadata_read(hbool_t cmdr); +H5_DLL herr_t H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype); +H5_DLL herr_t H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt); +#endif /* H5_HAVE_PARALLEL */ + +/* "Setter" routines for DXPL properties cached in API context */ +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode); +#endif /* H5_HAVE_PARALLEL */ +H5_DLL herr_t H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, + void *alloc_info, H5MM_free_t free_func, void *free_info); + +/* "Setter" routines for LAPL properties cached in API context */ +H5_DLL herr_t H5CX_set_nlinks(size_t nlinks); + +/* "Setter" routines for cached DXPL properties that must be returned to application */ +H5_DLL void H5CX_set_dcr_filters(uint32_t direct_filters); +#ifdef H5_HAVE_PARALLEL +H5_DLL void H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t chunk_opt); +H5_DLL void H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t actual_io_mode); +H5_DLL void H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause); +H5_DLL void H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_coll); +H5_DLL herr_t H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_ind); +#endif /* H5_HAVE_PARALLEL */ + +#endif /* _H5CXprivate_H */ + diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c index f8507a9..8bcab9f 100644 --- a/src/H5Cepoch.c +++ b/src/H5Cepoch.c @@ -64,15 +64,15 @@ static void * H5C__epoch_marker_deserialize(const void * image_ptr, size_t len, void * udata, hbool_t * dirty_ptr); static herr_t H5C__epoch_marker_image_len(const void * thing, size_t *image_len_ptr); -static herr_t H5C__epoch_marker_pre_serialize(H5F_t *f, - hid_t dxpl_id, void * thing, haddr_t addr, size_t len, - haddr_t * new_addr_ptr, size_t * new_len_ptr, unsigned * flags_ptr); +static herr_t H5C__epoch_marker_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + unsigned *flags_ptr); static herr_t H5C__epoch_marker_serialize(const H5F_t *f, void * image_ptr, size_t len, void * thing); static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__epoch_marker_free_icr(void * thing); static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, - size_t H5_ATTR_UNUSED * fsf_size_ptr); + hsize_t H5_ATTR_UNUSED * fsf_size_ptr); /*********************/ @@ -180,7 +180,7 @@ H5C__epoch_marker_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__epoch_marker_pre_serialize(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, +H5C__epoch_marker_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) @@ -229,7 +229,7 @@ H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing) static herr_t -H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, size_t H5_ATTR_UNUSED *fsf_size_ptr) +H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 53d1712..3156079 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -114,14 +114,12 @@ static void H5C__prep_for_file_close__compute_fd_heights_real( static herr_t H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr); static herr_t H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr); -static herr_t H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr); +static herr_t H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr); static H5C_cache_entry_t *H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **buf); -static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, - hbool_t create); -static herr_t H5C__read_cache_image(H5F_t * f, hid_t dxpl_id, H5C_t *cache_ptr); -static herr_t H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr); +static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create); +static herr_t H5C__read_cache_image(H5F_t * f, H5C_t *cache_ptr); +static herr_t H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr); static herr_t H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr); static herr_t H5C__free_image_entries_array(H5C_t *cache_ptr); @@ -391,7 +389,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -414,7 +412,7 @@ H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) /* Write cache image block if so configured */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) { - if(H5C__write_cache_image(f, dxpl_id, cache_ptr) < 0) + if(H5C__write_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write metadata cache image block to file") H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr); @@ -466,7 +464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, +H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t **entry_ptr_ptr, const H5C_class_t *type, haddr_t addr, void *udata) { @@ -678,7 +676,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, H5C__RESET_CACHE_ENTRY_STATS(ds_entry_ptr); /* Apply to to the newly deserialized entry */ - if(H5C__tag_entry(cache_ptr, ds_entry_ptr, dxpl_id) < 0) + if(H5C__tag_entry(cache_ptr, ds_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "Cannot tag metadata entry") /* We have successfully deserialized the prefetched entry. @@ -707,7 +705,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr, flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; } /* end if */ - if(H5C__flush_single_entry(f, dxpl_id, pf_entry_ptr, flush_flags) < 0) + if(H5C__flush_single_entry(f, pf_entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't expunge prefetched entry") #ifndef NDEGUG /* verify deletion */ @@ -886,7 +884,7 @@ H5C__free_image_entries_array(H5C_t * cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C_force_cache_image_load(H5F_t *f, hid_t dxpl_id) +H5C_force_cache_image_load(H5F_t *f) { H5C_t *cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -904,7 +902,7 @@ H5C_force_cache_image_load(H5F_t *f, hid_t dxpl_id) /* Load the cache image, if requested */ if(cache_ptr->load_image) { cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f, dxpl_id) < 0) + if(H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") } /* end if */ @@ -1034,8 +1032,8 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +static herr_t +H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1060,12 +1058,9 @@ H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ /* Read the buffer (if serial access, or rank 0 of parallel access) */ - if ( H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, - cache_ptr->image_len, dxpl_id, - cache_ptr->image_buffer) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, \ - "Can't read metadata cache image block") + if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, + cache_ptr->image_len, cache_ptr->image_buffer) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) @@ -1097,9 +1092,7 @@ H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5C__read_cache_image() */ @@ -1121,7 +1114,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) +H5C__load_cache_image(H5F_t *f) { H5C_t * cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1154,11 +1147,11 @@ H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for cache image buffer") /* Load the image from file */ - if(H5C__read_cache_image(f, dxpl_id, cache_ptr) < 0) + if(H5C__read_cache_image(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") /* Reconstruct cache contents, from image */ - if(H5C__reconstruct_cache_contents(f, dxpl_id, cache_ptr) < 0) + if(H5C__reconstruct_cache_contents(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDECODE, FAIL, "Can't reconstruct cache contents from image block") /* Free the image buffer */ @@ -1174,7 +1167,7 @@ H5C__load_cache_image(H5F_t *f, hid_t dxpl_id) /* If directed, free the on disk metadata cache image */ if(cache_ptr->delete_image) { - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_MDCI_MSG_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_MDCI_MSG_ID) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove metadata cache image message from superblock extension") /* Reset image block values */ @@ -1343,7 +1336,7 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) *------------------------------------------------------------------------- */ herr_t -H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated) +H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) { H5C_t * cache_ptr = NULL; haddr_t eoa_frag_addr = HADDR_UNDEF; @@ -1367,7 +1360,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated */ if(cache_ptr->load_image) { cache_ptr->load_image = FALSE; - if(H5C__load_cache_image(f, dxpl_id) < 0) + if(H5C__load_cache_image(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "can't load cache image") } /* end if */ @@ -1408,11 +1401,11 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDCI_SBE_MESG) - if(H5C__write_cache_image_superblock_msg(f, dxpl_id, TRUE) < 0) + if(H5C__write_cache_image_superblock_msg(f, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "creation of cache image SB mesg failed.") /* Serialize the cache */ - if(H5C__serialize_cache(f, dxpl_id) < 0) + if(H5C__serialize_cache(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "serialization of the cache failed") /* Scan the cache and record data needed to construct the @@ -1470,7 +1463,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * Note that we allocate the cache image directly from the file * driver so as to avoid unsettling the free space managers. */ - if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, dxpl_id, H5FD_MEM_SUPER, f, + if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, (hsize_t)p0_image_len, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_CACHE, H5E_NOSPACE, FAIL, "can't allocate file space for metadata cache image") } /* end if */ @@ -1480,7 +1473,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * this space directly from the file driver so as to avoid * unsettling the free space managers. */ - if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, dxpl_id, H5FD_MEM_SUPER, f, + if(HADDR_UNDEF == (cache_ptr->image_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, f, (hsize_t)(cache_ptr->image_data_len), &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_CACHE, H5E_NOSPACE, FAIL, "can't allocate file space for metadata cache image") @@ -1523,7 +1516,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) - if(H5C__write_cache_image_superblock_msg(f, dxpl_id, FALSE) < 0) + if(H5C__write_cache_image_superblock_msg(f, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "update of cache image SB mesg failed") /* At this point: @@ -1577,7 +1570,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, hbool_t *image_generated * cache_ptr->image_ctl.flags. */ if(cache_ptr->image_ctl.flags & H5C_CI__GEN_MDC_IMAGE_BLK) - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_MDCI_MSG_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_MDCI_MSG_ID) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove MDC image msg from superblock ext") cache_ptr->image_ctl.generate_image = FALSE; @@ -3093,7 +3086,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) +H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) { H5C_cache_entry_t * pf_entry_ptr; /* Pointer to prefetched entry */ H5C_cache_entry_t * parent_ptr; /* Pointer to parent of prefetched entry */ @@ -3275,7 +3268,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) else write_permitted = cache_ptr->write_permitted; - if(H5C__make_space_in_cache(f, dxpl_id, 0, write_permitted) < 0) + if(H5C__make_space_in_cache(f, 0, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, FAIL, "H5C__make_space_in_cache failed") } /* end if */ @@ -3476,7 +3469,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, hbool_t create) +H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create) { H5C_t * cache_ptr; H5O_mdci_t mdci_msg; /* metadata cache image message */ @@ -3514,7 +3507,7 @@ H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, hbool_t create) mdci_msg.size = cache_ptr->image_len; /* Write metadata cache image message to superblock extension */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_MDCI_MSG_ID, &mdci_msg, create, mesg_flags) < 0) + if(H5F__super_ext_write_msg(f, H5O_MDCI_MSG_ID, &mdci_msg, create, mesg_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata cache image message to superblock extension") done: @@ -3536,7 +3529,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) +H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3558,7 +3551,7 @@ H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) #endif /* H5_HAVE_PARALLEL */ /* Write the buffer (if serial access, or rank 0 for parallel access) */ - if(H5F_block_write(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, dxpl_id, cache_ptr->image_buffer) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, cache_ptr->image_buffer) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't write metadata cache image block to file") #ifdef H5_HAVE_PARALLEL } /* end if */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index a75cd88..e342d69 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -37,14 +37,11 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_PARALLEL @@ -62,12 +59,11 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id); -static herr_t H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, - unsigned entries_to_flush[H5C_RING_NTYPES], +static herr_t H5C__collective_write(H5F_t *f); +static herr_t H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]); -static herr_t H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, - H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear); +static herr_t H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, + unsigned entries_to_flush, unsigned entries_to_clear); /*********************/ @@ -171,7 +167,6 @@ static herr_t H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, */ herr_t H5C_apply_candidate_list(H5F_t * f, - hid_t dxpl_id, H5C_t * cache_ptr, unsigned num_candidates, haddr_t * candidates_list_ptr, @@ -387,7 +382,7 @@ H5C_apply_candidate_list(H5F_t * f, * If we don't do this, my experiments indicate that we will have a * noticably poorer hit ratio as a result. */ - if(H5C__flush_candidate_entries(f, dxpl_id, entries_to_flush, entries_to_clear) < 0) + if(H5C__flush_candidate_entries(f, entries_to_flush, entries_to_clear) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush candidates failed") /* If we've deferred writing to do it collectively, take care of that now */ @@ -396,7 +391,7 @@ H5C_apply_candidate_list(H5F_t * f, HDassert(cache_ptr->coll_write_list); /* Write collective list */ - if(H5C__collective_write(f, dxpl_id) < 0) + if(H5C__collective_write(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata collectively") } /* end if */ @@ -644,7 +639,6 @@ done: */ herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t dxpl_id, unsigned ce_array_len, haddr_t * ce_array_ptr) { @@ -788,7 +782,7 @@ H5C_mark_entries_as_clean(H5F_t * f, entry_ptr = entry_ptr->prev; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -818,7 +812,7 @@ H5C_mark_entries_as_clean(H5F_t * f, pinned_entries_cleared++; progress = TRUE; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, + if(H5C__flush_single_entry(f, clear_ptr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__UPDATE_PAGE_BUFFER_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") } /* end if */ @@ -922,10 +916,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__collective_write(H5F_t *f, hid_t dxpl_id) +H5C__collective_write(H5F_t *f) { H5AC_t *cache_ptr; - H5P_genplist_t *plist = NULL; H5FD_mpio_xfer_t orig_xfer_mode = H5FD_MPIO_COLLECTIVE; int count; int *length_array = NULL; @@ -947,12 +940,8 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HDassert(cache_ptr->coll_write_list != NULL); /* Get original transfer mode */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a data transfer property list") - - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + if(H5CX_get_io_xfer_mode(&orig_xfer_mode) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); @@ -964,35 +953,23 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) void *base_buf; int i; - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O property") + /* Set new transfer mode */ + if(H5CX_set_io_xfer_mode(xfer_mode) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") /* Allocate arrays */ - if ( NULL == (length_array = - (int *)H5MM_malloc((size_t)count * sizeof(int))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective write table length array") - - if ( NULL == (buf_array = - (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective buf table length array") - - if(NULL == (offset_array = - (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ - "memory allocation failed for collective offset table length array") + if(NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write table length array") + if(NULL == (buf_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective buf table length array") + if(NULL == (offset_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective offset table length array") /* Fill arrays */ node = H5SL_first(cache_ptr->coll_write_list); HDassert(node); if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ - "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up initial array position & buffer base address */ length_array[0] = (int)entry_ptr->size; @@ -1005,8 +982,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) while(node) { if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ - "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up array position */ length_array[i] = (int)entry_ptr->size; @@ -1019,10 +995,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) } /* end while */ /* Create memory MPI type */ - if(MPI_SUCCESS != (mpi_code = - MPI_Type_create_hindexed(count, length_array, - buf_array, MPI_BYTE, - &btype))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) btype_created = TRUE; @@ -1031,10 +1004,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Create file MPI type */ - if(MPI_SUCCESS != (mpi_code = - MPI_Type_create_hindexed(count, length_array, - offset_array, MPI_BYTE, - &ftype))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) ftype_created = TRUE; @@ -1043,15 +1013,12 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Pass buf type, file type to the file driver */ - if(H5FD_mpi_setup_collective(dxpl_id, &btype, &ftype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O properties") + if(H5CX_set_mpi_coll_datatypes(btype, ftype) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") /* Write data */ - if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, - (size_t)1, dxpl_id, base_buf) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to write entries collectively") + if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, base_buf) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively") } /* end if */ else { @@ -1061,43 +1028,35 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) MPI_Info *info_p; MPI_Info info; +/* This should be rewritten to call H5F_block_write, with the correct + * buffer and file datatypes (null ones). -QAK, 2018/02/21 + */ if(H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ - "can't get mpi file handle") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't get mpi file handle") mpi_fh = *(MPI_File*)mpi_fh_p; - if (H5F_get_mpi_info(f, &info_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ - "can't get mpi file info") + if(H5F_get_mpi_info(f, &info_p) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") info = *info_p; /* just to match up with the 1st MPI_File_set_view from * H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = - MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, - MPI_BYTE, "native", - info))) + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); - if(MPI_SUCCESS != (mpi_code = - MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, - NULL, 0, MPI_BYTE, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) /* just to match up with the 2nd MPI_File_set_view (reset) in * H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = - MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, - MPI_BYTE, "native", - info))) + if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) - } /* end else */ done: @@ -1112,13 +1071,10 @@ done: if(ftype_created && MPI_SUCCESS != (mpi_code = MPI_Type_free(&ftype))) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) - /* Reset dxpl */ - if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) { - HDassert(plist); - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ - "can't set MPI-I/O property") - } /* end if */ + /* Reset transfer mode in API context, if changed */ + if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) + if(H5CX_set_io_xfer_mode(orig_xfer_mode) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") FUNC_LEAVE_NOAPI(ret_value); } /* end H5C__collective_write() */ @@ -1163,8 +1119,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, - unsigned entries_to_flush[H5C_RING_NTYPES], +H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES], unsigned entries_to_clear[H5C_RING_NTYPES]) { #if H5C_DO_SANITY_CHECKS @@ -1234,7 +1189,7 @@ H5C__flush_candidate_entries(H5F_t *f, hid_t dxpl_id, */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - if(H5C__flush_candidates_in_ring(f, dxpl_id, ring, entries_to_flush[ring], entries_to_clear[ring]) < 0) + if(H5C__flush_candidates_in_ring(f, ring, entries_to_flush[ring], entries_to_clear[ring]) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush candidates in ring failed") ring++; @@ -1284,7 +1239,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, +H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flush, unsigned entries_to_clear) { H5C_t * cache_ptr; @@ -1413,7 +1368,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, op_ptr, op_flags) < 0) + if(H5C__flush_single_entry(f, op_ptr, op_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry") if(cache_ptr->entries_removed_counter != 0 @@ -1551,7 +1506,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, * * JRM -- 2/9/17 */ - if(H5C__flush_single_entry(f, dxpl_id, op_ptr, op_flags) < 0) + if(H5C__flush_single_entry(f, op_ptr, op_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't flush entry") if(cache_ptr->entries_removed_counter != 0 diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index d431887..c5dc8f3 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4922,31 +4922,29 @@ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hid_t dxpl_id, - hbool_t *image_generated); -H5_DLL herr_t H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, - H5C_t * cache_ptr, H5C_cache_entry_t** entry_ptr_ptr, - const H5C_class_t * type, haddr_t addr, void * udata); +H5_DLL herr_t H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated); +H5_DLL herr_t H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t * cache_ptr, + H5C_cache_entry_t** entry_ptr_ptr, const H5C_class_t * type, haddr_t addr, + void * udata); /* General routines */ -H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, hid_t dxpl_id, - H5C_cache_entry_t *entry_ptr, unsigned flags); -H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr); -H5_DLL herr_t H5C__load_cache_image(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, + unsigned flags); +H5_DLL herr_t H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr); +H5_DLL herr_t H5C__load_cache_image(H5F_t *f); H5_DLL herr_t H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__mark_flush_dep_unserialized(H5C_cache_entry_t * entry_ptr); -H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, hid_t dxpl_id, - size_t space_needed, hbool_t write_permitted); -H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id); +H5_DLL herr_t H5C__make_space_in_cache(H5F_t * f, size_t space_needed, + hbool_t write_permitted); +H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f); H5_DLL herr_t H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, - H5C_cache_entry_t *entry_ptr, hid_t dxpl_id); -H5_DLL herr_t H5C__serialize_cache(H5F_t *f, hid_t dxpl_id); + H5C_cache_entry_t *entry_ptr); +H5_DLL herr_t H5C__serialize_cache(H5F_t *f); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); /* Routines for operating on entry tags */ -H5_DLL herr_t H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, - hid_t dxpl_id); +H5_DLL herr_t H5C__tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr); H5_DLL herr_t H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry); /* Testing functions */ diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 6237d57..0befdf9 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -61,16 +61,16 @@ static void * H5C__prefetched_entry_deserialize(const void *image_ptr, size_t len, void *udata, hbool_t *dirty_ptr); static herr_t H5C__prefetched_entry_image_len(const void *thing, size_t *image_len_ptr); -static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, - haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); +static herr_t H5C__prefetched_entry_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, + unsigned *flags_ptr); static herr_t H5C__prefetched_entry_serialize(const H5F_t *f, void *image_ptr, size_t len, void *thing); static herr_t H5C__prefetched_entry_notify(H5C_notify_action_t action, void *thing); static herr_t H5C__prefetched_entry_free_icr(void *thing); static herr_t H5C__prefetched_entry_fsf_size(const void *thing, - size_t *fsf_size_ptr); + hsize_t *fsf_size_ptr); /*********************/ @@ -182,11 +182,9 @@ H5C__prefetched_entry_image_len(const void H5_ATTR_UNUSED *thing, static herr_t -H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, - hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED *thing, +H5C__prefetched_entry_pre_serialize(H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len, - haddr_t H5_ATTR_UNUSED *new_addr_ptr, - size_t H5_ATTR_UNUSED *new_len_ptr, + haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr, unsigned H5_ATTR_UNUSED *flags_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ @@ -339,7 +337,7 @@ done: static herr_t H5C__prefetched_entry_fsf_size(const void H5_ATTR_UNUSED *thing, - size_t H5_ATTR_UNUSED *fsf_size_ptr) + hsize_t H5_ATTR_UNUSED *fsf_size_ptr) { FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 50732ca..522b3cf 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -561,7 +561,6 @@ typedef struct H5C_t H5C_t; * The typedef for the pre-serialize callback is as follows: * * typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, - * hid_t dxpl_id, * void * thing, * haddr_t addr, * size_t len, @@ -575,11 +574,6 @@ typedef struct H5C_t H5C_t; * must be modified in the process of serializing the * target entry. * - * dxpl_id: dxpl_id passed with the file pointer to the cache, and - * passed on to the callback. Necessary as some callbacks - * revise the size and location of the target entry, or - * possibly other entries on pre-serialize. - * * thing: Pointer to void containing the address of the in core * representation of the target metadata cache entry. * This is the same pointer returned by a protect of the @@ -826,7 +820,7 @@ typedef struct H5C_t H5C_t; * The typedef for the get_fsf_size callback is as follows: * * typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, - * size_t *fsf_size_ptr); + * hsize_t *fsf_size_ptr); * * The parameters of the get_fsf_size callback are as follows: * @@ -835,7 +829,7 @@ typedef struct H5C_t H5C_t; * is the same pointer that would be returned by a protect() * call of the associated addr and len. * - * fs_size_ptr: Pointer to size_t in which the callback will return + * fs_size_ptr: Pointer to hsize_t in which the callback will return * the size of the piece of file space to be freed. Note * that the space to be freed is presumed to have the same * base address as the cache entry. @@ -881,14 +875,13 @@ typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, size_t len, vo typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr); typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr); -typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, - size_t *new_len_ptr, unsigned *flags_ptr); +typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, void *image_ptr, size_t len, void *thing); typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing); typedef herr_t (*H5C_free_icr_func_t)(void *thing); -typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, size_t *fsf_size_ptr); +typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, hsize_t *fsf_size_ptr); /* Metadata cache client class definition */ typedef struct H5C_class_t { @@ -2245,20 +2238,20 @@ H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size); -H5_DLL herr_t H5C_dest(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5C_evict(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, - const H5C_class_t *type, haddr_t addr, unsigned flags); -H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag); -H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global); -H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags); +H5_DLL herr_t H5C_dest(H5F_t *f); +H5_DLL herr_t H5C_evict(H5F_t *f); +H5_DLL herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, + unsigned flags); +H5_DLL herr_t H5C_flush_cache(H5F_t *f, unsigned flags); +H5_DLL herr_t H5C_flush_tagged_entries(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5C_force_cache_image_load(H5F_t * f); +H5_DLL herr_t H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global); +H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags); H5_DLL herr_t H5C_get_tag(const void *thing, /*OUT*/ haddr_t *tag); #if H5C_DO_TAGGING_SANITY_CHECKS herr_t H5C_verify_tag(int id, haddr_t tag); #endif -H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C_get_cache_image_config(const H5C_t * cache_ptr, @@ -2277,8 +2270,8 @@ H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr); H5_DLL herr_t H5C_image_stats(H5C_t * cache_ptr, hbool_t print_header); -H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, void *thing, unsigned int flags); +H5_DLL herr_t H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, + void *thing, unsigned int flags); H5_DLL herr_t H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_t rw); H5_DLL herr_t H5C_mark_entry_dirty(void *thing); @@ -2288,10 +2281,10 @@ H5_DLL herr_t H5C_mark_entry_serialized(void *thing); H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, haddr_t new_addr); H5_DLL herr_t H5C_pin_protected_entry(void *thing); -H5_DLL herr_t H5C_prep_for_file_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5C_prep_for_file_close(H5F_t *f); H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL void * H5C_protect(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, - haddr_t addr, void *udata, unsigned flags); +H5_DLL void * H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, + void *udata, unsigned flags); H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr); H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr); @@ -2305,7 +2298,7 @@ H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name, H5_DLL void H5C_stats__reset(H5C_t *cache_ptr); H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing); -H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *thing, +H5_DLL herr_t H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5C_validate_cache_image_config(H5C_cache_image_ctl_t * ctl_ptr); H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, @@ -2324,13 +2317,13 @@ H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); #ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, - H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr, - int mpi_rank, int mpi_size); +H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, + unsigned num_candidates, haddr_t *candidates_list_ptr, int mpi_rank, + int mpi_size); H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr); H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr); H5_DLL herr_t H5C_clear_coll_entries(H5C_t * cache_ptr, hbool_t partial); -H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t dxpl_id, unsigned ce_array_len, +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Ctag.c b/src/H5Ctag.c index a9b2ec0..66aedd9 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -37,6 +37,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5Iprivate.h" /* IDs */ @@ -54,8 +55,7 @@ /* Typedef for tagged entry iterator callback context - evict tagged entries */ typedef struct { - H5F_t * f; /* File pointer for evicting entry */ - hid_t dxpl_id; /* DXPL for evicting entry */ + H5F_t *f; /* File pointer for evicting entry */ hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry * was evicted when iterating over * cache @@ -72,8 +72,7 @@ typedef struct { /* Typedef for tagged entry iterator callback context - expunge tag type metadata */ typedef struct { - H5F_t * f; /* File pointer for evicting entry */ - hid_t dxpl_id; /* DXPL for evicting entry */ + H5F_t *f; /* File pointer for evicting entry */ int type_id; /* Cache entry type to expunge */ unsigned flags; /* Flags for expunging entry */ } H5C_tag_iter_ettm_ctx_t; @@ -178,7 +177,7 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr) * * Function: H5C__tag_entry * - * Purpose: Tags an entry with the provided tag (contained in the dxpl_id). + * Purpose: Tags an entry with the provided tag (contained in the API context). * If sanity checking is enabled, this function will perform * validation that a proper tag is contained within the provided * data access property list id before application. @@ -191,9 +190,8 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry, hid_t dxpl_id) +H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) { - H5P_genplist_t *dxpl; /* dataset transfer property list */ H5C_tag_info_t *tag_info; /* Points to a tag info struct */ haddr_t tag; /* Tag value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -205,18 +203,13 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry, hid_t dxpl_id) HDassert(entry != NULL); HDassert(cache->magic == H5C__H5C_T_MAGIC); - /* Get the dataset transfer property list */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Get the tag from the DXPL */ - if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value") + /* Get the tag */ + tag = H5CX_get_tag(); if(cache->ignore_tags) { /* if we're ignoring tags, it's because we're running tests on internal functions and may not have inserted a tag - value into a given dxpl_id before creating some metadata. Thus, + value into a given API context before creating some metadata. Thus, in this case only, if a tag value has not been set, we can arbitrarily set it to something for the sake of passing the tests. If the tag value is set, then we'll just let it get assigned without @@ -475,12 +468,12 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) ctx->pinned_entries_need_evicted = TRUE; else if(!entry->prefetched_dirty) { /* Evict the Entry */ - if(H5C__flush_single_entry(ctx->f, ctx->dxpl_id, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) + if(H5C__flush_single_entry(ctx->f, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, H5_ITER_ERROR, "Entry eviction failed.") ctx->evicted_entries_last_pass = TRUE; - } else { + } /* end else-if */ + else ctx->skipped_pf_dirty_entries = TRUE; - } done: FUNC_LEAVE_NOAPI(ret_value) @@ -501,7 +494,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global) +H5C_evict_tagged_entries(H5F_t * f, haddr_t tag, hbool_t match_global) { H5C_t *cache; /* Pointer to cache structure */ H5C_tag_iter_evict_ctx_t ctx; /* Context for iterator callback */ @@ -519,7 +512,6 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_gl /* Construct context for iterator callbacks */ ctx.f = f; - ctx.dxpl_id = dxpl_id; /* Start evicting entries */ do { @@ -721,7 +713,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) +H5C_flush_tagged_entries(H5F_t *f, haddr_t tag) { /* Variable Declarations */ H5C_t *cache_ptr = NULL; @@ -741,7 +733,7 @@ H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't mark tagged entries") /* Flush all marked entries */ - if(H5C__flush_marked_entries(f, dxpl_id) < 0) + if(H5C__flush_marked_entries(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush marked entries") done: @@ -820,7 +812,7 @@ H5C__expunge_tag_type_metadata_cb(H5C_cache_entry_t *entry, void *_ctx) /* Found one with the same tag and type id */ if(entry->type->id == ctx->type_id) - if(H5C_expunge_entry(ctx->f, ctx->dxpl_id, entry->type, entry->addr, ctx->flags) < 0) + if(H5C_expunge_entry(ctx->f, entry->type, entry->addr, ctx->flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, H5_ITER_ERROR, "can't expunge entry") done: @@ -843,8 +835,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, - unsigned flags) +H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags) { H5C_t *cache; /* Pointer to cache structure */ H5C_tag_iter_ettm_ctx_t ctx; /* Context for iterator callback */ @@ -862,7 +853,6 @@ H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, /* Construct context for iterator callbacks */ ctx.f = f; - ctx.dxpl_id = dxpl_id; ctx.type_id = type_id; ctx.flags = flags; diff --git a/src/H5D.c b/src/H5D.c index fc2024a..0c88f45 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -107,7 +108,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -136,12 +137,16 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new dataset & get its ID */ - if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") @@ -151,6 +156,8 @@ done: if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate2() */ @@ -197,7 +204,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -216,12 +223,16 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* build and open the new dataset */ - if(NULL == (dset = H5D__create(loc.oloc->file, type_id, space, dcpl_id, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create_anon(loc.oloc->file, type_id, space, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -238,7 +249,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get object location of dataset") /* Decrement refcount on dataset's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(oloc) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") } /* end if */ @@ -247,6 +258,8 @@ done: if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate_anon() */ @@ -273,7 +286,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datset */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -285,12 +298,16 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&dapl_id, H5P_CLS_DACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the dataset */ - if(NULL == (dset = H5D__open_name(&loc, name, dapl_id, dxpl_id))) + if(NULL == (dset = H5D__open_name(&loc, name, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ @@ -301,6 +318,9 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen2() */ @@ -322,6 +342,7 @@ done: herr_t H5Dclose(hid_t dset_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -330,6 +351,9 @@ H5Dclose(hid_t dset_id) /* Check args */ if(NULL == H5I_object_verify(dset_id, H5I_DATASET)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* * Decrement the counter on the dataset. It will be freed if the count @@ -339,6 +363,8 @@ H5Dclose(hid_t dset_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't decrement count on dataset ID") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dclose() */ @@ -363,19 +389,27 @@ hid_t H5Dget_space(hid_t dset_id) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", dset_id); /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataset") - if((ret_value = H5D_get_space(dset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_space(dset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get dataspace") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_space() */ @@ -398,6 +432,7 @@ herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -407,11 +442,18 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Read dataspace address and return */ - if(H5D__get_space_status(dset, allocation, H5AC_ind_read_dxpl_id) < 0) + if(H5D__get_space_status(dset, allocation) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dget_space_status() */ @@ -435,8 +477,8 @@ done: hid_t H5Dget_type(hid_t dset_id) { - H5D_t *dset; /* Dataset */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -446,10 +488,17 @@ H5Dget_type(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - if((ret_value = H5D_get_type(dset)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_type(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get dataspace") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_type() */ @@ -473,20 +522,28 @@ done: hid_t H5Dget_create_plist(hid_t dset_id) { - H5D_t *dataset; /* Dataset structure */ - hid_t ret_value = SUCCEED; /* Return value */ + H5D_t *dataset; /* Dataset structure */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", dset_id); /* Check args */ if(NULL == (dataset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataset") - if((ret_value = H5D_get_create_plist(dataset)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't get creation plist") +/* Set API context, verify access property list, and set up collective metadata if appropriate */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + if((ret_value = H5D__get_create_plist(dataset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "Can't get creation plist") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_create_plist() */ @@ -567,6 +624,7 @@ hsize_t H5Dget_storage_size(hid_t dset_id) { H5D_t *dset; /* Dataset to query */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hsize_t ret_value; /* Return value */ FUNC_ENTER_API(0) @@ -576,11 +634,18 @@ H5Dget_storage_size(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, 0, "can't set API context") +api_ctx_pushed = TRUE; + /* Set return value */ - if(H5D__get_storage_size(dset, H5AC_ind_read_dxpl_id, &ret_value) < 0) + if(H5D__get_storage_size(dset, &ret_value) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of dataset's storage") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, 0, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dget_storage_size() */ @@ -732,13 +797,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) +H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) { H5S_t *space; /* Dataspace for iteration */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iii*x", type_id, space_id, plist_id, buf); + H5TRACE4("e", "iii*x", type_id, space_id, dxpl_id, buf); /* Check args */ if(H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL) @@ -749,16 +815,24 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") /* Get the default dataset transfer property list if the user didn't provide one */ - if(H5P_DEFAULT == plist_id) - plist_id = H5P_DATASET_XFER_DEFAULT; + if(H5P_DEFAULT == dxpl_id) + dxpl_id = H5P_DATASET_XFER_DEFAULT; else - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Call internal routine */ - ret_value = H5D_vlen_reclaim(type_id, space, plist_id, buf); + ret_value = H5D_vlen_reclaim(type_id, space, buf); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dvlen_reclaim() */ @@ -791,15 +865,15 @@ herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size) { - H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0, 0}; + H5D_vlen_bufsize_t vlen_bufsize = {0, 0, 0, 0, 0, 0}; H5D_t *dset; /* Dataset for operation */ H5S_t *fspace = NULL; /* Dataset's dataspace */ H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ - H5P_genplist_t *plist; /* Property list */ H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -837,17 +911,14 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, if(NULL == (vlen_bufsize.vl_tbuf = H5FL_BLK_MALLOC(vlen_vl_buf, (size_t)1))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available") - /* Change to the custom memory allocation routines for reading VL data */ - if((vlen_bufsize.xfer_pid = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available") - - /* Get the property list struct */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(vlen_bufsize.xfer_pid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Set the memory manager to the special allocation routine */ - if(H5P_set_vlen_mem_manager(plist, H5D__vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set VL data allocation routine") + if(H5CX_set_vlen_alloc_info(H5D__vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set VL data allocation routine") /* Set the initial number of bytes required */ vlen_bufsize.size = 0; @@ -872,8 +943,8 @@ done: vlen_bufsize.fl_tbuf = H5FL_BLK_FREE(vlen_fl_buf, vlen_bufsize.fl_tbuf); if(vlen_bufsize.vl_tbuf != NULL) vlen_bufsize.vl_tbuf = H5FL_BLK_FREE(vlen_vl_buf, vlen_bufsize.vl_tbuf); - if(vlen_bufsize.xfer_pid > 0 && H5I_dec_ref(vlen_bufsize.xfer_pid) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dvlen_get_buf_size() */ @@ -896,6 +967,7 @@ herr_t H5Dset_extent(hid_t dset_id, const hsize_t size[]) { H5D_t *dset; /* Dataset for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -907,12 +979,22 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Private function */ - if(H5D__set_extent(dset, size, H5AC_ind_read_dxpl_id) < 0) + if(H5D__set_extent(dset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset") done: - FUNC_LEAVE_API(ret_value) +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dset_extent() */ @@ -931,7 +1013,8 @@ done: herr_t H5Dflush(hid_t dset_id) { - H5D_t *dset; /* Dataset for this operation */ + H5D_t *dset; /* Dataset for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -941,15 +1024,21 @@ H5Dflush(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") - /* Flush any dataset information still cached in memory */ - if(H5D__flush_real(dset, H5AC_ind_read_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Flush object's metadata to file */ - if(H5O_flush_common(&dset->oloc, dset_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset and object flush callback") + /* Flush dataset information cached in memory */ + if(H5D__flush(dset, dset_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush cached dataset info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dflush */ @@ -969,8 +1058,9 @@ done: herr_t H5Drefresh(hid_t dset_id) { - H5D_t *dset; /* Dataset to refresh */ - herr_t ret_value = SUCCEED; /* return value */ + H5D_t *dset; /* Dataset to refresh */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); @@ -979,11 +1069,21 @@ H5Drefresh(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call private function to refresh the dataset object */ - if((H5D__refresh(dset_id, dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__refresh(dset_id, dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to refresh dataset") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Drefresh() */ @@ -1008,6 +1108,7 @@ herr_t H5Dformat_convert(hid_t dset_id) { H5D_t *dset; /* Dataset to refresh */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1017,11 +1118,19 @@ H5Dformat_convert(hid_t dset_id) if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + switch(dset->shared->layout.type) { case H5D_CHUNKED: /* Convert the chunk indexing type to version 1 B-tree if not */ if(dset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE) - if((H5D__format_convert(dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__format_convert(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to downgrade chunk indexing type for dataset") break; @@ -1029,7 +1138,7 @@ H5Dformat_convert(hid_t dset_id) case H5D_COMPACT: /* Downgrade the layout version to 3 if greater than 3 */ if(dset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT) - if((H5D__format_convert(dset, H5AC_ind_read_dxpl_id)) < 0) + if((H5D__format_convert(dset)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to downgrade layout version for dataset") break; @@ -1046,6 +1155,8 @@ H5Dformat_convert(hid_t dset_id) } /* end switch */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dformat_convert */ @@ -1104,6 +1215,7 @@ herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_nbytes) { H5D_t *dset = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -1119,11 +1231,18 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call private function */ - if(H5D__get_chunk_storage_size(dset, H5P_DATASET_XFER_DEFAULT, offset, chunk_nbytes) < 0) + if(H5D__get_chunk_storage_size(dset, offset, chunk_nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get storage size of chunk") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value); } /* H5Dget_chunk_storage_size() */ + diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 8177e13..c23f089 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -95,23 +95,22 @@ static herr_t H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *stor const H5O_layout_chunk_t *layout); /* B-tree iterator callbacks */ -static int H5D__btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_key, +static int H5D__btree_idx_iterate_cb(H5F_t *f, const void *left_key, haddr_t addr, const void *right_key, void *_udata); /* B-tree callbacks */ static H5UC_t *H5D__btree_get_shared(const H5F_t *f, const void *_udata); -static herr_t H5D__btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key, +static herr_t H5D__btree_new_node(H5F_t *f, H5B_ins_t, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p /*out*/); static int H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5D__btree_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static htri_t H5D__btree_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); -static H5B_ins_t H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static H5B_ins_t H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node/*out*/); -static H5B_ins_t H5D__btree_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr, - void *_lt_key, hbool_t *lt_key_changed, void *_udata, void *_rt_key, - hbool_t *rt_key_changed); +static H5B_ins_t H5D__btree_remove( H5F_t *f, haddr_t addr, void *_lt_key, + hbool_t *lt_key_changed, void *_udata, void *_rt_key, hbool_t *rt_key_changed); static herr_t H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, @@ -136,7 +135,7 @@ static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -253,9 +252,8 @@ H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D__btree_new_node(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5B_ins_t op, - void *_lt_key, void *_udata, void *_rt_key, - haddr_t *addr_p/*out*/) +H5D__btree_new_node(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, + void *_rt_key, haddr_t *addr_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key; @@ -438,8 +436,8 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) *------------------------------------------------------------------------- */ static htri_t -H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, const void *_lt_key, - void *_udata) +H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, + void *_udata) { H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata; const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *) _lt_key; @@ -537,11 +535,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_insert(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, void *_lt_key, - hbool_t *lt_key_changed, - void *_md_key, void *_udata, void *_rt_key, - hbool_t H5_ATTR_UNUSED *rt_key_changed, - haddr_t *new_node_p/*out*/) +H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, + void *_md_key, void *_udata, void *_rt_key, hbool_t H5_ATTR_UNUSED *rt_key_changed, + haddr_t *new_node_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *md_key = (H5D_btree_key_t *) _md_key; @@ -630,7 +626,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ , +H5D__btree_remove(H5F_t *f, haddr_t addr, void *_lt_key /*in,out */ , hbool_t *lt_key_changed /*out */ , void H5_ATTR_UNUSED * _udata /*in,out */ , void H5_ATTR_UNUSED * _rt_key /*in,out */ , @@ -643,7 +639,7 @@ H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(lt_key->nbytes, uint32_t, hsize_t); - if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, addr, (hsize_t)lt_key->nbytes) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk") /* Mark keys as unchanged */ @@ -940,7 +936,7 @@ H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info) udata.storage = idx_info->storage; /* Create the v1 B-tree for the chunk index */ - if(H5B_create(idx_info->f, idx_info->dxpl_id, H5B_BTREE, &udata, &(idx_info->storage->idx_addr)/*out*/) < 0) + if(H5B_create(idx_info->f, H5B_BTREE, &udata, &(idx_info->storage->idx_addr)/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create B-tree") done: @@ -1004,7 +1000,7 @@ H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, * Create the chunk it if it doesn't exist, or reallocate the chunk if * its size changed. */ - if(H5B_insert(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_insert(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk") done: @@ -1043,7 +1039,7 @@ H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat HDassert(udata); /* Go get the chunk information from the B-tree */ - if(H5B_find(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_find(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") done: @@ -1067,9 +1063,8 @@ done: *------------------------------------------------------------------------- */ static int -H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const void *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, - void *_udata) +H5D__btree_idx_iterate_cb(H5F_t H5_ATTR_UNUSED *f, const void *_lt_key, + haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5D_btree_it_ud_t *udata = (H5D_btree_it_ud_t *)_udata; /* User data */ const H5D_btree_key_t *lt_key = (const H5D_btree_key_t *)_lt_key; /* B-tree key for chunk */ @@ -1137,7 +1132,7 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over existing chunks */ - if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, H5D__btree_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B_iterate(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, H5D__btree_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk B-tree"); FUNC_LEAVE_NOAPI(ret_value) @@ -1174,7 +1169,7 @@ H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t /* Remove the chunk from the v1 B-tree index and release the space for the * chunk (in the B-tree callback). */ - if(H5B_remove(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) + if(H5B_remove(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to remove chunk entry") done: @@ -1228,7 +1223,7 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) udata.storage = &tmp_storage; /* Delete entire B-tree */ - if(H5B_delete(idx_info->f, idx_info->dxpl_id, H5B_BTREE, tmp_storage.idx_addr, &udata) < 0) + if(H5B_delete(idx_info->f, H5B_BTREE, tmp_storage.idx_addr, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk B-tree") /* Release the shared B-tree page */ @@ -1261,7 +1256,7 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) HDassert(idx_info_src); HDassert(idx_info_src->f); @@ -1287,7 +1282,7 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__btree_idx_copy_setup() */ @@ -1305,8 +1300,7 @@ done: */ static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, - hid_t H5_ATTR_UNUSED dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1362,7 +1356,7 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) udata.storage = idx_info->storage; /* Get metadata information for B-tree */ - if(H5B_get_info(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, &bt_info, NULL, &udata) < 0) + if(H5B_get_info(idx_info->f, H5B_BTREE, idx_info->storage->idx_addr, &bt_info, NULL, &udata) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to iterate over chunk B-tree") /* Set the size of the B-tree */ @@ -1476,7 +1470,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5D_btree_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims, const uint32_t *dim) { H5D_btree_dbg_t udata; /* User data for B-tree callback */ @@ -1510,7 +1504,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent udata.ndims = ndims; /* Dump the records for the B-tree */ - (void)H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_BTREE, &udata); + (void)H5B_debug(f, addr, stream, indent, fwidth, H5B_BTREE, &udata); done: if(shared_init) { diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 2e19392..f9074be 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -60,12 +60,6 @@ typedef struct H5D_bt2_ctx_t { uint32_t *dim; /* Size of chunk in elements */ } H5D_bt2_ctx_t; -/* User data for the chunk's removal callback routine */ -typedef struct H5D_bt2_remove_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_bt2_remove_ud_t; - /* Callback info for iteration over chunks in v2 B-tree */ typedef struct H5D_bt2_it_ud_t { H5D_chunk_cb_func_t cb; /* Callback routine for the chunk */ @@ -137,7 +131,7 @@ static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); static herr_t H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, @@ -664,7 +658,7 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.btree.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -672,12 +666,12 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the v2 B-tree a child flush dependency of the dataset's object header proxy */ - if(H5B2_depend(idx_info->storage->u.btree2.bt2, idx_info->dxpl_id, oh_proxy) < 0) + if(H5B2_depend(idx_info->storage->u.btree2.bt2, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -726,7 +720,7 @@ H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info) u_ctx.dim = idx_info->layout->dim; /* Open v2 B-tree for the chunk index */ - if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &u_ctx))) + if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_open(idx_info->f, idx_info->storage->idx_addr, &u_ctx))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open v2 B-tree for tracking chunked dataset") /* Check for SWMR writes to the file */ @@ -798,7 +792,7 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) u_ctx.dim = idx_info->layout->dim; /* Create the v2 B-tree for the chunked dataset */ - if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_create(idx_info->f, idx_info->dxpl_id, &bt2_cparam, &u_ctx))) + if(NULL == (idx_info->storage->u.btree2.bt2 = H5B2_create(idx_info->f, &bt2_cparam, &u_ctx))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking chunked dataset") /* Retrieve the v2 B-tree's address in the file */ @@ -947,7 +941,7 @@ H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, bt2_udata.rec.scaled[u] = udata->common.scaled[u]; /* Update record for v2 B-tree (could be insert or modify) */ - if(H5B2_update(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_mod_cb, &bt2_udata) < 0) + if(H5B2_update(bt2, &bt2_udata, H5D__bt2_mod_cb, &bt2_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTUPDATE, FAIL, "unable to update record in v2 B-tree") done: @@ -1041,7 +1035,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) bt2_udata.rec.scaled[u] = udata->common.scaled[u]; /* Go get chunk information from v2 B-tree */ - if(H5B2_find(bt2, idx_info->dxpl_id, &bt2_udata, H5D__bt2_found_cb, &found_rec) < 0) + if(H5B2_find(bt2, &bt2_udata, H5D__bt2_found_cb, &found_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in v2 B-tree") /* Set common info for the chunk */ @@ -1155,7 +1149,7 @@ H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the records in the v2 B-tree */ - if((ret_value = H5B2_iterate(bt2, idx_info->dxpl_id, H5D__bt2_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5D__bt2_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk v2 B-tree"); done: @@ -1182,18 +1176,17 @@ static herr_t H5D__bt2_remove_cb(const void *_record, void *_udata) { const H5D_chunk_rec_t *record = (const H5D_chunk_rec_t *)_record; /* The native record */ - H5D_bt2_remove_ud_t *udata = (H5D_bt2_remove_ud_t *)_udata; /* User data for removal callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for removal callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Free the space in the file for the object being removed */ H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, record->chunk_addr, (hsize_t)record->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, record->chunk_addr, (hsize_t)record->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") done: @@ -1216,7 +1209,6 @@ static herr_t H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata) { H5B2_t *bt2; /* v2 B-tree handle for indexing chunks */ - H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */ H5D_bt2_ud_t bt2_udata; /* User data for v2 B-tree find call */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1245,10 +1237,6 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u /* Set convenience pointer to v2 B-tree structure */ bt2 = idx_info->storage->u.btree2.bt2; - /* Initialize user data for removal callback */ - remove_udata.f = idx_info->f; - remove_udata.dxpl_id = idx_info->dxpl_id; - /* Prepare user data for compare callback */ bt2_udata.ndims = idx_info->layout->ndims - 1; @@ -1258,7 +1246,7 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u /* Remove the record for the "dataset chunk" object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(bt2, idx_info->dxpl_id, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_remove_cb, &remove_udata) < 0) + if(H5B2_remove(bt2, &bt2_udata, (H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) ? NULL : H5D__bt2_remove_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") done: @@ -1289,7 +1277,6 @@ done: static herr_t H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) { - H5D_bt2_remove_ud_t remove_udata; /* User data for removal callback */ H5B2_remove_t remove_op; /* The removal callback */ H5D_bt2_ctx_ud_t u_ctx; /* data for context call */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1311,10 +1298,6 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) u_ctx.chunk_size = idx_info->layout->size; u_ctx.dim = idx_info->layout->dim; - /* Initialize user data for removal callback */ - remove_udata.f = idx_info->f; - remove_udata.dxpl_id = idx_info->dxpl_id; - /* Set remove operation. Do not remove chunks in SWMR_WRITE mode */ if(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE) remove_op = NULL; @@ -1323,7 +1306,7 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Delete the v2 B-tree */ /*(space in the file for each object is freed in the 'remove' callback) */ - if(H5B2_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &u_ctx, remove_op, &remove_udata) < 0) + if(H5B2_delete(idx_info->f, idx_info->storage->idx_addr, &u_ctx, remove_op, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -1374,7 +1357,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create v2 B-tree that describes the chunked dataset in the destination file */ if(H5D__bt2_idx_create(idx_info_dst) < 0) @@ -1382,7 +1365,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1402,7 +1385,7 @@ done: */ static herr_t H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1415,12 +1398,12 @@ H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.btree2.bt2); /* Close v2 B-tree for source file */ - if(H5B2_close(storage_src->u.btree2.bt2, dxpl_id) < 0) + if(H5B2_close(storage_src->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close v2 B-tree") storage_src->u.btree2.bt2 = NULL; /* Close v2 B-tree for destination file */ - if(H5B2_close(storage_dst->u.btree2.bt2, dxpl_id) < 0) + if(H5B2_close(storage_dst->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close v2 B-tree") storage_dst->u.btree2.bt2 = NULL; @@ -1466,12 +1449,12 @@ H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) bt2_cdset = idx_info->storage->u.btree2.bt2; /* Get v2 B-tree size for indexing chunked dataset */ - if(H5B2_size(bt2_cdset, idx_info->dxpl_id, index_size) < 0) + if(H5B2_size(bt2_cdset, index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve v2 B-tree storage info for chunked dataset") done: /* Close v2 B-tree index */ - if(bt2_cdset && H5B2_close(bt2_cdset, idx_info->dxpl_id) < 0) + if(bt2_cdset && H5B2_close(bt2_cdset) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for tracking chunked dataset") idx_info->storage->u.btree2.bt2 = NULL; @@ -1564,7 +1547,7 @@ H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch v2 B-tree file pointer") /* Close v2 B-tree */ - if(H5B2_close(idx_info->storage->u.btree2.bt2, idx_info->dxpl_id) < 0) + if(H5B2_close(idx_info->storage->u.btree2.bt2) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree") idx_info->storage->u.btree2.bt2 = NULL; } /* end if */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index be3b678..5e6047a 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -52,6 +52,7 @@ #ifdef H5_HAVE_PARALLEL #include "H5ACprivate.h" /* Metadata cache */ #endif /* H5_HAVE_PARALLEL */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File functions */ @@ -213,7 +214,6 @@ typedef struct H5D_chunk_it_ud5_t { typedef struct H5D_chunk_readvv_ud_t { unsigned char *rbuf; /* Read buffer to initialize */ const H5D_t *dset; /* Dataset to operate on */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_chunk_readvv_ud_t; /* Callback info for file selection iteration */ @@ -238,8 +238,7 @@ typedef struct H5D_chunk_coll_info_t { /* Chunked layout operation callbacks */ static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +static herr_t H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); @@ -249,9 +248,9 @@ static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *typ static herr_t H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__chunk_flush(H5D_t *dset); static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm); -static herr_t H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__chunk_dest(H5D_t *dset); /* "Nonexistent" layout operation callback */ static ssize_t @@ -285,22 +284,20 @@ static herr_t H5D__chunk_file_cb(void *elem, const H5T_t *type, unsigned ndims, static herr_t H5D__chunk_mem_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *fm); static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); -static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); -static herr_t H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t flush); +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t reset); +static herr_t H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t flush); static hbool_t H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims, const hsize_t *chunk_scaled, const hsize_t *dset_dims); static void *H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk); static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, - const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, - uint32_t naccessed); -static herr_t H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, size_t size); + const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); +static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size); static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); #ifdef H5_HAVE_PARALLEL -static herr_t H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, +static herr_t H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf); #endif /* H5_HAVE_PARALLEL */ @@ -383,8 +380,8 @@ H5FL_EXTERN(H5S_sel_iter_t); *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, - hsize_t *offset, uint32_t data_size, const void *buf) +H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, + uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -392,35 +389,25 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, H5D_chk_idx_info_t idx_info; /* Chunked index info */ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ - H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ - hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ + H5D_io_info_t io_info; /* to hold the dset info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) io_info.dset = dset; - io_info.raw_dxpl_id = dxpl_id; - io_info.md_dxpl_id = dxpl_id; - - /* set the dxpl IO type for sanity checking at the FD layer */ -#ifdef H5_DEBUG_BUILD - if(H5D_set_io_info_dxpls(&io_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") - md_dxpl_generated = TRUE; -#endif /* H5_DEBUG_BUILD */ /* Allocate dataspace and initialize it if it hasn't been. */ - if(!(*layout->ops->is_space_alloc)(&layout->storage)) { + if(!(*layout->ops->is_space_alloc)(&layout->storage)) /* Allocate storage */ if(H5D__alloc_storage(&io_info, H5D_ALLOC_WRITE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") - } + /* Calculate the index of this chunk */ H5VM_chunk_scaled(dset->shared->ndims, offset, layout->u.chunk.dim, scaled); scaled[dset->shared->ndims] = 0; /* Find out the file address of the chunk (if any) */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -438,7 +425,6 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = io_info.md_dxpl_id; idx_info.pline = &(dset->shared->dcpl_cache.pline); idx_info.layout = &(dset->shared->layout.u.chunk); idx_info.storage = &(dset->shared->layout.storage.u.chunk); @@ -446,17 +432,15 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Set up the size of chunk for user data */ udata.chunk_block.length = data_size; - if (0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) { + if(0 == idx_info.pline->nused && H5F_addr_defined(old_chunk.offset)) /* If there are no filters and we are overwriting the chunk we can just set values */ need_insert = FALSE; - } - else { + else /* Otherwise, create the chunk it if it doesn't exist, or reallocate the chunk * if its size has changed. */ - if (H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) + if(H5D__chunk_file_alloc(&idx_info, &old_chunk, &udata.chunk_block, &need_insert, scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate chunk") - } /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) @@ -465,20 +449,14 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, /* Evict the (old) entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != udata.idx_hint) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], FALSE) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") } /* end if */ /* Write the data to the file */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, io_info.raw_dxpl_id, buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, data_size, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ @@ -491,11 +469,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, } /* end if */ done: -#ifdef H5_DEBUG_BUILD - if(md_dxpl_generated && H5I_dec_ref(io_info.md_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") -#endif /* H5_DEBUG_BUILD */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_direct_write() */ @@ -512,20 +486,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, - uint32_t* filters, void *buf) +H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t* filters, + void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ - H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -535,17 +505,6 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, *filters = 0; - io_info.dset = dset; - io_info.raw_dxpl_id = dxpl_id; - io_info.md_dxpl_id = dxpl_id; - - /* set the dxpl IO type for sanity checking at the FD layer */ -#ifdef H5_DEBUG_BUILD - if(H5D_set_io_info_dxpls(&io_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") - md_dxpl_generated = TRUE; -#endif /* H5_DEBUG_BUILD */ - /* Allocate dataspace and initialize it if it hasn't been. */ if(!(*layout->ops->is_space_alloc)(&layout->storage)) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "storage is not initialized") @@ -561,7 +520,7 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, udata.idx_hint = UINT_MAX; /* Find out the file address of the chunk */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -579,12 +538,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, flush = (ent->dirty == TRUE) ? TRUE : FALSE; - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(io_info.raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], flush) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], flush) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") /* Reset fields about the chunk we are looking for */ @@ -594,27 +549,23 @@ H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, udata.idx_hint = UINT_MAX; /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } + } /* end if */ /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") /* Read the chunk data into the supplied buffer */ - if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, io_info.raw_dxpl_id, buf) < 0) + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, udata.chunk_block.length, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Return the filter mask */ *filters = udata.filter_mask; done: -#ifdef H5_DEBUG_BUILD - if(md_dxpl_generated && H5I_dec_ref(io_info.md_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") -#endif /* H5_DEBUG_BUILD */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__chunk_direct_read() */ @@ -631,19 +582,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size) +H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage_size) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ hsize_t scaled[H5S_MAX_RANK]; /* Scaled coordinates for this chunk */ - H5D_io_info_t io_info; /* to hold the dset and two dxpls (meta and raw data) */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ - hbool_t md_dxpl_generated = FALSE; /* bool to indicate whether we should free the md_dxpl_id at exit */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -652,17 +599,6 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h *storage_size = 0; - io_info.dset = dset; - io_info.raw_dxpl_id = dxpl_id; - io_info.md_dxpl_id = dxpl_id; - - /* set the dxpl IO type for sanity checking at the FD layer */ -#ifdef H5_DEBUG_BUILD - if(H5D_set_io_info_dxpls(&io_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") - md_dxpl_generated = TRUE; -#endif /* H5_DEBUG_BUILD */ - /* Allocate dataspace and initialize it if it hasn't been. */ if(!(*layout->ops->is_space_alloc)(&layout->storage)) HGOTO_DONE(SUCCEED) @@ -677,7 +613,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h udata.idx_hint = UINT_MAX; /* Find out the file address of the chunk */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -700,12 +636,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h /* If the cached chunk is dirty, it must be flushed to get accurate size */ if( ent->dirty == TRUE ) { - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Flush the chunk to disk and clear the cache entry */ - if(H5D__chunk_cache_evict(dset, io_info.md_dxpl_id, dxpl_cache, rdcc->slot[udata.idx_hint], TRUE) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[udata.idx_hint], TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") /* Reset fields about the chunk we are looking for */ @@ -714,10 +646,10 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h udata.idx_hint = UINT_MAX; /* Get the new file address / chunk size after flushing */ - if(H5D__chunk_lookup(dset, io_info.md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - } - } + } /* end if */ + } /* end if */ /* Make sure the address of the chunk is returned. */ if(!H5F_addr_defined(udata.chunk_block.offset)) @@ -731,11 +663,7 @@ H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, h *storage_size = dset->shared->layout.u.chunk.size; done: -#ifdef H5_DEBUG_BUILD - if(md_dxpl_generated && H5I_dec_ref(io_info.md_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") -#endif /* H5_DEBUG_BUILD */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* H5D__get_chunk_storage_size */ @@ -965,7 +893,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) +H5D__chunk_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ @@ -1034,7 +962,6 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) /* Compose chunked index info struct */ idx_info.f = f; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -1369,7 +1296,7 @@ done: if(iter_init && H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") - if(file_type && (H5T_close(file_type) < 0)) + if(file_type && (H5T_close_real(file_type) < 0)) HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Can't free temporary datatype") if(file_space_normalized) { /* (Casting away const OK -QAK) */ @@ -2272,7 +2199,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -2405,7 +2332,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Look up the chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ @@ -2448,7 +2375,6 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, if(!H5F_addr_defined(udata.chunk_block.offset)) { /* Compose chunked index info struct */ idx_info.f = io_info->dset->oloc.file; - idx_info.dxpl_id = io_info->md_dxpl_id; idx_info.pline = &(io_info->dset->shared->dcpl_cache.pline); idx_info.layout = &(io_info->dset->shared->layout.u.chunk); idx_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); @@ -2517,10 +2443,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_flush(H5D_t *dset) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); H5D_rdcc_ent_t *ent, *next; unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ @@ -2531,14 +2455,10 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) /* Sanity check */ HDassert(dset); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { next = ent->next; - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) @@ -2614,31 +2534,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_dest(H5D_t *dset) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */ H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */ int nerrors = 0; /* Accumulated count of errors */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dset->oloc.addr) /* Sanity checks */ HDassert(dset); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - nerrors++; - /* Flush all the cached chunks */ for(ent = rdcc->head; ent; ent = next) { next = ent->next; - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0) nerrors++; } /* end for */ @@ -2653,7 +2567,6 @@ H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -2664,7 +2577,7 @@ H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_dest() */ @@ -2830,7 +2743,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) +H5D__chunk_create(const H5D_t *dset /*in,out*/) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); @@ -2855,7 +2768,6 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -2930,7 +2842,7 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, +H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata) { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ @@ -3001,7 +2913,6 @@ H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *scaled, /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -3052,20 +2963,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, - H5D_rdcc_ent_t *ent, hbool_t reset) +H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) { void *buf = NULL; /* Temporary buffer */ hbool_t point_of_no_return = FALSE; H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dset->oloc.addr) HDassert(dset); HDassert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(dxpl_cache); HDassert(ent); HDassert(!ent->locked); @@ -3088,8 +2997,16 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Should the chunk be filtered before writing it to disk? */ if(dset->shared->dcpl_cache.pline.nused && !(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t alloc = udata.chunk_block.length; /* Bytes allocated for BUF */ - size_t nbytes; /* Chunk size (in bytes) */ + size_t nbytes; /* Chunk size (in bytes) */ + + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") if(!reset) { /* @@ -3113,9 +3030,9 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t ent->chunk = NULL; } /* end else */ H5_CHECKED_ASSIGN(nbytes, size_t, udata.chunk_block.length, hsize_t); - if(H5Z_pipeline(&(dset->shared->dcpl_cache.pline), 0, &(udata.filter_mask), dxpl_cache->err_detect, - dxpl_cache->filter_cb, &nbytes, &alloc, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "output pipeline failed") + if(H5Z_pipeline(&(dset->shared->dcpl_cache.pline), 0, &(udata.filter_mask), + err_detect, filter_cb, &nbytes, &alloc, &buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFILTER, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ if(nbytes > ((size_t)0xffffffff)) @@ -3153,7 +3070,6 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t if(must_alloc) { /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -3172,7 +3088,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t /* Write the data to the file */ HDassert(H5F_addr_defined(udata.chunk_block.offset)); H5_CHECK_OVERFLOW(udata.chunk_block.length, hsize_t, size_t); - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Insert the chunk record into the index */ @@ -3218,7 +3134,7 @@ done: ((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS) ? NULL : &(dset->shared->dcpl_cache.pline))); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_flush_entry() */ @@ -3236,23 +3152,23 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, - H5D_rdcc_ent_t *ent, hbool_t flush) +H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, + hbool_t flush) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(dset); - HDassert(dxpl_cache); HDassert(ent); HDassert(!ent->locked); HDassert(ent->idx < rdcc->nslots); if(flush) { /* Flush */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_flush_entry(dset, ent, TRUE) < 0) HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { @@ -3317,8 +3233,7 @@ H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, - const H5D_dxpl_cache_t *dxpl_cache, size_t size) +H5D__chunk_cache_prune(const H5D_t *dset, size_t size) { const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); size_t total = rdcc->nbytes_max; @@ -3390,7 +3305,7 @@ H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, if(n[j] == cur) n[j] = cur->next; } /* end for */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, cur, TRUE) < 0) nerrors++; } /* end if */ } /* end for */ @@ -3457,13 +3372,11 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, FUNC_ENTER_STATIC + /* Sanity checks */ HDassert(io_info); - HDassert(io_info->dxpl_cache); HDassert(io_info->store); HDassert(udata); HDassert(dset); - HDassert(TRUE == H5P_isa_class(io_info->md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); HDassert(!(udata->new_unfilt_chunk && prev_unfilt_chunk)); HDassert(!rdcc->tmp_head); @@ -3647,16 +3560,22 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, * size in memory, so allocate memory big enough. */ if(NULL == (chunk = H5D__chunk_mem_alloc(my_chunk_alloc, (udata->new_unfilt_chunk ? old_pline : pline)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") - if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, io_info->raw_dxpl_id, chunk) < 0) + if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, my_chunk_alloc, chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") if(old_pline && old_pline->nused) { - if(H5Z_pipeline(old_pline, H5Z_FLAG_REVERSE, - &(udata->filter_mask), - io_info->dxpl_cache->err_detect, - io_info->dxpl_cache->filter_cb, - &my_chunk_alloc, &buf_alloc, &chunk) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, NULL, "data pipeline read failed") + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ + + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get I/O filter callback function") + + if(H5Z_pipeline(old_pline, H5Z_FLAG_REVERSE, &(udata->filter_mask), + err_detect, filter_cb, &my_chunk_alloc, &buf_alloc, &chunk) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFILTER, NULL, "data pipeline read failed") /* Reallocate chunk if necessary */ if(udata->new_unfilt_chunk) { @@ -3701,14 +3620,14 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* (use the compact dataset storage buffer as the fill value buffer) */ if(H5D__fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, chunk_size, io_info->md_dxpl_id) < 0) + dset->shared->type_id, (size_t)0, chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "can't refill fill value buffer") } /* end if */ else @@ -3729,10 +3648,10 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, if(!ent || !ent->locked) { /* Preempt enough things from the cache to make room */ if(ent) { - if(H5D__chunk_cache_evict(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(io_info->dset, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") } /* end if */ - if(H5D__chunk_cache_prune(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, chunk_size) < 0) + if(H5D__chunk_cache_prune(io_info->dset, chunk_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") /* Create a new entry */ @@ -3882,7 +3801,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, fake_ent.chunk_block.length = udata->chunk_block.length; fake_ent.chunk = (uint8_t *)chunk; - if(H5D__chunk_flush_entry(io_info->dset, io_info->md_dxpl_id, io_info->dxpl_cache, &fake_ent, TRUE) < 0) + if(H5D__chunk_flush_entry(io_info->dset, &fake_ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { @@ -3959,13 +3878,11 @@ H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) +H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ H5D_rdcc_ent_t *ent; /* Cache entry */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -3976,20 +3893,14 @@ H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) HDassert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Search for cached chunks that haven't been written out */ - for(ent = rdcc->head; ent; ent = ent->next) { + for(ent = rdcc->head; ent; ent = ent->next) /* Flush the chunk out to disk, to make certain the size is correct later */ - if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, ent, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") - } /* end for */ /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -4040,15 +3951,11 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t should_fill = FALSE; /* Whether fill values should be written */ void *unfilt_fill_buf = NULL; /* Unfiltered fill value buffer */ void **fill_buf = NULL; /* Pointer to the fill buffer to use for a chunk */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ #ifdef H5_HAVE_PARALLEL hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ H5D_chunk_coll_info_t chunk_info; /* chunk address information for doing I/O */ #endif /* H5_HAVE_PARALLEL */ - hid_t md_dxpl_id = io_info->md_dxpl_id; - hid_t raw_dxpl_id = io_info->raw_dxpl_id; hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ unsigned space_ndims; /* Dataset's space rank */ const hsize_t *space_dim; /* Dataset's dataspace dimensions */ @@ -4063,14 +3970,12 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(md_dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(TRUE == H5P_isa_class(md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(raw_dxpl_id, H5P_DATASET_XFER)); /* Retrieve the dataset dimensions */ space_dim = dset->shared->curr_dims; @@ -4100,10 +4005,6 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ #endif /* H5_HAVE_PARALLEL */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Calculate the minimum and maximum chunk offsets in each dimension, and * determine if there are any unfiltered partial edge chunks. Note that we * assume here that all elements of space_dim are > 0. This is checked at @@ -4154,7 +4055,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ if(H5D__fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D__chunk_mem_alloc, (void *)pline, (H5MM_free_t)H5D__chunk_mem_xfree, (void *)pline, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, orig_chunk_size, md_dxpl_id) < 0) + dset->shared->type_id, (size_t)0, orig_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; @@ -4168,6 +4069,8 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ * it doesn't contain any non-default VL datatype fill values) */ if(!fb_info.has_vlen_fill_type && pline->nused > 0) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t buf_size = orig_chunk_size; /* If the dataset has disabled partial chunk filters, create a copy @@ -4178,8 +4081,14 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ HDmemcpy(unfilt_fill_buf, fb_info.fill_buf, orig_chunk_size); } /* end if */ + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) + if(H5Z_pipeline(pline, 0, &filter_mask, err_detect, filter_cb, &orig_chunk_size, &buf_size, &fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ @@ -4191,7 +4100,6 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = md_dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -4261,7 +4169,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ hbool_t need_insert = FALSE; /* Whether the chunk needs to be inserted into the index */ /* Look up this chunk */ - if(H5D__chunk_lookup(dset, md_dxpl_id, scaled, &udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") #ifndef NDEBUG /* None of the chunks should be allocated */ @@ -4302,15 +4210,23 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Check if there are filters which need to be applied to the chunk */ if((pline->nused > 0) && !nunfilt_edge_chunk_dims) { + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ size_t nbytes = orig_chunk_size; + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* Push the chunk through the filters */ - if(H5Z_pipeline(pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &fb_info.fill_buf_size, &fb_info.fill_buf) < 0) + if(H5Z_pipeline(pline, 0, &filter_mask, err_detect, filter_cb, &nbytes, &fb_info.fill_buf_size, &fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 @@ -4369,7 +4285,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, raw_dxpl_id, *fill_buf) < 0) + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, udata.chunk_block.offset, chunk_size, *fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -4433,7 +4349,7 @@ H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_ #ifdef H5_HAVE_PARALLEL /* do final collective I/O */ if(using_mpi && blocks_written) - if(H5D__chunk_collective_fill(dset, raw_dxpl_id, &chunk_info, chunk_size, fb_info.fill_buf) < 0) + if(H5D__chunk_collective_fill(dset, &chunk_info, chunk_size, fb_info.fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") #endif /* H5_HAVE_PARALLEL */ @@ -4453,7 +4369,7 @@ done: H5MM_free(chunk_info.addr); #endif - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__chunk_allocate() */ @@ -4474,7 +4390,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) +H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) { hsize_t old_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* Offset of first previously incomplete chunk in each dimension */ hsize_t max_edge_chunk_sc[H5O_LAYOUT_NDIMS]; /* largest offset of chunks that might need to be modified in each dimension */ @@ -4489,8 +4405,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ H5D_storage_t chk_store; /* Chunk storage information */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ void *chunk; /* The file chunk */ hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ const H5O_storage_chunk_t *sc = &(layout->storage.u.chunk); @@ -4502,7 +4416,6 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(pline->nused > 0); HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); @@ -4526,15 +4439,12 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) /* * Initialize structures needed to lock chunks into cache */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Set up chunked I/O info object, for operations on chunks (in callback). * Note that we only need to set chunk_offset once, as the array's address * will never change. */ chk_store.chunk.scaled = chunk_sc; - H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, H5AC_rawdata_dxpl_id, &chk_store, NULL); + H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, &chk_store, NULL); /* * Determine the edges of the dataset which need to be modified @@ -4587,7 +4497,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) && !H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, space_dim)); /* Lookup the chunk */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_sc, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, chunk_sc, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* If this chunk does not exist in cache or on disk, no need to do @@ -4652,8 +4562,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, - H5D_chunk_coll_info_t *chunk_info, size_t chunk_size, const void *fill_buf) +H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, + size_t chunk_size, const void *fill_buf) { MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ @@ -4665,7 +4575,8 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, MPI_Aint *chunk_disp_array = NULL; int *block_lens = NULL; MPI_Datatype mem_type, file_type; - hid_t data_dxpl_id = -1; /* DXPL ID to use for raw data I/O operations */ + H5FD_mpio_xfer_t prev_xfer_mode; /* Previous data xfer mode */ + hbool_t have_xfer_mode = FALSE; /* Whether the previous xffer mode has been retrieved */ int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4683,10 +4594,6 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, if((mpi_size = H5F_mpi_get_size(dset->oloc.file)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI size") - /* Get a copy of the DXPL, to modify */ - if((data_dxpl_id = H5P_copy_plist((H5P_genplist_t *)H5I_object(dxpl_id), TRUE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "can't copy property list") - /* Distribute evenly the number of blocks between processes. */ num_blocks = chunk_info->num_io / mpi_size; /* value should be the same on all procs */ @@ -4745,29 +4652,23 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&mem_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) - /* set MPI-IO VFD properties */ - { - H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; - H5P_genplist_t *plist; /* Property list pointer */ + /* Set MPI-IO VFD properties */ - if(NULL == (plist = H5P_object_verify(data_dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") + /* Set MPI datatypes for operation */ + if(H5CX_set_mpi_coll_datatypes(mem_type, file_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - /* Set buffer MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &mem_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + /* Get current transfer mode */ + if(H5CX_get_io_xfer_mode(&prev_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") + have_xfer_mode = TRUE; - /* Set File MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + /* Set transfer mode */ + if(H5CX_set_io_xfer_mode(H5FD_MPIO_COLLECTIVE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") - /* set transfer mode */ - if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - } - - /* low level write (collective) */ - if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, data_dxpl_id, fill_buf) < 0) + /* Low-level write (collective) */ + if(H5F_block_write(dset->oloc.file, H5FD_MEM_DRAW, (haddr_t)0, (blocks) ? (size_t)1 : (size_t)0, fill_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Barrier so processes don't race ahead */ @@ -4775,8 +4676,10 @@ H5D__chunk_collective_fill(const H5D_t *dset, hid_t dxpl_id, HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code) done: - if(data_dxpl_id > 0 && H5I_dec_ref(data_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't free property list") + if(have_xfer_mode) + /* Set transfer mode */ + if(H5CX_set_io_xfer_mode(prev_xfer_mode) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set transfer mode") /* free things */ if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&file_type))) @@ -4830,7 +4733,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(dset, io_info->md_dxpl_id, scaled, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") chk_udata.new_unfilt_chunk = new_unfilt_chunk; @@ -4844,7 +4747,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) if(H5D__fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, - chunk_size, io_info->md_dxpl_id) < 0) + chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") udata->fb_info_init = TRUE; } /* end if */ @@ -4881,7 +4784,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Check for VL datatype & non-default fill value */ if(udata->fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D__fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts, io_info->md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Allocate the chunk selection iterator */ @@ -4894,7 +4797,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) chunk_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D__scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) + if(H5D__scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, chunk_iter, (size_t)sel_nelmts, chunk/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") @@ -5018,7 +4921,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) +H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) { hsize_t min_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of first chunk to modify in each dimension */ hsize_t max_mod_chunk_sc[H5O_LAYOUT_NDIMS]; /* Scaled offset of last chunk to modify in each dimension */ @@ -5029,8 +4932,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_io_info_t chk_io_info; /* Chunked I/O info object */ H5D_storage_t chk_store; /* Chunk storage information */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ unsigned space_ndims; /* Dataset's space rank */ @@ -5057,11 +4958,6 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDassert(dset && H5D_CHUNKED == layout->type); HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(dxpl_cache); - - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Go get the rank & dimensions (including the element size) */ space_dim = dset->shared->curr_dims; @@ -5102,11 +4998,10 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) * Note that we only need to set scaled once, as the array's address * will never change. */ chk_store.chunk.scaled = scaled; - H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, dxpl_cache, dxpl_id, H5AC_rawdata_dxpl_id, &chk_store, NULL); + H5D_BUILD_IO_INFO_RD(&chk_io_info, dset, &chk_store, NULL); /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -5265,13 +5160,13 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D__chunk_lookup(dset, dxpl_id, scaled, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, scaled, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != chk_udata.idx_hint) - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) + if(H5D__chunk_cache_evict(dset, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") /* Remove the chunk from disk, if present */ @@ -5417,7 +5312,6 @@ H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = io_info->md_dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -5446,7 +5340,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) +H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_layout_t layout; /* Dataset layout message */ @@ -5469,7 +5363,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to check for object header message") else if(exists) { - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_PLINE_ID, &pline)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O pipeline message") pline_read = TRUE; } /* end else if */ @@ -5480,7 +5374,7 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) if((exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to check for object header message") else if(exists) { - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + if(NULL == H5O_msg_read_oh(f, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message") layout_read = TRUE; } /* end else if */ @@ -5489,7 +5383,6 @@ H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) /* Compose chunked index info struct */ idx_info.f = f; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; idx_info.layout = &layout.u.chunk; idx_info.storage = &storage->u.chunk; @@ -5526,14 +5419,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_update_cache(H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent, *next; /*cache entry */ H5D_rdcc_ent_t tmp_head; /* Sentinel entry for temporary entry list */ H5D_rdcc_ent_t *tmp_tail; /* Tail pointer for temporary entry list */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -5545,10 +5436,6 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) /* Check the rank */ HDassert((dset->shared->layout.u.chunk.ndims - 1) > 1); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Add temporary entry list to rdcc */ (void)HDmemset(&tmp_head, 0, sizeof(tmp_head)); rdcc->tmp_head = &tmp_head; @@ -5618,7 +5505,7 @@ H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) ent = tmp_head.tmp_next; /* Remove the old entry from the cache */ - if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") } /* end while */ @@ -5664,7 +5551,6 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_STATIC /* Get 'size_t' local value for number of bytes in chunk */ @@ -5756,7 +5642,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) } else { /* read chunk data from the source file */ - if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") } } @@ -5782,7 +5668,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Convert from source file to memory */ H5_CHECK_OVERFLOW(udata->nelmts, uint32_t, size_t); - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, bkg, udata->idx_info_dst->dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -5792,11 +5678,11 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg, udata->idx_info_dst->dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed") /* Reclaim space from variable length data */ - if(H5D_vlen_reclaim(tid_mem, buf_space, udata->idx_info_dst->dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, H5_ITER_ERROR, "unable to reclaim variable-length data") } /* end if */ else if(fix_ref) { @@ -5809,7 +5695,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) ref_count = nbytes / H5T_get_size(udata->dt_src); /* Copy the reference elements */ - if(H5O_copy_expand_ref(udata->file_src, buf, udata->idx_info_dst->dxpl_id, udata->idx_info_dst->f, bkg, ref_count, H5T_get_ref_type(udata->dt_src), udata->cpy_info) < 0) + if(H5O_copy_expand_ref(udata->file_src, buf, udata->idx_info_dst->f, bkg, ref_count, H5T_get_ref_type(udata->dt_src), udata->cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy reference attribute") } /* end if */ @@ -5850,19 +5736,19 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Write chunk data to destination file */ HDassert(H5F_addr_defined(udata_dst.chunk_block.offset)); - if(H5F_block_write(udata->idx_info_dst->f, H5FD_MEM_DRAW, udata_dst.chunk_block.offset, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_write(udata->idx_info_dst->f, H5FD_MEM_DRAW, udata_dst.chunk_block.offset, nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(udata->idx_info_dst->dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert chunk record into index */ if(need_insert && udata->idx_info_dst->storage->ops->insert) if((udata->idx_info_dst->storage->ops->insert)(udata->idx_info_dst, &udata_dst, NULL) < 0) HGOTO_ERROR_TAG(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(H5_ITER_ERROR); + /* Reset metadata tag in API context */ + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -5886,7 +5772,7 @@ herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, - const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id) + const H5O_pline_t *pline_src, H5O_copy_t *cpy_info) { H5D_chunk_it_ud3_t udata; /* User data for iteration callback */ H5D_chk_idx_info_t idx_info_dst; /* Dest. chunked index info */ @@ -5953,13 +5839,11 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, /* Compose source & dest chunked index info structs */ idx_info_src.f = f_src; - idx_info_src.dxpl_id = dxpl_id; idx_info_src.pline = pline; idx_info_src.layout = layout_src; idx_info_src.storage = storage_src; idx_info_dst.f = f_dst; - idx_info_dst.dxpl_id = dxpl_id; idx_info_dst.pline = pline; /* Use same I/O filter pipeline for dest. */ idx_info_dst.layout = layout_src /* Use same layout for dest. */; idx_info_dst.storage = storage_dst; @@ -5987,7 +5871,7 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - (void)H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -5995,18 +5879,18 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - (void)H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - (void)H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -6148,7 +6032,7 @@ done: /* Clean up any index information */ if(copy_setup_done) - if(storage_src->ops->copy_shutdown && (storage_src->ops->copy_shutdown)(storage_src, storage_dst, dxpl_id) < 0) + if(storage_src->ops->copy_shutdown && (storage_src->ops->copy_shutdown)(storage_src, storage_dst) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to shut down index copying info") FUNC_LEAVE_NOAPI(ret_value) @@ -6169,7 +6053,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t *layout, +H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *index_size) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -6195,7 +6079,7 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header") else if(exists) { - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_PLINE_ID, &pline)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_PLINE_ID, &pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't find I/O pipeline message") pline_read = TRUE; } /* end else if */ @@ -6204,13 +6088,12 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5O_layout_t /* Compose chunked index info struct */ idx_info.f = loc->file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &pline; idx_info.layout = &layout->u.chunk; idx_info.storage = &layout->storage.u.chunk; /* Get the dataspace for the dataset */ - if(NULL == (space = H5S_read(loc, dxpl_id))) + if(NULL == (space = H5S_read(loc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Allocate any indexing structures */ @@ -6296,7 +6179,7 @@ H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) +H5D__chunk_dump_index(H5D_t *dset, FILE *stream) { H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); herr_t ret_value = SUCCEED; /* Return value */ @@ -6318,7 +6201,6 @@ H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dset->shared->dcpl_cache.pline; idx_info.layout = &dset->shared->layout.u.chunk; idx_info.storage = &dset->shared->layout.storage.u.chunk; @@ -6435,12 +6317,12 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size /* Initialize the fill value buffer */ if(H5D__fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, - udata->dset->shared->type_id, (size_t)0, len, udata->dxpl_id) < 0) + udata->dset->shared->type_id, (size_t)0, len) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & fill the buffer with VL datatype fill values */ - if(fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, udata->dxpl_id) < 0) + if(fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: @@ -6494,7 +6376,6 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info, /* Set up user data for H5VM_opvv() */ udata.rbuf = (unsigned char *)io_info->u.rbuf; udata.dset = io_info->dset; - udata.dxpl_id = io_info->md_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, @@ -6617,7 +6498,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old * outdated version of the B-tree node */ if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, old_chunk->offset, old_chunk->length) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, old_chunk->offset, old_chunk->length) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") alloc_chunk = TRUE; } /* end if */ @@ -6660,7 +6541,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old case H5D_CHUNK_IDX_SINGLE: HDassert(new_chunk->length > 0); H5_CHECK_OVERFLOW(new_chunk->length, /*From: */uint32_t, /*To: */hsize_t); - new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, (hsize_t)new_chunk->length); + new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, (hsize_t)new_chunk->length); if(!H5F_addr_defined(new_chunk->offset)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed") *need_insert = TRUE; @@ -6734,7 +6615,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") /* Read the non-filtered edge chunk */ - if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") /* Pass the chunk through the pipeline */ @@ -6748,12 +6629,12 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) #endif /* H5_SIZEOF_SIZE_T > 4 */ /* Allocate space for the filtered chunk */ - if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, (hsize_t)nbytes)) == HADDR_UNDEF) HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") HDassert(H5F_addr_defined(chunk_addr)); /* Write the filtered chunk to disk */ - if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 43e7754..c0c2a80 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -67,8 +67,8 @@ static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, static ssize_t H5D__compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D__compact_flush(H5D_t *dset, hid_t dxpl_id); -static herr_t H5D__compact_dest(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__compact_flush(H5D_t *dset); +static herr_t H5D__compact_dest(H5D_t *dset); /*********************/ @@ -117,7 +117,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) +H5D__compact_fill(const H5D_t *dset) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ @@ -126,7 +126,6 @@ H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_COMPACT == dset->shared->layout.type); HDassert(dset->shared->layout.storage.u.compact.buf); HDassert(dset->shared->type); @@ -137,14 +136,14 @@ H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) if(H5D__fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size, dxpl_id) < 0) + dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: @@ -357,7 +356,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) +H5D__compact_flush(H5D_t *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -369,7 +368,7 @@ H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) /* Check if the buffered compact information is dirty */ if(dset->shared->layout.storage.u.compact.dirty) { dset->shared->layout.storage.u.compact.dirty = FALSE; - if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout), dxpl_id) < 0) { + if(H5O_msg_write(&(dset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dset->shared->layout)) < 0) { dset->shared->layout.storage.u.compact.dirty = TRUE; HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") } @@ -393,7 +392,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compact_dest(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) +H5D__compact_dest(H5D_t *dset) { FUNC_ENTER_STATIC_NOERR @@ -421,8 +420,7 @@ H5D__compact_dest(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) */ herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst, - H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, - hid_t dxpl_id) + H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info) { hid_t tid_src = -1; /* Datatype ID for source datatype */ hid_t tid_dst = -1; /* Datatype ID for destination datatype */ @@ -470,7 +468,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -478,18 +476,18 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -537,7 +535,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Convert from source file to memory */ - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -547,12 +545,12 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") HDmemcpy(storage_dst->buf, buf, storage_dst->size); - if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") } /* end if */ else if(H5T_get_class(dt_src, FALSE) == H5T_REFERENCE) { @@ -565,7 +563,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds ref_count = storage_src->size / H5T_get_size(dt_src); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(f_src, storage_src->buf, dxpl_id, f_dst, + if(H5O_copy_expand_ref(f_src, storage_src->buf, f_dst, storage_dst->buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index aab4901..768e9c0 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -32,6 +32,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -60,7 +61,6 @@ typedef struct H5D_contig_readvv_sieve_ud_t { H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ unsigned char *rbuf; /* Pointer to buffer to fill */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_readvv_sieve_ud_t; /* Callback info for [plain] readvv operation */ @@ -68,7 +68,6 @@ typedef struct H5D_contig_readvv_ud_t { H5F_t *file; /* File for dataset */ haddr_t dset_addr; /* Address of dataset */ unsigned char *rbuf; /* Pointer to buffer to fill */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_readvv_ud_t; /* Callback info for sieve buffer writevv operation */ @@ -77,7 +76,6 @@ typedef struct H5D_contig_writevv_sieve_ud_t { H5D_rdcdc_t *dset_contig; /* Cached information about contiguous data */ const H5D_contig_storage_t *store_contig; /* Contiguous storage info for this I/O operation */ const unsigned char *wbuf; /* Pointer to buffer to write */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_writevv_sieve_ud_t; /* Callback info for [plain] writevv operation */ @@ -85,7 +83,6 @@ typedef struct H5D_contig_writevv_ud_t { H5F_t *file; /* File for dataset */ haddr_t dset_addr; /* Address of dataset */ const unsigned char *wbuf; /* Pointer to buffer to write */ - hid_t dxpl_id; /* DXPL for operation */ } H5D_contig_writevv_ud_t; @@ -95,8 +92,7 @@ typedef struct H5D_contig_writevv_ud_t { /* Layout operation callbacks */ static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D__contig_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +static herr_t H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); @@ -106,7 +102,7 @@ static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, static ssize_t H5D__contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D__contig_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__contig_flush(H5D_t *dset); /* Helper routines */ static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, hsize_t offset, @@ -162,7 +158,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ ) +H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage /*out */ ) { herr_t ret_value = SUCCEED; /* Return value */ @@ -173,7 +169,7 @@ H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out * HDassert(storage); /* Allocate space for the contiguous data */ - if(HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, storage->size))) + if(HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, storage->size))) HGOTO_ERROR(H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space") done: @@ -199,11 +195,10 @@ H5D__contig_fill(const H5D_io_info_t *io_info) const H5D_t *dset = io_info->dset; /* the dataset pointer */ H5D_io_info_t ioinfo; /* Dataset I/O info */ H5D_storage_t store; /* Union of storage info for dataset */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hssize_t snpoints; /* Number of points in space (for error checking) */ size_t npoints; /* Number of points in space */ hsize_t offset; /* Offset of dataset */ + size_t max_temp_buf; /* Maximum size of temporary buffer */ #ifdef H5_HAVE_PARALLEL MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ @@ -211,8 +206,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) hbool_t blocks_written = FALSE; /* Flag to indicate that chunk was actually written */ hbool_t using_mpi = FALSE; /* Flag to indicate that the file is being accessed with an MPI-capable file driver */ #endif /* H5_HAVE_PARALLEL */ - hid_t md_dxpl_id = io_info->md_dxpl_id; - hid_t raw_dxpl_id = io_info->raw_dxpl_id; H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ @@ -220,8 +213,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(TRUE == H5P_isa_class(md_dxpl_id, H5P_DATASET_XFER)); - HDassert(TRUE == H5P_isa_class(raw_dxpl_id, H5P_DATASET_XFER)); HDassert(dset && H5D_CONTIGUOUS == dset->shared->layout.type); HDassert(H5F_addr_defined(dset->shared->layout.storage.u.contig.addr)); HDassert(dset->shared->layout.storage.u.contig.size > 0); @@ -244,10 +235,6 @@ H5D__contig_fill(const H5D_io_info_t *io_info) } /* end if */ #endif /* H5_HAVE_PARALLEL */ - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(raw_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Initialize storage info for this dataset */ store.contig.dset_addr = dset->shared->layout.storage.u.contig.addr; store.contig.dset_size = dset->shared->layout.storage.u.contig.size; @@ -257,11 +244,14 @@ H5D__contig_fill(const H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "dataset has negative number of elements") H5_CHECKED_ASSIGN(npoints, size_t, snpoints, hssize_t); + /* Get the maximum size of temporary buffers */ + if(H5CX_get_max_temp_buf(&max_temp_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve max. temp. buf size") + /* Initialize the fill value buffer */ if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, - dset->shared->type, dset->shared->type_id, npoints, - dxpl_cache->max_temp_buf, md_dxpl_id) < 0) + dset->shared->type, dset->shared->type_id, npoints, max_temp_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; @@ -269,7 +259,7 @@ H5D__contig_fill(const H5D_io_info_t *io_info) offset = 0; /* Simple setup for dataset I/O info struct */ - H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, dxpl_cache, H5AC_ind_read_dxpl_id, raw_dxpl_id, &store, fb_info.fill_buf); + H5D_BUILD_IO_INFO_WRT(&ioinfo, dset, &store, fb_info.fill_buf); /* * Fill the entire current extent with the fill value. We can do @@ -289,7 +279,7 @@ H5D__contig_fill(const H5D_io_info_t *io_info) /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D__fill_refill_vl(&fb_info, curr_points, md_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, curr_points) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") #ifdef H5_HAVE_PARALLEL @@ -352,7 +342,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) +H5D__contig_delete(H5F_t *f, const H5O_storage_t *storage) { herr_t ret_value = SUCCEED; /* Return value */ @@ -363,7 +353,7 @@ H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) HDassert(storage); /* Free the file space for the chunk */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, storage->u.contig.addr, storage->u.contig.size) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, storage->u.contig.addr, storage->u.contig.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free contiguous storage space") done: @@ -459,8 +449,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__contig_init(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const H5D_t *dset, hid_t H5_ATTR_UNUSED dapl_id) +H5D__contig_init(H5F_t H5_ATTR_UNUSED *f, const H5D_t *dset, + hid_t H5_ATTR_UNUSED dapl_id) { hsize_t tmp_size; /* Temporary holder for raw data size */ size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ @@ -734,7 +724,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, if(NULL == dset_contig->sieve_buf) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(len > dset_contig->sieve_buf_size) { - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ else { @@ -757,7 +747,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, H5_CHECKED_ASSIGN(dset_contig->sieve_size, size_t, min, hsize_t); /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ @@ -793,7 +783,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer, if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -802,7 +792,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, } /* end if */ /* Read directly into the user's buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ /* Element size fits within the buffer size */ @@ -810,7 +800,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -841,7 +831,7 @@ H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, sieve_end = sieve_start + sieve_size; /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") /* Grab the data out of the buffer (must be first piece of data in buffer ) */ @@ -880,7 +870,7 @@ H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata /* Write data */ if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), - len, udata->dxpl_id, (udata->rbuf + src_off)) < 0) + len, (udata->rbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") done: @@ -933,7 +923,6 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); udata.rbuf = (unsigned char *)io_info->u.rbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -948,7 +937,6 @@ H5D__contig_readvv(const H5D_io_info_t *io_info, udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.rbuf = (unsigned char *)io_info->u.rbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1011,7 +999,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, if(NULL == dset_contig->sieve_buf) { /* Check if we can actually hold the I/O request in the sieve buffer */ if(len > dset_contig->sieve_buf_size) { - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ else { @@ -1040,7 +1028,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Check if there is any point in reading the data from the file */ if(dset_contig->sieve_size > len) { /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ @@ -1080,7 +1068,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer, if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -1093,7 +1081,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, } /* end if */ /* Write directly from the user's buffer */ - if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, udata->dxpl_id, buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, addr, len, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") } /* end if */ /* Element size fits within the buffer size */ @@ -1133,7 +1121,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Flush the sieve buffer if it's dirty */ if(dset_contig->sieve_dirty) { /* Write to file */ - if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -1166,7 +1154,7 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Check if there is any point in reading the data from the file */ if(dset_contig->sieve_size > len) { /* Read the new sieve buffer */ - if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, udata->dxpl_id, dset_contig->sieve_buf) < 0) + if(H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, dset_contig->sieve_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "block read failed") } /* end if */ @@ -1206,7 +1194,7 @@ H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udat FUNC_ENTER_STATIC /* Write data */ - if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, udata->dxpl_id, (udata->wbuf + src_off)) < 0) + if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, (udata->wbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "block write failed") done: @@ -1259,7 +1247,6 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, udata.dset_contig = &(io_info->dset->shared->cache.contig); udata.store_contig = &(io_info->store->contig); udata.wbuf = (const unsigned char *)io_info->u.wbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1274,7 +1261,6 @@ H5D__contig_writevv(const H5D_io_info_t *io_info, udata.file = io_info->dset->oloc.file; udata.dset_addr = io_info->store->contig.dset_addr; udata.wbuf = (const unsigned char *)io_info->u.wbuf; - udata.dxpl_id = io_info->raw_dxpl_id; /* Call generic sequence operation routine */ if((ret_value = H5VM_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, @@ -1301,7 +1287,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__contig_flush(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) +H5D__contig_flush(H5D_t *dset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1310,9 +1296,8 @@ H5D__contig_flush(H5D_t *dset, hid_t H5_ATTR_UNUSED dxpl_id) /* Sanity check */ HDassert(dset); - /* Flush any data in sieve buffer - use the raw data dxpl since - the one passed in is a metadata dxpl. */ - if(H5D__flush_sieve_buf(dset, H5AC_rawdata_dxpl_id) < 0) + /* Flush any data in sieve buffer */ + if(H5D__flush_sieve_buf(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer") done: @@ -1335,7 +1320,7 @@ done: herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *dt_src, - H5O_copy_t *cpy_info, hid_t dxpl_id) + H5O_copy_t *cpy_info) { haddr_t addr_src; /* File offset in source dataset */ haddr_t addr_dst; /* File offset in destination dataset */ @@ -1379,7 +1364,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDassert(dt_src); /* Allocate space for destination raw data */ - if(H5D__contig_alloc(f_dst, dxpl_id, storage_dst) < 0) + if(H5D__contig_alloc(f_dst, storage_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to allocate contiguous storage") /* Set up number of bytes to copy, and initial buffer size */ @@ -1400,7 +1385,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy") if((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, FALSE)) < 0) { - H5T_close(dt_mem); + (void)H5T_close_real(dt_mem); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") } /* end if */ @@ -1408,18 +1393,18 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy") if(H5T_set_loc(dt_dst, f_dst, H5T_LOC_DISK) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "cannot mark datatype on disk") } /* end if */ if((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, FALSE)) < 0) { - H5T_close(dt_dst); + (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype") } /* end if */ /* Set up the conversion functions */ - if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between src and mem datatypes") - if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath_mem_dst = H5T_path_find(dt_mem, dt_dst))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert between mem and dst datatypes") /* Determine largest datatype size */ @@ -1531,14 +1516,14 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemcpy(buf, base_sieve_buf, src_nbytes); } else - /* Read raw data from source file - use raw dxpl because passed in one is metadata */ - if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + /* Read raw data from source file */ + if(H5F_block_read(f_src, H5FD_MEM_DRAW, addr_src, src_nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read raw data") /* Perform datatype conversion, if necessary */ if(is_vlen) { /* Convert from source file to memory */ - if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Copy into another buffer, to reclaim memory later */ @@ -1548,11 +1533,11 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Reclaim space from variable length data */ - if(H5D_vlen_reclaim(tid_mem, buf_space, dxpl_id, reclaim_buf) < 0) + if(H5D_vlen_reclaim(tid_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") } /* end if */ else if(fix_ref) { @@ -1564,7 +1549,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, ref_count = src_nbytes / H5T_get_size(dt_src); /* Copy the reference elements */ - if(H5O_copy_expand_ref(f_src, buf, dxpl_id, f_dst, bkg, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) + if(H5O_copy_expand_ref(f_src, buf, f_dst, bkg, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") /* After fix ref, copy the new reference elements to the buffer to write out */ @@ -1575,8 +1560,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDmemset(buf, 0, src_nbytes); } /* end if */ - /* Write raw data to destination file - use raw dxpl because passed in one is metadata */ - if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + /* Write raw data to destination file */ + if(H5F_block_write(f_dst, H5FD_MEM_DRAW, addr_dst, dst_nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data") /* Adjust loop variables */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index b1efb20..656fa91 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -77,6 +78,7 @@ herr_t H5Ddebug(hid_t dset_id) { H5D_t *dset; /* Dataset to debug */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -85,14 +87,20 @@ H5Ddebug(hid_t dset_id) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) - (void)H5D__chunk_dump_index(dset, H5AC_ind_read_dxpl_id, stdout); + (void)H5D__chunk_dump_index(dset, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ddebug() */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 0807048..51ebeba 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -36,6 +36,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ @@ -60,10 +61,6 @@ /* Local Prototypes */ /********************/ -#ifndef H5_NO_DEPRECATED_SYMBOLS -static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - /*********************/ /* Package Variables */ @@ -118,6 +115,8 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5G_loc_t loc; /* Object location to insert dataset into */ H5D_t *dset = NULL; /* New dataset's info */ const H5S_t *space; /* Dataspace for dataset */ + hid_t dapl_id = H5P_DEFAULT; /* DAPL used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -138,8 +137,16 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(TRUE != H5P_isa_class(dcpl_id, H5P_DATASET_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&dapl_id, H5P_CLS_DACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") + /* Build and open the new dataset */ - if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -150,6 +157,8 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dcreate1() */ @@ -177,7 +186,8 @@ H5Dopen1(hid_t loc_id, const char *name) { H5D_t *dset = NULL; H5G_loc_t loc; /* Object location of group */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); @@ -188,8 +198,13 @@ H5Dopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the dataset */ - if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (dset = H5D__open_name(&loc, name, H5P_DATASET_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") /* Register an atom for the dataset */ @@ -200,6 +215,8 @@ done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dopen1() */ @@ -224,8 +241,11 @@ done: herr_t H5Dextend(hid_t dset_id, const hsize_t size[]) { - H5D_t *dset; - herr_t ret_value = SUCCEED; /* Return value */ + H5D_t *dset; /* Pointer to dataset to modify */ + hsize_t dset_dims[H5S_MAX_RANK]; /* Current dataset dimensions */ + unsigned u; /* Local index variable */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", dset_id, size); @@ -236,146 +256,30 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) if(!size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") + /* Make certain that the dataset dimensions don't decrease */ + /* (Shrinking dimensions is possible with H5Dset_extent, but not H5Dextend) */ + if(H5S_get_simple_extent_dims(dset->shared->space, dset_dims, NULL) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") + for(u = 0; u < dset->shared->ndims; u++) + if(size[u] > dset_dims[u]) + dset_dims[u] = size[u]; + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dset_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Increase size */ - if(H5D__extend(dset, size, H5AC_ind_read_dxpl_id) < 0) + if(H5D__set_extent(dset, dset_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Dextend() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__extend - * - * Purpose: Increases the size of a dataset. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) -{ - htri_t changed; /* Flag to indicate that the dataspace was successfully extended */ - hsize_t old_dims[H5S_MAX_RANK]; /* Current (i.e. old, if changed) dimension sizes */ - H5O_fill_t *fill; /* Dataset's fill value */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Check args */ - HDassert(dataset); - HDassert(size); - - /* Check if the filters in the DCPL will need to encode, and if so, can they? */ - if(H5D__check_filters(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") - - /* - * NOTE: Restrictions on extensions were checked when the dataset was - * created. All extensions are allowed here since none should be - * able to muck things up. - */ - - /* Retrieve the current dimensions */ - HDcompile_assert(sizeof(old_dims) == sizeof(dataset->shared->curr_dims)); - HDmemcpy(old_dims, dataset->shared->curr_dims, H5S_MAX_RANK * sizeof(old_dims[0])); - - /* Increase the size of the data space */ - if((changed = H5S_extend(dataset->shared->space, size)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to increase size of dataspace") - - /* Updated the dataset's info if the dataspace was successfully extended */ - if(changed) { - /* Get the extended dimension sizes */ - /* (Need to retrieve this here, since the 'size' dimensions could - * extend one dimension but be smaller in a different dimension, - * and the dataspace's extent is the larger of the current and - * 'size' dimension values. - QAK) - */ - if(H5S_get_simple_extent_dims(dataset->shared->space, dataset->shared->curr_dims, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - - /* Update the index values for the cached chunks for this dataset */ - if(H5D_CHUNKED == dataset->shared->layout.type) { - hbool_t update_chunks = FALSE; /* Flag to indicate chunk cache update is needed */ - - /* Check if we need to track & update scaled dimension information */ - if(dataset->shared->ndims > 1) { - unsigned u; /* Local indicate variable */ - - /* Update scaled chunk information */ - for(u = 0; u < dataset->shared->ndims; u++) { - hsize_t scaled; /* Scaled value */ - - /* Compute the scaled dimension size value */ - scaled = size[u] / dataset->shared->layout.u.chunk.dim[u]; - - /* Check if scaled dimension size changed */ - if(scaled != dataset->shared->cache.chunk.scaled_dims[u]) { - hsize_t scaled_power2up; /* New size value, rounded to next power of 2 */ - - /* Update the scaled dimension size value for the current dimension */ - dataset->shared->cache.chunk.scaled_dims[u] = scaled; - - /* Check if algorithm for computing hash values will change */ - if((scaled > dataset->shared->cache.chunk.nslots && - dataset->shared->cache.chunk.scaled_dims[u] <= dataset->shared->cache.chunk.nslots) - || (scaled <= dataset->shared->cache.chunk.nslots && - dataset->shared->cache.chunk.scaled_dims[u] > dataset->shared->cache.chunk.nslots)) - update_chunks = TRUE; - - if( !(scaled_power2up = H5VM_power2up(scaled)) ) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") - - /* Check if the number of bits required to encode the scaled size value changed */ - if(dataset->shared->cache.chunk.scaled_power2up[u] != scaled_power2up) { - /* Update the 'power2up' & 'encode_bits' values for the current dimension */ - dataset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; - dataset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); - - /* Indicate that the chunk cache indices should be updated */ - update_chunks = TRUE; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end if */ - - /* Update general information for chunks */ - if(H5D__chunk_set_info(dataset) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - - /* Check for updating chunk cache indices */ - if(update_chunks) { - /* Update the chunk cache indices */ - if(H5D__chunk_update_cache(dataset, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") - } /* end if */ - } /* end if */ - - /* Allocate space for the new parts of the dataset, if appropriate */ - fill = &dataset->shared->dcpl_cache.fill; - if(fill->alloc_time == H5D_ALLOC_TIME_EARLY) { - H5D_io_info_t io_info; - - io_info.dset = dataset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; - - if(H5D__alloc_storage(&io_info, H5D_ALLOC_EXTEND, FALSE, old_dims) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") - } - /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D__mark(dataset, dxpl_id, H5D_MARK_SPACE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__extend() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 1df0a58..a20145a 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -65,12 +65,6 @@ typedef struct H5D_earray_ctx_t { size_t chunk_size_len; /* Size of chunk sizes in the file (bytes) */ } H5D_earray_ctx_t; -/* User data for chunk callbacks */ -typedef struct H5D_earray_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_earray_ud_t; - /* Extensible Array callback info for iteration over chunks */ typedef struct H5D_earray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ @@ -105,7 +99,7 @@ static herr_t H5D__earray_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); +static void *H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr); static herr_t H5D__earray_dst_dbg_context(void *dbg_ctx); /* Extensible array class callbacks for chunks w/filters */ @@ -136,7 +130,7 @@ static herr_t H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -624,7 +618,7 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, *------------------------------------------------------------------------- */ static void * -H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) +H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) { H5D_earray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ @@ -653,7 +647,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -675,10 +669,9 @@ done: dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx); /* Close object header */ - if(obj_opened) { + if(obj_opened) if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -757,7 +750,7 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.earray.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -765,12 +758,12 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the extensible array a child flush dependency of the dataset's object header */ - if(H5EA_depend(idx_info->storage->u.earray.ea, idx_info->dxpl_id, oh_proxy) < 0) + if(H5EA_depend(idx_info->storage->u.earray.ea, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -819,7 +812,7 @@ H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Open the extensible array for the chunk index */ - if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &udata))) + if(NULL == (idx_info->storage->u.earray.ea = H5EA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open extensible array") /* Check for SWMR writes to the file */ @@ -970,7 +963,7 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Create the extensible array for the chunk index */ - if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, idx_info->dxpl_id, &cparam, &udata))) + if(NULL == (idx_info->storage->u.earray.ea = H5EA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create extensible array") /* Get the address of the extensible array in file */ @@ -1065,12 +1058,12 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata elmt.filter_mask = udata->filter_mask; /* Set the info for the chunk */ - if(H5EA_set(ea, idx_info->dxpl_id, udata->chunk_idx, &elmt) < 0) + if(H5EA_set(ea, udata->chunk_idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { /* Set the address for the chunk */ - if(H5EA_set(ea, idx_info->dxpl_id, udata->chunk_idx, &udata->chunk_block.offset) < 0) + if(H5EA_set(ea, udata->chunk_idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") } /* end else */ @@ -1149,7 +1142,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5D_earray_filt_elmt_t elmt; /* Extensible array element */ /* Get the information for the chunk */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_get(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Set the info for the chunk */ @@ -1159,7 +1152,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda } /* end if */ else { /* Get the address for the chunk */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &udata->chunk_block.offset) < 0) + if(H5EA_get(ea, idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ @@ -1357,7 +1350,7 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the extensible array elements */ - if((ret_value = H5EA_iterate(ea, idx_info->dxpl_id, H5D__earray_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5EA_iterate(ea, H5D__earray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ @@ -1433,14 +1426,14 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5D_earray_filt_elmt_t elmt; /* Extensible array element */ /* Get the info about the chunk for the index */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_get(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(elmt.addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, elmt.addr, (hsize_t)elmt.nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ @@ -1448,27 +1441,27 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t elmt.addr = HADDR_UNDEF; elmt.nbytes = 0; elmt.filter_mask = 0; - if(H5EA_set(ea, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5EA_set(ea, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk info") } /* end if */ else { haddr_t addr = HADDR_UNDEF; /* Chunk address */ /* Get the address of the chunk for the index */ - if(H5EA_get(ea, idx_info->dxpl_id, idx, &addr) < 0) + if(H5EA_get(ea, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, addr, (hsize_t)idx_info->layout->size) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ /* Reset the address of the chunk for the index */ addr = HADDR_UNDEF; - if(H5EA_set(ea, idx_info->dxpl_id, idx, &addr) < 0) + if(H5EA_set(ea, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk address") } /* end else */ @@ -1493,7 +1486,7 @@ done: static int H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_earray_ud_t *udata = (H5D_earray_ud_t *)_udata; /* User data for callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -1502,12 +1495,11 @@ H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(chunk_rec); HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); HDassert(chunk_rec->nbytes > 0); - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free chunk") done: @@ -1549,19 +1541,14 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Check if the index data structure has been allocated */ if(H5F_addr_defined(idx_info->storage->idx_addr)) { - H5D_earray_ud_t udata; /* User data for callback */ H5D_earray_ctx_ud_t ctx_udata; /* User data for extensible array open call */ - /* Initialize user data for callback */ - udata.f = idx_info->f; - udata.dxpl_id = idx_info->dxpl_id; - /* Iterate over the chunk addresses in the extensible array, deleting each chunk */ - if(H5D__earray_idx_iterate(idx_info, H5D__earray_idx_delete_cb, &udata) < 0) + if(H5D__earray_idx_iterate(idx_info, H5D__earray_idx_delete_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses") /* Close extensible array */ - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; @@ -1570,7 +1557,7 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) ctx_udata.chunk_size = idx_info->layout->size; /* Delete extensible array */ - if(H5EA_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &ctx_udata) < 0) + if(H5EA_delete(idx_info->f, idx_info->storage->idx_addr, &ctx_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk extensible array") idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ @@ -1622,7 +1609,7 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open extensible array") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create the extensible array that describes chunked storage in the dest. file */ if(H5D__earray_idx_create(idx_info_dst) < 0) @@ -1630,7 +1617,7 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1651,7 +1638,7 @@ done: */ static herr_t H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1664,10 +1651,10 @@ H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.earray.ea); /* Close extensible arrays */ - if(H5EA_close(storage_src->u.earray.ea, dxpl_id) < 0) + if(H5EA_close(storage_src->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") storage_src->u.earray.ea = NULL; - if(H5EA_close(storage_dst->u.earray.ea, dxpl_id) < 0) + if(H5EA_close(storage_dst->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") storage_dst->u.earray.ea = NULL; @@ -1724,7 +1711,7 @@ H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) done: if(idx_info->storage->u.earray.ea) { - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; } /* end if */ @@ -1823,7 +1810,7 @@ H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch earray file pointer") /* Close extensible array */ - if(H5EA_close(idx_info->storage->u.earray.ea, idx_info->dxpl_id) < 0) + if(H5EA_close(idx_info->storage->u.earray.ea) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close extensible array") idx_info->storage->u.earray.ea = NULL; } /* end if */ diff --git a/src/H5Defl.c b/src/H5Defl.c index ebe7689..bfd734c 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -597,7 +597,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) +H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -610,7 +610,7 @@ H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) HDassert(heap_size); /* Get the size of the local heap for EFL's file list */ - if(H5HL_heapsize(f, dxpl_id, efl->heap_addr, heap_size) < 0) + if(H5HL_heapsize(f, efl->heap_addr, heap_size) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, FAIL, "unable to retrieve local heap info") done: diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index d183a8c..372ae26 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -64,12 +64,6 @@ typedef struct H5D_farray_ctx_t { size_t chunk_size_len; /* Size of chunk sizes in the file (bytes) */ } H5D_farray_ctx_t; -/* User data for chunk callbacks */ -typedef struct H5D_farray_ud_t { - H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ -} H5D_farray_ud_t; - /* Fixed Array callback info for iteration over chunks */ typedef struct H5D_farray_it_ud_t { H5D_chunk_common_ud_t common; /* Common info for Fixed Array user data (must be first) */ @@ -105,8 +99,7 @@ static herr_t H5D__farray_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, - haddr_t obj_addr); +static void *H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr); static herr_t H5D__farray_dst_dbg_context(void *dbg_ctx); /* Fixed array class callbacks for chunks w/filters */ @@ -136,7 +129,7 @@ static herr_t H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info); static herr_t H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); static herr_t H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); static herr_t H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -464,7 +457,7 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, *------------------------------------------------------------------------- */ static void * -H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) +H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) { H5D_farray_ctx_ud_t *dbg_ctx = NULL; /* Context for fixed array callback */ H5O_loc_t obj_loc; /* Pointer to an object's location */ @@ -493,7 +486,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) obj_opened = TRUE; /* Read the layout message */ - if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout, dxpl_id)) + if(NULL == H5O_msg_read(&obj_loc, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ @@ -515,10 +508,9 @@ done: dbg_ctx = H5FL_FREE(H5D_farray_ctx_ud_t, dbg_ctx); /* Close object header */ - if(obj_opened) { + if(obj_opened) if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") - } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -757,7 +749,7 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) oloc.addr = idx_info->storage->u.farray.dset_ohdr_addr; /* Get header */ - if(NULL == (oh = H5O_protect(&oloc, idx_info->dxpl_id, H5AC__READ_ONLY_FLAG, TRUE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Retrieve the dataset's object header proxy */ @@ -765,12 +757,12 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get dataset object header proxy") /* Make the fixed array a child flush dependency of the dataset's object header proxy */ - if(H5FA_depend(idx_info->storage->u.farray.fa, idx_info->dxpl_id, oh_proxy) < 0) + if(H5FA_depend(idx_info->storage->u.farray.fa, oh_proxy) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on object header proxy") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(&oloc, idx_info->dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -843,7 +835,7 @@ H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Open the fixed array for the chunk index */ - if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &udata))) + if(NULL == (idx_info->storage->u.farray.fa = H5FA_open(idx_info->f, idx_info->storage->idx_addr, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't open fixed array") /* Check for SWMR writes to the file */ @@ -920,7 +912,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) udata.chunk_size = idx_info->layout->size; /* Create the fixed array for the chunk index */ - if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, idx_info->dxpl_id, &cparam, &udata))) + if(NULL == (idx_info->storage->u.farray.fa = H5FA_create(idx_info->f, &cparam, &udata))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create fixed array") /* Get the address of the fixed array in file */ @@ -1015,12 +1007,12 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata elmt.filter_mask = udata->filter_mask; /* Set the info for the chunk */ - if(H5FA_set(fa, idx_info->dxpl_id, udata->chunk_idx, &elmt) < 0) + if(H5FA_set(fa, udata->chunk_idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk info") } /* end if */ else { /* Set the address for the chunk */ - if(H5FA_set(fa, idx_info->dxpl_id, udata->chunk_idx, &udata->chunk_block.offset) < 0) + if(H5FA_set(fa, udata->chunk_idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set chunk address") } /* end else */ @@ -1082,7 +1074,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5D_farray_filt_elmt_t elmt; /* Fixed array element */ /* Get the information for the chunk */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_get(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Set the info for the chunk */ @@ -1092,7 +1084,7 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda } /* end if */ else { /* Get the address for the chunk */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &udata->chunk_block.offset) < 0) + if(H5FA_get(fa, idx, &udata->chunk_block.offset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Update the other (constant) information for the chunk */ @@ -1234,7 +1226,7 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over the fixed array elements */ - if((ret_value = H5FA_iterate(fa, idx_info->dxpl_id, H5D__farray_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5FA_iterate(fa, H5D__farray_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over fixed array chunk index"); } /* end if */ @@ -1293,14 +1285,14 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5D_farray_filt_elmt_t elmt; /* Fixed array element */ /* Get the info about the chunk for the index */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_get(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(elmt.addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, elmt.addr, (hsize_t)elmt.nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ @@ -1308,27 +1300,27 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t elmt.addr = HADDR_UNDEF; elmt.nbytes = 0; elmt.filter_mask = 0; - if(H5FA_set(fa, idx_info->dxpl_id, idx, &elmt) < 0) + if(H5FA_set(fa, idx, &elmt) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk info") } /* end if */ else { haddr_t addr = HADDR_UNDEF; /* Chunk address */ /* Get the address of the chunk for the index */ - if(H5FA_get(fa, idx_info->dxpl_id, idx, &addr) < 0) + if(H5FA_get(fa, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ HDassert(H5F_addr_defined(addr)); if(!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, addr, (hsize_t)idx_info->layout->size) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to free chunk") } /* end if */ /* Reset the address of the chunk for the index */ addr = HADDR_UNDEF; - if(H5FA_set(fa, idx_info->dxpl_id, idx, &addr) < 0) + if(H5FA_set(fa, idx, &addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to reset chunk address") } /* end else */ @@ -1353,7 +1345,7 @@ done: static int H5D__farray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { - H5D_farray_ud_t *udata = (H5D_farray_ud_t *)_udata; /* User data for callback */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC @@ -1362,12 +1354,11 @@ H5D__farray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(chunk_rec); HDassert(H5F_addr_defined(chunk_rec->chunk_addr)); HDassert(chunk_rec->nbytes > 0); - HDassert(udata); - HDassert(udata->f); + HDassert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */uint32_t, /*To: */hsize_t); - if(H5MF_xfree(udata->f, H5FD_MEM_DRAW, udata->dxpl_id, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, chunk_rec->chunk_addr, (hsize_t)chunk_rec->nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free chunk") done: @@ -1405,19 +1396,14 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) /* Check if the index data structure has been allocated */ if(H5F_addr_defined(idx_info->storage->idx_addr)) { - H5D_farray_ud_t udata; /* User data for callback */ H5D_farray_ctx_ud_t ctx_udata; /* User data for fixed array open call */ - /* Initialize user data for callback */ - udata.f = idx_info->f; - udata.dxpl_id = idx_info->dxpl_id; - /* Iterate over the chunk addresses in the fixed array, deleting each chunk */ - if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, &udata) < 0) + if(H5D__farray_idx_iterate(idx_info, H5D__farray_idx_delete_cb, idx_info->f) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk addresses") /* Close fixed array */ - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; @@ -1426,7 +1412,7 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) ctx_udata.chunk_size = idx_info->layout->size; /* Delete fixed array */ - if(H5FA_delete(idx_info->f, idx_info->dxpl_id, idx_info->storage->idx_addr, &ctx_udata) < 0) + if(H5FA_delete(idx_info->f, idx_info->storage->idx_addr, &ctx_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk fixed array") idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ @@ -1478,7 +1464,7 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open fixed array") /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create the fixed array that describes chunked storage in the dest. file */ if(H5D__farray_idx_create(idx_info_dst) < 0) @@ -1486,7 +1472,7 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) @@ -1507,7 +1493,7 @@ done: */ static herr_t H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id) + H5O_storage_chunk_t *storage_dst) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1520,10 +1506,10 @@ H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, HDassert(storage_dst->u.farray.fa); /* Close fixed arrays */ - if(H5FA_close(storage_src->u.farray.fa, dxpl_id) < 0) + if(H5FA_close(storage_src->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") storage_src->u.farray.fa = NULL; - if(H5FA_close(storage_dst->u.farray.fa, dxpl_id) < 0) + if(H5FA_close(storage_dst->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") storage_dst->u.farray.fa = NULL; @@ -1579,7 +1565,7 @@ H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) done: if(idx_info->storage->u.farray.fa) { - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; } /* end if */ @@ -1676,7 +1662,7 @@ H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch fixed array file pointer") /* Close fixed array */ - if(H5FA_close(idx_info->storage->u.farray.fa, idx_info->dxpl_id) < 0) + if(H5FA_close(idx_info->storage->u.farray.fa) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close fixed array") idx_info->storage->u.farray.fa = NULL; } /* end if */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 922ac98..668ecc3 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -33,11 +33,12 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vector and array functions */ +#include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -119,6 +120,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ H5S_t *space; /* Dataspace */ H5T_t *fill_type; /* Fill-value datatype */ H5T_t *buf_type; /* Buffer datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -133,12 +135,17 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") if(NULL == (buf_type = (H5T_t *)H5I_object_verify(buf_type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Fill the selection in the memory buffer */ - if(H5D__fill(fill, fill_type, buf, buf_type, space, H5AC_noio_dxpl_id) < 0) + if(H5D__fill(fill, fill_type, buf, buf_type, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dfill() */ @@ -173,7 +180,7 @@ done: --------------------------------------------------------------------------*/ herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, - const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id) + const H5T_t *buf_type, const H5S_t *space) { H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info */ hbool_t mem_iter_init = FALSE; /* Whether the memory selection iterator has been initialized */ @@ -230,7 +237,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, buf_size = MAX(src_type_size, dst_type_size); /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(fill_type, buf_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill_type, buf_type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") /* Construct source & destination datatype IDs, if we will need them */ @@ -247,8 +254,6 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, * of the VL data. */ if(TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) { - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ hssize_t nelmts; /* Number of data elements */ /* Get the number of elements in the selection */ @@ -268,13 +273,9 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, H5VM_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts); /* Convert from file's fill value into memory form */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Allocate the chunk selection iterator */ if(NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory selection iterator") @@ -285,7 +286,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, mem_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D__scatter_mem(tmp_buf, space, mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) + if(H5D__scatter_mem(tmp_buf, space, mem_iter, (size_t)nelmts, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end if */ else { @@ -320,7 +321,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, } /* end if */ /* Perform datatype conversion */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Point at element buffer */ @@ -374,7 +375,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, - size_t total_nelmts, size_t max_buf_size, hid_t dxpl_id) + size_t total_nelmts, size_t max_buf_size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -410,7 +411,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ if(fb_info->has_vlen_fill_type) { /* Create temporary datatype for conversion operation */ - if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_REOPEN))) + if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy file datatype") if((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype") @@ -449,11 +450,11 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, } /* end else */ /* Get the datatype conversion path for this operation */ - if(NULL == (fb_info->fill_to_mem_tpath = H5T_path_find(dset_type, fb_info->mem_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (fb_info->fill_to_mem_tpath = H5T_path_find(dset_type, fb_info->mem_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Get the inverse datatype conversion path for this operation */ - if(NULL == (fb_info->mem_to_dset_tpath = H5T_path_find(fb_info->mem_type, dset_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (fb_info->mem_to_dset_tpath = H5T_path_find(fb_info->mem_type, dset_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Check if we need to allocate a background buffer */ @@ -569,7 +570,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) +H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) { herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ @@ -589,7 +590,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HDmemset(fb_info->bkg_buf, 0, fb_info->max_elmt_size); /* Type convert the dataset buffer, to copy any VL components */ - if(H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf, dxpl_id) < 0) + if(H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Replicate the fill value into the cached buffer */ @@ -611,18 +612,18 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) HDmemcpy(buf, fb_info->fill_buf, fb_info->fill_buf_size); /* Type convert the dataset buffer, to copy any VL components */ - if(H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf, dxpl_id) < 0) + if(H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") done: if(buf) { /* Free dynamically allocated VL elements in fill buffer */ if(fb_info->fill->type) { - if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type, dxpl_id) < 0) + if(H5T_vlen_reclaim_elmt(buf, fb_info->fill->type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") } /* end if */ else { - if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type, dxpl_id) < 0) + if(H5T_vlen_reclaim_elmt(buf, fb_info->mem_type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't reclaim vlen element") } /* end else */ @@ -703,7 +704,7 @@ H5D__fill_term(H5D_fill_buf_info_t *fb_info) if(fb_info->mem_tid > 0) H5I_dec_ref(fb_info->mem_tid); else if(fb_info->mem_type) - H5T_close(fb_info->mem_type); + (void)H5T_close_real(fb_info->mem_type); if(fb_info->bkg_buf) fb_info->bkg_buf = H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); } /* end if */ diff --git a/src/H5Dint.c b/src/H5Dint.c index b6c0341..c6c4ecd 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Datasets */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5FOprivate.h" /* File objects */ @@ -40,41 +41,31 @@ /* Local Typedefs */ /******************/ -/* Struct for holding callback info during H5D_flush operation */ -typedef struct { - const H5F_t *f; /* Pointer to file being flushed */ - hid_t dxpl_id; /* DXPL for I/O operations */ -} H5D_flush_ud_t; - /********************/ /* Local Prototypes */ /********************/ /* General stuff */ -static herr_t H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); -static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, - hbool_t vl_type); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, - const H5T_t *type); + const H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); -static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, - hid_t dapl_id); -static herr_t H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, +static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id); +static herr_t H5D__build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix); -static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id); static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); +static herr_t H5D__get_storage_size_real(const H5D_t *dset, hsize_t *storage_size); static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id); +static herr_t H5D__close_cb(H5D_t *dataset); /*********************/ /* Package Variables */ /*********************/ -/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */ -H5D_dxpl_cache_t H5D_def_dxpl_cache; - /* Declare a free list to manage blocks of VL data */ H5FL_BLK_DEFINE(vlen_vl_buf); @@ -109,10 +100,10 @@ static H5D_shared_t H5D_def_dset; /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ - H5I_DATASET, /* ID class value */ - 0, /* Class flags */ - 0, /* # of reserved IDs for class */ - (H5I_free_t)H5D_close /* Callback routine for closing objects of this class */ + H5I_DATASET, /* ID class value */ + 0, /* Class flags */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5D__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -191,13 +182,6 @@ H5D__init_package(void) if(H5P_get(def_dcpl, H5O_CRT_PIPELINE_NAME, &H5D_def_dset.dcpl_cache.pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") - /* Reset the "default DXPL cache" information */ - HDmemset(&H5D_def_dxpl_cache, 0, sizeof(H5D_dxpl_cache_t)); - - /* Get the default DXPL cache information */ - if(H5D__get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve default DXPL info") - /* Mark "top" of interface as initialized, too */ H5D_top_package_initialize_s = TRUE; @@ -297,136 +281,6 @@ H5D_term_package(void) } /* end H5D_term_package() */ -/*-------------------------------------------------------------------------- - NAME - H5D__get_dxpl_cache_real - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D__get_dxpl_cache_real(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -static herr_t -H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) -{ - H5P_genplist_t *dx_plist; /* Data transfer property list */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_STATIC - - /* Check args */ - HDassert(cache); - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get maximum temporary buffer size */ - if(H5P_get(dx_plist, H5D_XFER_MAX_TEMP_BUF_NAME, &cache->max_temp_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve maximum temporary buffer size") - - /* Get temporary buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_TCONV_BUF_NAME, &cache->tconv_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve temporary buffer pointer") - - /* Get background buffer pointer */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_NAME, &cache->bkgr_buf) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer pointer") - - /* Get background buffer type */ - if(H5P_get(dx_plist, H5D_XFER_BKGR_BUF_TYPE_NAME, &cache->bkgr_buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type") - - /* Get B-tree split ratios */ - if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios") - - /* Get I/O vector size */ - if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &cache->vec_size) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve I/O vector size") - -#ifdef H5_HAVE_PARALLEL - /* Collect Parallel I/O information for possible later use */ - if(H5P_get(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve parallel transfer method") - if(H5P_get(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &cache->coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve collective transfer option") -#endif /* H5_HAVE_PARALLEL */ - - /* Get error detection properties */ - if(H5P_get(dx_plist, H5D_XFER_EDC_NAME, &cache->err_detect) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve error detection info") - - /* Get filter callback function */ - if(H5P_get(dx_plist, H5D_XFER_FILTER_CB_NAME, &cache->filter_cb) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve filter callback function") - - /* Look at the data transform property */ - /* (Note: 'peek', not 'get' - if this turns out to be a problem, we should - * add a H5D__free_dxpl_cache() routine. -QAK) - */ - if(H5P_peek(dx_plist, H5D_XFER_XFORM_NAME, &cache->data_xform_prop) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve data transform info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__get_dxpl_cache_real() */ - - -/*-------------------------------------------------------------------------- - NAME - H5D__get_dxpl_cache - PURPOSE - Get all the values for the DXPL cache. - USAGE - herr_t H5D__get_dxpl_cache(dxpl_id, cache) - hid_t dxpl_id; IN: DXPL to query - H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values - RETURNS - Non-negative on success/Negative on failure. - DESCRIPTION - Query all the values from a DXPL that are needed by internal routines - within the library. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - The CACHE pointer should point at already allocated memory to place - non-default property list info. If a default property list is used, the - CACHE pointer will be changed to point at the default information. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) -{ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_PACKAGE - - /* Check args */ - HDassert(cache); - - /* Check for the default DXPL */ - if(dxpl_id==H5P_DATASET_XFER_DEFAULT) - *cache=&H5D_def_dxpl_cache; - else - if(H5D__get_dxpl_cache_real(dxpl_id,*cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't retrieve DXPL values") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5D__get_dxpl_cache() */ - - /*------------------------------------------------------------------------- * Function: H5D__create_named * @@ -439,14 +293,13 @@ done: */ H5D_t * H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, - const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, - hid_t dxpl_id) + const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5D_obj_create_t dcrt_info; /* Information for dataset creation */ H5D_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check arguments */ HDassert(loc); @@ -456,7 +309,6 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, HDassert(lcpl_id != H5P_DEFAULT); HDassert(dcpl_id != H5P_DEFAULT); HDassert(dapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Set up dataset creation info */ dcrt_info.type_id = type_id; @@ -470,7 +322,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, ocrt_info.new_obj = NULL; /* Create the new dataset and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, dapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create and link to dataset") HDassert(ocrt_info.new_obj); @@ -478,11 +330,52 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, ret_value = (H5D_t *)ocrt_info.new_obj; done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__create_named() */ /*------------------------------------------------------------------------- + * Function: H5D__create_anon + * + * Purpose: Internal routine to create a new anonymous dataset. + * + * Note: This routine is needed so that there's a non-API routine for + * creating datasets that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new dataset object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 9, 2017 + * + *------------------------------------------------------------------------- + */ +H5D_t * +H5D__create_anon(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, + hid_t dapl_id) +{ + H5D_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(file); + HDassert(type_id != H5P_DEFAULT); + HDassert(space); + HDassert(dcpl_id != H5P_DEFAULT); + HDassert(dapl_id != H5P_DEFAULT); + + /* Build and open the dataset */ + if(NULL == (ret_value = H5D__create(file, type_id, space, dcpl_id, dapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__create_anon() */ + + +/*------------------------------------------------------------------------- * Function: H5D__get_space_status * * Purpose: Returns the status of data space allocation. @@ -493,21 +386,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) +H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation) { - hsize_t space_allocated; /* The number of bytes allocated for chunks */ - hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ - hsize_t nelmts; /* Number of elements in dataspace */ - size_t dt_size; /* Size of datatype */ - hsize_t full_size; /* The number of bytes in the dataset when fully populated */ herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL HDassert(dset); /* Check for chunked layout */ if(dset->shared->layout.type == H5D_CHUNKED) { + hsize_t space_allocated; /* The number of bytes allocated for chunks */ + hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ + hsize_t nelmts; /* Number of elements in dataspace */ + size_t dt_size; /* Size of datatype */ + hsize_t full_size; /* The number of bytes in the dataset when fully populated */ + /* For chunked layout set the space status by the storage size */ /* Get the dataset's dataspace */ HDassert(dset->shared->space); @@ -529,7 +423,7 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "size of dataset's storage overflowed") /* Difficult to error check, since the error value is 0 and 0 is a valid value... :-/ */ - if(H5D__get_storage_size(dset, dxpl_id, &space_allocated) < 0) + if(H5D__get_storage_size_real(dset, &space_allocated) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") /* Decide on how much of the space is allocated */ @@ -550,7 +444,7 @@ H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__get_space_status() */ @@ -652,8 +546,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy datatype") - /* Convert a datatype (if committed) to a transient type if the committed datatype's file - location is different from the file location where the dataset will be created */ + /* Convert a datatype (if committed) to a transient type if the committed datatype's file + location is different from the file location where the dataset will be created */ if(H5T_convert_committed_datatype(dset->shared->type, file) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get shared datatype info") @@ -667,8 +561,8 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest version of datatype") /* Get a datatype ID for the dataset's datatype */ - if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") + if((dset->shared->type_id = H5I_register(H5I_DATATYPE, dset->shared->type, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register type") } /* end if */ /* Not a custom datatype, just use it directly */ else { @@ -718,7 +612,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) ) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") dset->shared->curr_power2up[u] = scaled_power2up; - } + } /* end for */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -783,7 +677,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) +H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */ @@ -831,14 +725,13 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) /* Determine whether fill value is defined or not */ if(fill_status == H5D_FILL_VALUE_DEFAULT || fill_status == H5D_FILL_VALUE_USER_DEFINED) { /* Convert fill value buffer to dataset's datatype */ - if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed, dxpl_id) < 0) + if(fill_prop->buf && fill_prop->size > 0 && H5O_fill_convert(fill_prop, type, &fill_changed) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to convert fill value to dataset type") - fill_prop->fill_defined = TRUE; - } - else if(fill_status == H5D_FILL_VALUE_UNDEFINED) { + fill_prop->fill_defined = TRUE; + } /* end if */ + else if(fill_status == H5D_FILL_VALUE_UNDEFINED) fill_prop->fill_defined = FALSE; - } else HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to determine if fill value is defined") @@ -865,24 +758,24 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) ohdr_size += layout->storage.u.compact.size; /* Create an object header for the dataset */ - if(H5O_create(file, dxpl_id, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0) + if(H5O_create(file, ohdr_size, (size_t)1, dset->shared->dcpl_id, oloc/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header") HDassert(file == dset->oloc.file); /* Pin the object header */ - if(NULL == (oh = H5O_pin(oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(oloc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") /* Write the dataspace header message */ - if(H5S_append(file, dxpl_id, oh, dset->shared->space) < 0) + if(H5S_append(file, oh, dset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update dataspace header message") /* Write the datatype header message */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type) < 0) + if(H5O_msg_append_oh(file, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update datatype header message") /* Write new fill value message */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) + if(H5O_msg_append_oh(file, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message") /* If there is valid information for the old fill value struct, add it */ @@ -898,12 +791,12 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) H5O_msg_reset_share(H5O_FILL_ID, &old_fill_prop); /* Write old fill value */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, &old_fill_prop) < 0) + if(H5O_msg_append_oh(file, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, &old_fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update old fill value header message") } /* end if */ /* Update/create the layout (and I/O pipeline & EFL) messages */ - if(H5D__layout_oh_create(file, dxpl_id, oh, dset, dapl_id) < 0) + if(H5D__layout_oh_create(file, oh, dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout/pline/efl header message") /* Indicate that the layout information was initialized */ @@ -922,17 +815,17 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) (H5P_exist_plist(dc_plist, H5O_BOGUS_MSG_ID_NAME) > 0) ) { uint8_t bogus_flags = 0; /* Flags for creating "bogus" message */ - unsigned bogus_id; /* "bogus" ID */ + unsigned bogus_id; /* "bogus" ID */ - /* Retrieve "bogus" message ID */ + /* Retrieve "bogus" message ID */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_ID_NAME, &bogus_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus ID options") /* Retrieve "bogus" message flags */ if(H5P_get(dc_plist, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get bogus message options") /* Add a "bogus" message (for error testing). */ - if(H5O_bogus_oh(file, dxpl_id, oh, bogus_id, (unsigned)bogus_flags) < 0) + if(H5O_bogus_oh(file, oh, bogus_id, (unsigned)bogus_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create 'bogus' message") } /* end if */ } @@ -943,7 +836,7 @@ H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) * header and doesn't use a separate message -QAK) */ if(!(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_NO_MOD_TIME_MSG))) - if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) + if(H5O_touch_oh(file, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") done: @@ -956,7 +849,7 @@ done: if(ret_value < 0) if(layout_init) /* Destroy the layout information for the dataset */ - if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset, dxpl_id) < 0) + if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") FUNC_LEAVE_NOAPI(ret_value) @@ -964,7 +857,7 @@ done: /*-------------------------------------------------------------------------- - * Function: H5D_build_extfile_prefix + * Function: H5D__build_extfile_prefix * * Purpose: Determine the external file prefix to be used and store * it in extfile_prefix. Stores an empty string if no prefix @@ -974,7 +867,7 @@ done: *-------------------------------------------------------------------------- */ static herr_t -H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) +H5D__build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix /*out*/) { char *prefix = NULL; /* prefix used to look for the file */ char *extpath = NULL; /* absolute path of directory the HDF5 file is in */ @@ -984,12 +877,11 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC - FUNC_ENTER_NOAPI_NOINIT - + /* Sanity checks */ HDassert(dset); HDassert(dset->oloc.file); - extpath = H5F_EXTPATH(dset->oloc.file); HDassert(extpath); @@ -1035,7 +927,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_build_extfile_prefix() */ +} /* H5D__build_extfile_prefix() */ /*------------------------------------------------------------------------- @@ -1055,7 +947,7 @@ done: */ H5D_t * H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, - hid_t dapl_id, hid_t dxpl_id) + hid_t dapl_id) { const H5T_t *type; /* Datatype for dataset */ H5D_t *new_dset = NULL; @@ -1076,7 +968,6 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HDassert(H5I_DATATYPE == H5I_get_type(type_id)); HDassert(space); HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); /* Get the dataset's datatype */ if(NULL == (type = (const H5T_t *)H5I_object(type_id))) @@ -1171,24 +1062,24 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set the latest version of the layout, pline & fill messages, if requested */ if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_DSET_MSG_FLAGS)) { /* Set the latest version for the I/O pipeline message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) - if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_PLINE_MSG)) + if(H5O_pline_set_latest_version(&new_dset->shared->dcpl_cache.pline) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of I/O filter pipeline") /* Set the latest version for the fill message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) - /* Set the latest version for the fill value message */ - if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_FILL_MSG)) + /* Set the latest version for the fill value message */ + if(H5O_fill_set_latest_version(&new_dset->shared->dcpl_cache.fill) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") /* Set the latest version for the layout message */ - if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) - /* Set the latest version for the layout message */ - if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") + if(H5F_USE_LATEST_FLAGS(file, H5F_LATEST_LAYOUT_MSG)) + /* Set the latest version for the layout message */ + if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") } /* end if */ else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { - /* Use latest indexing type for layout message version >= 4 */ + /* Use latest indexing type for layout message version >= 4 */ if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ @@ -1206,7 +1097,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information") /* Update the dataset's object header info. */ - if(H5D__update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) + if(H5D__update_oh_info(file, new_dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache") /* Indicate that the layout information was initialized */ @@ -1214,10 +1105,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Set up append flush parameters for the dataset */ if(H5D__append_flush_setup(new_dset, dapl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to set up flush append property") /* Set the external file prefix */ - if(H5D_build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) + if(H5D__build_extfile_prefix(new_dset, dapl_id, &new_dset->shared->extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Add the dataset to the list of opened objects in the file */ @@ -1234,7 +1125,7 @@ done: if(!ret_value && new_dset && new_dset->shared) { if(new_dset->shared) { if(layout_init) - if(new_dset->shared->layout.ops->dest && (new_dset->shared->layout.ops->dest)(new_dset, dxpl_id) < 0) + if(new_dset->shared->layout.ops->dest && (new_dset->shared->layout.ops->dest)(new_dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "unable to destroy layout info") if(pline_copied) if(H5O_msg_reset(H5O_PLINE_ID, &new_dset->shared->dcpl_cache.pline) < 0) @@ -1253,12 +1144,12 @@ done: if(new_dset->shared->type && H5I_dec_ref(new_dset->shared->type_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") if(H5F_addr_defined(new_dset->oloc.addr)) { - if(H5O_dec_rc_by_loc(&(new_dset->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(new_dset->oloc)) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") if(H5O_close(&(new_dset->oloc), NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header") if(file) { - if(H5O_delete(file, dxpl_id, new_dset->oloc.addr) < 0) + if(H5O_delete(file, new_dset->oloc.addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDELETE, NULL, "unable to delete object header") } /* end if */ } /* end if */ @@ -1285,8 +1176,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, - hid_t dxpl_id) +H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id) { H5D_t *dset = NULL; H5G_loc_t dset_loc; /* Object location of dataset */ @@ -1296,7 +1186,7 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, hbool_t loc_found = FALSE; /* Location at 'name' found */ H5D_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(loc); @@ -1308,18 +1198,18 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id, H5G_loc_reset(&dset_loc); /* Find the dataset object */ - if(H5G_loc_find(loc, name, &dset_loc, dapl_id, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &dset_loc) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&oloc, &obj_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get object type") if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, NULL, "not a dataset") /* Open the dataset */ - if(NULL == (dset = H5D_open(&dset_loc, dapl_id, dxpl_id))) + if(NULL == (dset = H5D_open(&dset_loc, dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't open dataset") /* Set return value */ @@ -1330,7 +1220,7 @@ done: if(loc_found && H5G_loc_free(&dset_loc) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "can't free location") - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__open_name() */ @@ -1346,7 +1236,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) +H5D_open(const H5G_loc_t *loc, hid_t dapl_id) { H5D_shared_t *shared_fo = NULL; H5D_t *dataset = NULL; @@ -1371,7 +1261,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, NULL, "can't copy path") /* Get the external file prefix */ - if(H5D_build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) + if(H5D__build_extfile_prefix(dataset, dapl_id, &extfile_prefix) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize external file prefix") /* Check if dataset was already open */ @@ -1380,7 +1270,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the dataset object */ - if(H5D__open_oid(dataset, dapl_id, dxpl_id) < 0) + if(H5D__open_oid(dataset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") /* Add the dataset to the list of opened objects in the file */ @@ -1437,7 +1327,7 @@ done: if(shared_fo == NULL && dataset->shared) { /* Need to free shared fo */ dataset->shared->extfile_prefix = (char *)H5MM_xfree(dataset->shared->extfile_prefix); dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); - } + } /* end if */ H5O_loc_free(&(dataset->oloc)); H5G_name_free(&(dataset->path)); @@ -1536,7 +1426,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) +H5D__open_oid(H5D_t *dataset, hid_t dapl_id) { H5P_genplist_t *plist; /* Property list */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ @@ -1545,7 +1435,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset); @@ -1559,13 +1449,13 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open") /* Get the type and space */ - if(NULL == (dataset->shared->type = (H5T_t *)H5O_msg_read(&(dataset->oloc), H5O_DTYPE_ID, NULL, dxpl_id))) + if(NULL == (dataset->shared->type = (H5T_t *)H5O_msg_read(&(dataset->oloc), H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load type info from dataset header") if(H5T_set_loc(dataset->shared->type, dataset->oloc.file, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location") - if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) + if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Cache the dataset's dataspace info */ @@ -1581,7 +1471,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the layout/pline/efl message information */ - if(H5D__layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) + if(H5D__layout_oh_read(dataset, dapl_id, plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info") /* Indicate that the layout information was initialized */ @@ -1595,18 +1485,18 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) fill_prop = &dataset->shared->dcpl_cache.fill; /* Try to get the new fill value message from the object header */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_NEW_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_NEW_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_NEW_ID, fill_prop)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") } /* end if */ else { /* For backward compatibility, try to retrieve the old fill value message */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_FILL_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_FILL_ID, fill_prop)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") } /* end if */ else { @@ -1665,8 +1555,6 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) H5D_io_info_t io_info; io_info.dset = dataset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_OPEN, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") @@ -1678,7 +1566,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") if(dataset->shared) { if(layout_init) - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") if(dataset->shared->space && H5S_close(dataset->shared->space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") @@ -1688,18 +1576,48 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ else { - if(H5T_close(dataset->shared->type) < 0) + if(H5T_close_real(dataset->shared->type) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end else */ } /* end if */ } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__open_oid() */ /*------------------------------------------------------------------------- + * Function: H5D__close_cb + * + * Purpose: Callback routine for closing a dataset ID. Closes the dataset + * object that was attached to the ID. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5D__close_cb(H5D_t *dataset) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* check args */ + HDassert(dataset && dataset->oloc.file && dataset->shared); + HDassert(dataset->shared->fo_count > 0); + + /* Call actual dataset close routine */ + if(H5D_close(dataset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close dataset"); + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__close_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5D_close * * Purpose: Insures that all data has been saved to the file, closes the @@ -1732,7 +1650,7 @@ H5D_close(H5D_t *dataset) if(dataset->shared->fo_count == 0) { /* Flush the dataset's information. Continue to close even if it fails. */ - if(H5D__flush_real(dataset, H5AC_ind_read_dxpl_id) < 0) + if(H5D__flush_real(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") /* Set a flag to indicate the dataset is closing, before we start freeing things */ @@ -1812,7 +1730,7 @@ H5D_close(H5D_t *dataset) } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, H5AC_ind_read_dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") /* Free the external file prefix */ @@ -1842,21 +1760,21 @@ H5D_close(H5D_t *dataset) /* Remove the dataset from the list of opened objects in the file */ if(H5FO_top_decr(dataset->oloc.file, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dataset->oloc.file, H5AC_ind_read_dxpl_id, dataset->oloc.addr) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + if(H5FO_delete(dataset->oloc.file, dataset->oloc.addr) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") /* Close the dataset object */ /* (This closes the file, if this is the last object open) */ if(H5O_close(&(dataset->oloc), &file_closed) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Evict dataset metadata if evicting on close */ if(!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { - if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") + if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") + if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ /* @@ -1867,7 +1785,6 @@ H5D_close(H5D_t *dataset) */ dataset->oloc.file = NULL; dataset->shared = H5FL_FREE(H5D_shared_t, dataset->shared); - } /* end if */ else { /* Decrement the ref. count for this object in the top file */ @@ -1911,7 +1828,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id) +H5D_mult_refresh_close(hid_t dset_id) { H5D_t *dataset; /* Dataset to refresh */ herr_t ret_value = SUCCEED; /* return value */ @@ -1970,7 +1887,7 @@ H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id) } /* end switch */ /*lint !e788 All appropriate cases are covered */ /* Destroy any cached layout information for the dataset */ - if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") } /* end if */ @@ -1983,13 +1900,13 @@ done: * Function: H5D_mult_refresh_reopen * * Purpose: Re-initialize the needed info when the dataset has multiple - * opens. (From H5O_refresh_metadata_reopen()) + * opens. * * Return: Non-negative on success/Negative on failure *------------------------------------------------------------------------- */ herr_t -H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) +H5D_mult_refresh_reopen(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2005,7 +1922,7 @@ H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to release dataspace") /* Re-load dataspace info */ - if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc), dxpl_id))) + if(NULL == (dataset->shared->space = H5S_read(&(dataset->oloc)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to load dataspace info from dataset header") /* Cache the dataset's dataspace info */ @@ -2017,7 +1934,7 @@ H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") /* Re-load layout message info */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message") } /* end if */ @@ -2127,7 +2044,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, /* Check if we have a zero-sized dataset */ if(layout->storage.u.contig.size > 0) { /* Reserve space in the file for the entire array */ - if(H5D__contig_alloc(f, io_info->md_dxpl_id, &layout->storage.u.contig/*out*/) < 0) + if(H5D__contig_alloc(f, &layout->storage.u.contig/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") /* Indicate that we should initialize storage space */ @@ -2144,7 +2061,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, case H5D_CHUNKED: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Create the root of the index that manages chunked storage */ - if(H5D__chunk_create(dset /*in,out*/, io_info->md_dxpl_id) < 0) + if(H5D__chunk_create(dset /*in,out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Indicate that we set the storage addr */ @@ -2245,7 +2162,7 @@ H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, */ if(time_alloc != H5D_ALLOC_CREATE && addr_set) /* Mark the layout as dirty, for later writing to the file */ - if(H5D__mark(dset, io_info->md_dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -2279,7 +2196,7 @@ H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t /* If we will be immediately overwriting the values, don't bother to clear them */ if(!full_overwrite) { /* Fill the compact dataset storage */ - if(H5D__compact_fill(dset, io_info->md_dxpl_id) < 0) + if(H5D__compact_fill(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize compact dataset storage") } /* end if */ break; @@ -2327,7 +2244,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__get_storage_size + * Function: H5D__get_storage_size_real * * Purpose: Determines how much space has been reserved to store the raw * data of a dataset. @@ -2335,17 +2252,17 @@ done: * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ -herr_t -H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) +static herr_t +H5D__get_storage_size_real(const H5D_t *dset, hsize_t *storage_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) switch(dset->shared->layout.type) { case H5D_CHUNKED: if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - if(H5D__chunk_allocated(dset, dxpl_id, storage_size) < 0) + if(H5D__chunk_allocated(dset, storage_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve chunked dataset allocated size") } /* end if */ else @@ -2377,7 +2294,36 @@ H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) } /*lint !e788 All appropriate cases are covered */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, 0) + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5D__get_storage_size_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__get_storage_size + * + * Purpose: Determines how much space has been reserved to store the raw + * data of a dataset. + * + * Note: This routine is needed so that there's a non-API routine for + * creating attributes that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success, negative on failure + *------------------------------------------------------------------------- + */ +herr_t +H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Difficult to error check, since the error value is 0 and 0 is a valid value... :-/ */ + if(H5D__get_storage_size_real(dset, storage_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__get_storage_size() */ @@ -2430,19 +2376,17 @@ done: * * Purpose: Frees the buffers allocated for storing variable-length data * in memory. Only frees the VL data in the selection defined in the - * dataspace. The dataset transfer property list is required to find the - * correct allocation/free methods for the VL data in the buffer. + * dataspace. * * Return: Non-negative on success, negative on failure *------------------------------------------------------------------------- */ herr_t -H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) +H5D_vlen_reclaim(hid_t type_id, H5S_t *space, void *buf) { H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2450,14 +2394,13 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) /* Check args */ HDassert(H5I_DATATYPE == H5I_get_type(type_id)); HDassert(space); - HDassert(H5P_isa_class(plist_id, H5P_DATASET_XFER)); HDassert(buf); if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Get the allocation info */ - if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Call H5S_select_iterate with args, etc. */ @@ -2465,7 +2408,7 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) dset_op.u.app_op.op = H5T_vlen_reclaim; dset_op.u.app_op.type_id = type_id; - ret_value = H5S_select_iterate(buf, type, space, &dset_op, vl_alloc_info); + ret_value = H5S_select_iterate(buf, type, space, &dset_op, &vl_alloc_info); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2524,7 +2467,8 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) *------------------------------------------------------------------------- */ herr_t -H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) +H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, + unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ @@ -2548,7 +2492,7 @@ H5D__vlen_get_buf_size(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ATT HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't select point") /* Read in the point (with the custom VL memory allocator) */ - if(H5D__read(vlen_bufsize->dset, type_id, vlen_bufsize->mspace, vlen_bufsize->fspace, vlen_bufsize->xfer_pid, vlen_bufsize->fl_tbuf) < 0) + if(H5D__read(vlen_bufsize->dset, type_id, vlen_bufsize->mspace, vlen_bufsize->fspace, vlen_bufsize->fl_tbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read point") done: @@ -2616,14 +2560,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) +H5D__set_extent(H5D_t *dset, const hsize_t *size) { hsize_t curr_dims[H5S_MAX_RANK]; /* Current dimension sizes */ htri_t changed; /* Whether the dataspace changed size */ size_t u, v; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dset->oloc.addr) /* Check args */ HDassert(dset); @@ -2718,7 +2662,7 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) /* Check if updating the chunk cache indices is necessary */ if(update_chunks) /* Update the chunk cache indices */ - if(H5D__chunk_update_cache(dset, dxpl_id) < 0) + if(H5D__chunk_update_cache(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ @@ -2751,12 +2695,10 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5D_io_info_t io_info; io_info.dset = dset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset storage") - } + } /* end if */ /*------------------------------------------------------------------------- * Remove chunk information in the case of chunked datasets * This removal takes place only in case we are shrinking the dateset @@ -2766,24 +2708,24 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(H5D_CHUNKED == dset->shared->layout.type) { if(shrink && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) /* Remove excess chunks */ - if(H5D__chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_prune_by_extent(dset, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks") /* Update chunks that are no longer edge chunks as a result of * expansion */ if(expand && (dset->shared->layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (dset->shared->dcpl_cache.pline.nused > 0)) - if(H5D__chunk_update_old_edge_chunks(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_update_old_edge_chunks(dset, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to do update old edge chunks") } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__set_extent() */ @@ -2797,7 +2739,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_sieve_buf(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2812,7 +2754,7 @@ H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) /* Write dirty data sieve buffer to file */ if(H5F_block_write(dataset->oloc.file, H5FD_MEM_DRAW, dataset->shared->cache.contig.sieve_loc, - dataset->shared->cache.contig.sieve_size, dxpl_id, dataset->shared->cache.contig.sieve_buf) < 0) + dataset->shared->cache.contig.sieve_size, dataset->shared->cache.contig.sieve_buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed") /* Reset sieve buffer dirty flag */ @@ -2834,30 +2776,61 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_real(H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* Check args */ HDassert(dataset); HDassert(dataset->shared); /* Avoid flushing the dataset (again) if it's closing */ - if(!dataset->shared->closing) { + if(!dataset->shared->closing) /* Flush cached raw data for each kind of dataset layout */ - if(dataset->shared->layout.ops->flush && - (dataset->shared->layout.ops->flush)(dataset, dxpl_id) < 0) + if(dataset->shared->layout.ops->flush && (dataset->shared->layout.ops->flush)(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush raw data") - } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__flush_real() */ /*------------------------------------------------------------------------- + * Function: H5D__flush + * + * Purpose: Flush dataset information cached in memory + * + * Return: Success: Non-negative + * Failure: Negative + *------------------------------------------------------------------------- + */ +herr_t +H5D__flush(H5D_t *dset, hid_t dset_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(dset); + HDassert(dset->shared); + + /* Flush any dataset information still cached in memory */ + if(H5D__flush_real(dset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush cached dataset info") + + /* Flush object's metadata to file */ + if(H5O_flush_common(&dset->oloc, dset_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__flush() */ + + +/*------------------------------------------------------------------------- * Function: H5D__format_convert * * Purpose: For chunked: downgrade the chunk indexing type to version 1 B-tree @@ -2868,7 +2841,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) +H5D__format_convert(H5D_t *dataset) { H5D_chk_idx_info_t new_idx_info; /* Index info for the new layout */ H5D_chk_idx_info_t idx_info; /* Index info for the current layout */ @@ -2878,7 +2851,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) hbool_t add_new_layout = FALSE; /* Indicate that the new layout message is added */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dataset->oloc.addr) /* Check args */ HDassert(dataset); @@ -2892,7 +2865,6 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) /* Set up the current index info */ idx_info.f = dataset->oloc.file; - idx_info.dxpl_id = dxpl_id; idx_info.pline = &dataset->shared->dcpl_cache.pline; idx_info.layout = &dataset->shared->layout.u.chunk; idx_info.storage = &dataset->shared->layout.storage.u.chunk; @@ -2909,7 +2881,6 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) /* Set up the index info to version 1 B-tree */ new_idx_info.f = dataset->oloc.file; - new_idx_info.dxpl_id = dxpl_id; new_idx_info.pline = &dataset->shared->dcpl_cache.pline; new_idx_info.layout = &(newlayout->u).chunk; new_idx_info.storage = &(newlayout->storage).u.chunk; @@ -2934,13 +2905,13 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) } /* end if */ /* Delete the old "current" layout message */ - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") delete_old_layout = TRUE; /* Append the new layout message to the object header */ - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout, dxpl_id) < 0) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, newlayout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout header message") add_new_layout = TRUE; @@ -2958,7 +2929,7 @@ H5D__format_convert(H5D_t *dataset, hid_t dxpl_id) case H5D_COMPACT: HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; - if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id) < 0) + if(H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") break; @@ -2977,12 +2948,12 @@ done: if(ret_value < 0 && dataset->shared->layout.type == H5D_CHUNKED) { /* Remove new layout message */ if(add_new_layout) - if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(&dataset->oloc, H5O_LAYOUT_ID, H5O_ALL, FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete layout message") /* Add back old layout message */ if(delete_old_layout) - if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout, dxpl_id) < 0) + if(H5O_msg_create(&dataset->oloc, H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &dataset->shared->layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to add layout header message") /* Clean up v1 b-tree chunk index */ @@ -2993,7 +2964,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "address undefined") /* Expunge from cache all v1 B-tree type entries associated with tag */ - if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dxpl_id, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) + if(H5AC_expunge_tag_type_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_BT_ID, H5AC__NO_FLAGS_SET)) HDONE_ERROR(H5E_DATASET, H5E_CANTEXPUNGE, FAIL, "unable to expunge index metadata") } /* end if */ @@ -3006,7 +2977,7 @@ done: if(newlayout != NULL) newlayout = (H5O_layout_t *)H5MM_xfree(newlayout); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__format_convert() */ @@ -3020,7 +2991,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) +H5D__mark(const H5D_t *dataset, unsigned flags) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3036,12 +3007,12 @@ H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) unsigned update_flags = H5O_UPDATE_TIME; /* Modification time flag */ /* Pin the object header */ - if(NULL == (oh = H5O_pin(&dataset->oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(&dataset->oloc))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPIN, FAIL, "unable to pin dataset object header") /* Update the layout on disk, if it's been changed */ if(flags & H5D_MARK_LAYOUT) { - if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) + if(H5D__layout_oh_write(dataset, oh, update_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout info") /* Reset the "update the modification time" flag, so we only do it once */ @@ -3050,7 +3021,7 @@ H5D__mark(const H5D_t *dataset, hid_t H5_ATTR_UNUSED dxpl_id, unsigned flags) /* Update the dataspace on disk, if it's been changed */ if(flags & H5D_MARK_SPACE) { - if(H5S_write(dataset->oloc.file, dxpl_id, oh, update_flags, dataset->shared->space) < 0) + if(H5S_write(dataset->oloc.file, oh, update_flags, dataset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update file with new dataspace") /* Reset the "update the modification time" flag, so we only do it once */ @@ -3072,7 +3043,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__flush_cb + * Function: H5D__flush_all_cb * * Purpose: Flush any dataset information cached in memory * @@ -3081,31 +3052,31 @@ done: *------------------------------------------------------------------------- */ static int -H5D__flush_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) +H5D__flush_all_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) { - H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ - H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ - int ret_value = H5_ITER_CONT; /* Return value */ + H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ + H5F_t *f = (H5F_t *)_udata; /* User data for callback */ + int ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); + HDassert(f); /* Check for dataset in same file */ - if(udata->f == dataset->oloc.file) { + if(f == dataset->oloc.file) /* Flush the dataset's information */ - if(H5D__flush_real(dataset, udata->dxpl_id) < 0) + if(H5D__flush_real(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to flush cached dataset info") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__flush_cb() */ +} /* end H5D__flush_all_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_flush + * Function: H5D_flush_all * * Purpose: Flush any dataset information cached in memory * @@ -3114,9 +3085,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush(const H5F_t *f, hid_t dxpl_id) +H5D_flush_all(const H5F_t *f) { - H5D_flush_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3124,17 +3094,51 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) /* Check args */ HDassert(f); - /* Set user data for callback */ - udata.f = f; - udata.dxpl_id = dxpl_id; - /* Iterate over all the open datasets */ - if(H5I_iterate(H5I_DATASET, H5D__flush_cb, &udata, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5D__flush_all_cb, (void *)f, FALSE) < 0) /* Casting away const OK -QAK */ HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush() */ +} /* end H5D_flush_all() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__get_create_plist + * + * Purpose: Internal routine to retrieve a dataset's creation property list. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: ID for a copy of the dataset creation property + * list. The property list ID should be released + * by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5D__get_create_plist(const H5D_t *dset) +{ + hid_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(dset); + + /* Retrieve the DCPL */ + if((ret_value = H5D_get_create_plist(dset)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset's creation property list") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__get_create_plist() */ /*------------------------------------------------------------------------- @@ -3172,7 +3176,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&dset->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) + if(H5O_get_create_plist(&dset->oloc, new_plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object creation info") /* Get the layout property */ @@ -3234,7 +3238,7 @@ H5D_get_create_plist(H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy dataset datatype for fill value") /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(dset->shared->type, copied_fill.type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* Convert disk form of fill value into memory form */ @@ -3262,7 +3266,7 @@ H5D_get_create_plist(H5D_t *dset) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf, H5AC_noio_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, bkg_buf) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) @@ -3368,18 +3372,17 @@ H5D_get_access_plist(H5D_t *dset) ret_value = new_dapl_id; done: - if(ret_value < 0) { + if(ret_value < 0) if(new_dapl_id > 0) if(H5I_dec_app_ref(new_dapl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_get_access_plist() */ /*------------------------------------------------------------------------- - * Function: H5D_get_space + * Function: H5D__get_space * * Purpose: Returns and ID for the dataspace of the dataset. * @@ -3388,16 +3391,16 @@ done: *------------------------------------------------------------------------- */ hid_t -H5D_get_space(H5D_t *dset) +H5D__get_space(const H5D_t *dset) { H5S_t *space = NULL; hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* If the layout is virtual, update the extent */ if(dset->shared->layout.type == H5D_VIRTUAL) - if(H5D__virtual_set_extent_unlim(dset, H5AC_ind_read_dxpl_id) < 0) + if(H5D__virtual_set_extent_unlim(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update virtual dataset extent") /* Read the data space message and return a data space object */ @@ -3414,26 +3417,27 @@ done: if(H5S_close(space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_space() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5D__get_space() */ /*------------------------------------------------------------------------- - * Function: H5D_get_type + * Function: H5D__get_type * * Purpose: Returns and ID for the datatype of the dataset. * * Return: Success: ID for datatype * Failure: FAIL + * *------------------------------------------------------------------------- */ hid_t -H5D_get_type(H5D_t *dset) +H5D__get_type(const H5D_t *dset) { H5T_t *dt = NULL; hid_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Patch the datatype's "top level" file pointer */ if(H5T_patch_file(dset->shared->type, dset->oloc.file) < 0) @@ -3455,13 +3459,12 @@ H5D_get_type(H5D_t *dset) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") done: - if(ret_value < 0) { + if(ret_value < 0) if(dt && H5T_close(dt) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_type() */ +} /* end H5D__get_type() */ /*------------------------------------------------------------------------- @@ -3473,13 +3476,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__refresh(hid_t dset_id, H5D_t *dset, hid_t dxpl_id) +H5D__refresh(hid_t dset_id, H5D_t *dset) { H5D_virtual_held_file_t *head = NULL; /* Pointer to list of files held open */ hbool_t virt_dsets_held = FALSE; /* Whether virtual datasets' files are held open */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Sanity check */ HDassert(dset); @@ -3493,22 +3496,20 @@ H5D__refresh(hid_t dset_id, H5D_t *dset, hid_t dxpl_id) virt_dsets_held = TRUE; /* Refresh source datasets for virtual dataset */ - if(H5D__virtual_refresh_source_dsets(dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dsets(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh VDS source datasets") } /* end if */ /* Refresh dataset object */ - if((H5O_refresh_metadata(dset_id, dset->oloc, dxpl_id)) < 0) + if((H5O_refresh_metadata(dset_id, dset->oloc)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh dataset") done: - /* Release hold on virtual datasets' files */ - if(virt_dsets_held) { - /* Release the hold on source datasets' files */ + /* Release hold on (source) virtual datasets' files */ + if(virt_dsets_held) if(H5D__virtual_release_source_dset_files(head) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't release VDS source files held open") - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__refresh() */ diff --git a/src/H5Dio.c b/src/H5Dio.c index aee3c35..5b5bb5e 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -50,21 +51,14 @@ /********************/ /* Setup/teardown routines */ -static herr_t H5D__ioinfo_init(H5D_t *dset, -#ifndef H5_HAVE_PARALLEL -const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, - H5D_io_info_t *io_info); -static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, - H5D_type_info_t *type_info); +static herr_t H5D__ioinfo_init(H5D_t *dset, const H5D_type_info_t *type_info, + H5D_storage_t *store, H5D_io_info_t *io_info); +static herr_t H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, + hbool_t do_write, H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL static herr_t H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, - hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, - const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); -static herr_t H5D__ioinfo_term(H5D_io_info_t *io_info); + const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, + const H5D_chunk_map_t *fm); #endif /* H5_HAVE_PARALLEL */ static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); @@ -118,20 +112,18 @@ H5FL_DEFINE(H5D_chunk_map_t); */ herr_t H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t plist_id, void *buf/*out*/) + hid_t file_space_id, hid_t dxpl_id, void *buf/*out*/) { - H5D_t *dset = NULL; + H5D_t *dset = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; - H5P_genplist_t *plist; /* Property list pointer */ - hsize_t *direct_offset = NULL; hbool_t direct_read = FALSE; - uint32_t direct_filters = 0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, - plist_id, buf); + dxpl_id, buf); /* check arguments */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -161,30 +153,38 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, } /* end if */ /* Get the default dataset transfer property list if the user didn't provide one */ - if (H5P_DEFAULT == plist_id) - plist_id= H5P_DATASET_XFER_DEFAULT; + if(H5P_DEFAULT == dxpl_id) + dxpl_id = H5P_DATASET_XFER_DEFAULT; else - if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_XFER)) + if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(plist_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct read' flag */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME, &direct_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") + if(H5CX_get_dcr_flag(&direct_read) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") + /* Set up for direct read of chunk, bypassing filters, etc. */ if(direct_read) { - unsigned u; - hsize_t internal_offset[H5O_LAYOUT_NDIMS]; + hsize_t *direct_offset; /* Chunk offset from calling routine */ + hsize_t internal_offset[H5O_LAYOUT_NDIMS]; /* Internal copy of chunk offset */ + uint32_t direct_filters = 0; /* Filters for chunk */ + unsigned u; /* Local index variable */ + /* Sanity check */ if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") - /* Get the direct chunk offset property */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME, &direct_offset) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting direct offset from xfer properties") + /* Get the direct chunk offset */ + if(H5CX_get_dcr_offset(&direct_offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting offset for direct chunk read") + HDassert(direct_offset); /* The library's chunking code requires the offset terminates with a zero. So transfer the * offset array to an internal offset array */ @@ -204,19 +204,21 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, internal_offset[dset->shared->ndims] = 0; /* Read the raw chunk */ - if(H5D__chunk_direct_read(dset, plist_id, internal_offset, &direct_filters, buf) < 0) + if(H5D__chunk_direct_read(dset, internal_offset, &direct_filters, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read chunk directly") - /* Set the chunk filter mask property */ - if(H5P_set(plist, H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME, &direct_filters) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error setting filter mask xfer property") - } - else { - /* read raw data */ - if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) + + /* Set the chunk filter mask for application */ + H5CX_set_dcr_filters(direct_filters); + } /* end if */ + else + /* Read raw data */ + if(H5D__read(dset, mem_type_id, mem_space, file_space, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") - } done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dread() */ @@ -254,13 +256,13 @@ done: */ herr_t H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, - hid_t file_space_id, hid_t dxpl_id, const void *buf) + hid_t file_space_id, hid_t dxpl_id, const void *buf) { H5D_t *dset = NULL; - H5P_genplist_t *plist; /* Property list pointer */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; hbool_t direct_write = FALSE; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -275,18 +277,21 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* Get the default dataset transfer property list if the user didn't provide one */ if(H5P_DEFAULT == dxpl_id) - dxpl_id= H5P_DATASET_XFER_DEFAULT; + dxpl_id = H5P_DATASET_XFER_DEFAULT; else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms") - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Retrieve the 'direct write' flag */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &direct_write) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk write") + if(H5CX_get_dcw_flag(&direct_write) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting flag for direct chunk read") /* Check dataspace selections if this is not a direct write */ if(!direct_write) { @@ -309,12 +314,15 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5S_SELECT_VALID(file_space) != TRUE) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "file selection+offset not within extent") } /* end if */ - } + } /* end if */ - if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + if(H5D__pre_write(dset, direct_write, mem_type_id, mem_space, file_space, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't prepare for writing data") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Dwrite() */ @@ -330,36 +338,30 @@ done: */ herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, - hid_t dxpl_id, const void *buf) + const H5S_t *mem_space, const H5S_t *file_space, const void *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_PACKAGE_VOL /* Direct chunk write */ if(direct_write) { - H5P_genplist_t *plist; /* Property list pointer */ uint32_t direct_filters; hsize_t *direct_offset; uint32_t direct_datasize; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; unsigned u; /* Local index variable */ - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") /* Retrieve parameters for direct chunk write */ - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &direct_offset) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") + if(H5CX_get_dcw_filters(&direct_filters) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") + if(H5CX_get_dcw_offset(&direct_offset) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") + if(H5CX_get_dcw_datasize(&direct_datasize) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") /* The library's chunking code requires the offset terminates with a zero. So transfer the * offset array to an internal offset array */ @@ -379,17 +381,16 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, internal_offset[dset->shared->ndims] = 0; /* write raw data */ - if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) + if(H5D__chunk_direct_write(dset, direct_filters, internal_offset, direct_datasize, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") } /* end if */ - else { /* Normal write */ - /* write raw data */ - if(H5D__write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + else + /* Normal write of raw data */ + if(H5D__write(dset, mem_type_id, mem_space, file_space, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") - } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5D__pre_write() */ @@ -408,7 +409,7 @@ done: */ herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) + const H5S_t *file_space, void *buf/*out*/) { H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -430,14 +431,11 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_VOL_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -450,20 +448,24 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Set up datatype info for operation */ - if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; #ifdef H5_HAVE_PARALLEL - /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && - !(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") + /* Check for non-MPI-based VFD */ + if(!(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) { + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + + /* Get I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + + /* Collective access is not permissible without a MPI based VFD */ + if(io_xfer_mode == H5FD_MPIO_COLLECTIVE) + HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") + } /* end if */ #endif /*H5_HAVE_PARALLEL*/ /* Make certain that the number of elements in each selection is the same */ @@ -547,8 +549,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_DONE(SUCCEED) /* Go fill the user's selection with the dataset's fill value */ - if(H5D__fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, - type_info.mem_type, mem_space, dxpl_id) < 0) + if(H5D__fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, type_info.mem_type, mem_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "filling buf failed") else HGOTO_DONE(SUCCEED) @@ -557,9 +558,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_READ; io_info.u.rbuf = buf; - if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") - io_info_init = TRUE; /* Sanity check that space is allocated, if there are elements */ if(nelmts > 0) @@ -578,7 +578,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -593,19 +593,6 @@ done: if(fm) fm = H5FL_FREE(H5D_chunk_map_t, fm); - if(io_info_init) { -#ifdef H5_DEBUG_BUILD - /* release the metadata dxpl that was copied in the init function */ - if(H5I_dec_ref(io_info.md_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL - /* Shut down io_info struct */ - if(H5D__ioinfo_term(&io_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") -#endif /*H5_HAVE_PARALLEL*/ - } - /* Shut down datatype info for operation */ if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") @@ -615,7 +602,7 @@ done: if(H5S_close(projected_mem_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) } /* end H5D__read() */ @@ -634,7 +621,7 @@ done: */ herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, - const H5S_t *file_space, hid_t dxpl_id, const void *buf) + const H5S_t *file_space, const void *buf) { H5D_chunk_map_t *fm = NULL; /* Chunk file<->memory mapping */ H5D_io_info_t io_info; /* Dataset I/O info */ @@ -656,14 +643,11 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_storage_t store; /*union of EFL and chunk pointer in file space */ hssize_t snelmts; /*total number of elmts (signed) */ hsize_t nelmts; /*total number of elmts */ - hbool_t io_info_init = FALSE; /* Whether the I/O info has been initialized */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -680,12 +664,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(0 == (H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") - /* Set up datatype info for operation */ - if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, mem_type_id, TRUE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; @@ -709,8 +689,14 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "Parallel IO does not support writing region reference datatypes yet") } /* end if */ else { + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + + /* Get I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) + if(io_xfer_mode == H5FD_MPIO_COLLECTIVE) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based driver only") } /* end else */ #endif /*H5_HAVE_PARALLEL*/ @@ -784,9 +770,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_WRITE; io_info.u.wbuf = buf; - if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up I/O operation") - io_info_init = TRUE; /* Allocate data space and initialize it if it hasn't been. */ if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 && @@ -820,7 +805,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, file_space, mem_space, &type_info, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -842,7 +827,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, * Update modification time. We have to do this explicitly because * writing to a dataset doesn't necessarily change the object header. */ - if(H5O_touch(&(dataset->oloc), FALSE, dxpl_id) < 0) + if(H5O_touch(&(dataset->oloc), FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time") #endif /* OLD_WAY */ @@ -853,19 +838,6 @@ done: if(fm) fm = H5FL_FREE(H5D_chunk_map_t, fm); - if(io_info_init) { -#ifdef H5_DEBUG_BUILD - /* release the metadata dxpl that was copied in the init function */ - if(H5I_dec_ref(io_info.md_dxpl_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "can't close metadata dxpl") -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL - /* Shut down io_info struct */ - if(H5D__ioinfo_term(&io_info) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") -#endif /*H5_HAVE_PARALLEL*/ - } - /* Shut down datatype info for operation */ if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") @@ -875,7 +847,7 @@ done: if(H5S_close(projected_mem_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__write() */ @@ -893,16 +865,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__ioinfo_init(H5D_t *dset, -#ifndef H5_HAVE_PARALLEL -const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) +H5D__ioinfo_init(H5D_t *dset, const H5D_type_info_t *type_info, + H5D_storage_t *store, H5D_io_info_t *io_info) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(dset); @@ -911,19 +877,8 @@ const HDassert(type_info->tpath); HDassert(io_info); - /* init both dxpls to the original one */ - io_info->md_dxpl_id = dxpl_id; - io_info->raw_dxpl_id = dxpl_id; - - /* set the dxpl IO type for sanity checking at the FD layer */ -#ifdef H5_DEBUG_BUILD - if(H5D_set_io_info_dxpls(io_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't set metadata and raw data dxpls") -#endif /* H5_DEBUG_BUILD */ - /* Set up "normal" I/O fields */ io_info->dset = dset; - io_info->dxpl_cache = dxpl_cache; io_info->store = store; /* Set I/O operations to initial values */ @@ -955,10 +910,7 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD - done: -#endif /* H5_DEBUG_BUILD */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__ioinfo_init() */ @@ -976,12 +928,12 @@ const *------------------------------------------------------------------------- */ static herr_t -H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, - hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, +H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info) { const H5T_t *src_type; /* Source datatype */ const H5T_t *dst_type; /* Destination datatype */ + H5Z_data_xform_t *data_transform; /* Data transform info */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1023,22 +975,40 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * enough value in xfer_parms since turning off datatype conversion also * turns off background preservation. */ - if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (type_info->tpath = H5T_path_find(src_type, dst_type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + /* Precompute some useful information */ type_info->src_type_size = H5T_get_size(src_type); type_info->dst_type_size = H5T_get_size(dst_type); type_info->max_type_size = MAX(type_info->src_type_size, type_info->dst_type_size); type_info->is_conv_noop = H5T_path_noop(type_info->tpath); - type_info->is_xform_noop = H5Z_xform_noop(dxpl_cache->data_xform_prop); + type_info->is_xform_noop = H5Z_xform_noop(data_transform); if(type_info->is_xform_noop && type_info->is_conv_noop) { type_info->cmpd_subset = NULL; type_info->need_bkg = H5T_BKG_NO; } /* end if */ else { + void *tconv_buf; /* Temporary conversion buffer pointer */ + void *bkgr_buf; /* Background conversion buffer pointer */ + size_t max_temp_buf; /* Maximum temporary buffer size */ + H5T_bkg_t bkgr_buf_type; /* Background buffer type */ size_t target_size; /* Desired buffer size */ + /* Get info from API context */ + if(H5CX_get_max_temp_buf(&max_temp_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve max. temp. buf size") + if(H5CX_get_tconv_buf(&tconv_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve temp. conversion buffer pointer") + if(H5CX_get_bkgr_buf(&bkgr_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve background conversion buffer pointer") + if(H5CX_get_bkgr_buf_type(&bkgr_buf_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve background buffer type") + /* Check if the datatypes are compound subsets of one another */ type_info->cmpd_subset = H5T_path_compound_subset(type_info->tpath); @@ -1050,7 +1020,7 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, if((path_bkg = H5T_path_bkg(type_info->tpath))) { /* Retrieve the bkgr buffer property */ - type_info->need_bkg = dxpl_cache->bkgr_buf_type; + type_info->need_bkg = bkgr_buf_type; type_info->need_bkg = MAX(path_bkg, type_info->need_bkg); } /* end if */ else @@ -1060,16 +1030,15 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, /* Set up datatype conversion/background buffers */ - /* Get buffer size from DXPL */ - target_size = dxpl_cache->max_temp_buf; + target_size = max_temp_buf; /* If the buffer is too small to hold even one element, try to make it bigger */ if(target_size < type_info->max_type_size) { hbool_t default_buffer_info; /* Whether the buffer information are the defaults */ /* Detect if we have all default settings for buffers */ - default_buffer_info = (hbool_t)((H5D_TEMP_BUF_SIZE == dxpl_cache->max_temp_buf) - && (NULL == dxpl_cache->tconv_buf) && (NULL == dxpl_cache->bkgr_buf)); + default_buffer_info = (hbool_t)((H5D_TEMP_BUF_SIZE == max_temp_buf) + && (NULL == tconv_buf) && (NULL == bkgr_buf)); /* Check if we are using the default buffer info */ if(default_buffer_info) @@ -1094,20 +1063,20 @@ H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, * malloc() is usually less resource-intensive if we allocate/free the * same size over and over. */ - if(NULL == (type_info->tconv_buf = (uint8_t *)dxpl_cache->tconv_buf)) { + if(NULL == (type_info->tconv_buf = (uint8_t *)tconv_buf)) { /* Allocate temporary buffer */ if(NULL == (type_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") type_info->tconv_buf_allocated = TRUE; } /* end if */ - if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)dxpl_cache->bkgr_buf)) { + if(type_info->need_bkg && NULL == (type_info->bkg_buf = (uint8_t *)bkgr_buf)) { size_t bkg_size; /* Desired background buffer size */ /* Compute the background buffer size */ /* (don't try to use buffers smaller than the default size) */ bkg_size = type_info->request_nelmts * type_info->dst_type_size; - if(bkg_size < dxpl_cache->max_temp_buf) - bkg_size = dxpl_cache->max_temp_buf; + if(bkg_size < max_temp_buf) + bkg_size = max_temp_buf; /* Allocate background buffer */ /* (Need calloc()-like call since memory needs to be initialized) */ @@ -1136,13 +1105,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, +H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; /* performed chunk optimization */ - H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1156,36 +1122,30 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, HDassert(type_info->tpath); HDassert(io_info); - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Reset the actual io mode properties to the default values in case - * the dxpl was previously used in a collective I/O operation. + * the DXPL (if it's non-default) was previously used in a collective + * I/O operation. */ - actual_chunk_opt_mode = H5D_MPIO_NO_CHUNK_OPTIMIZATION; - actual_io_mode = H5D_MPIO_NO_COLLECTIVE; - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + if(!H5CX_is_def_dxpl()) { + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_NO_CHUNK_OPTIMIZATION); + H5CX_set_mpio_actual_io_mode(H5D_MPIO_NO_COLLECTIVE); + } /* end if */ /* Make any parallel I/O adjustments */ if(io_info->using_mpi_vfd) { + H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request */ htri_t opt; /* Flag whether a selection is optimizable */ - /* Record the original state of parallel I/O transfer options */ - io_info->orig.xfer_mode = io_info->dxpl_cache->xfer_mode; - io_info->orig.coll_opt_mode = io_info->dxpl_cache->coll_opt_mode; - io_info->orig.io_ops.single_read = io_info->io_ops.single_read; - io_info->orig.io_ops.single_write = io_info->io_ops.single_write; + /* Get the original state of parallel I/O transfer mode */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* Get MPI communicator */ if(MPI_COMM_NULL == (io_info->comm = H5F_mpi_get_comm(dset->oloc.file))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator") /* Check if we can set direct MPI-IO read/write functions */ - if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info, dx_plist)) < 0) + if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace ") /* Check if we can use the optimized parallel I/O routines */ @@ -1217,34 +1177,36 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, "one of the dataspaces was neither simple nor scalar", "dataset was not contiguous or chunked" }; - if (H5P_get(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_no_collective_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get local no collective cause value") - if (H5P_get(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &global_no_collective_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get global no collective cause value") + if(H5CX_get_mpio_local_no_coll_cause(&local_no_collective_cause) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get local no collective cause value") + if(H5CX_get_mpio_global_no_coll_cause(&global_no_collective_cause) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get global no collective cause value") /* Append each of the "reason for breaking collective I/O" error messages to the * local and global no collective cause strings */ for (cause = 1, index = 0; cause < H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE; cause <<= 1, index++) { - size_t cause_strlen = strlen(cause_strings[index]); + size_t cause_strlen = HDstrlen(cause_strings[index]); if (cause & local_no_collective_cause) { /* Check if there were any previous error messages included. If so, prepend a semicolon * to separate the messages. */ - if (local_error_message_previously_written) strncat(local_no_collective_cause_string, "; ", 2); + if(local_error_message_previously_written) + HDstrncat(local_no_collective_cause_string, "; ", 2); - strncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(local_no_collective_cause_string, cause_strings[index], cause_strlen); local_error_message_previously_written = TRUE; } /* end if */ - if (cause & global_no_collective_cause) { + if(cause & global_no_collective_cause) { /* Check if there were any previous error messages included. If so, prepend a semicolon * to separate the messages. */ - if (global_error_message_previously_written) strncat(global_no_collective_cause_string, "; ", 2); + if(global_error_message_previously_written) + HDstrncat(global_no_collective_cause_string, "; ", 2); - strncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); + HDstrncat(global_no_collective_cause_string, cause_strings[index], cause_strlen); global_error_message_previously_written = TRUE; } /* end if */ @@ -1259,14 +1221,12 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, } /* end if */ /* If we won't be doing collective I/O, but the user asked for - * collective I/O, change the request to use independent I/O, but - * mark it so that we remember to revert the change. + * collective I/O, change the request to use independent I/O */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { + if(xfer_mode == H5FD_MPIO_COLLECTIVE) { /* Change the xfer_mode to independent for handling the I/O */ - io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") + if(H5CX_set_io_xfer_mode(H5FD_MPIO_INDEPENDENT) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O transfer mode") } /* end if */ } /* end else */ } /* end if */ @@ -1274,62 +1234,7 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_adjust() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__ioinfo_term - * - * Purpose: Common logic for terminating an I/O info object - * (Only used for restoring MPI transfer mode currently) - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, February 6, 2004 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_term(H5D_io_info_t *io_info) -{ - herr_t ret_value = SUCCEED; /*return value */ - - FUNC_ENTER_STATIC - - /* Check if we used the MPI VFD for the I/O */ - if(io_info->using_mpi_vfd) { - /* Check if we need to revert the change to the xfer mode */ - if(io_info->orig.xfer_mode != io_info->dxpl_cache->xfer_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Restore the original parallel I/O mode */ - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->orig.xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - } /* end if */ - - /* Check if we need to revert the change to the collective opt mode */ - if(io_info->orig.coll_opt_mode != io_info->dxpl_cache->coll_opt_mode) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Restore the original parallel I/O mode */ - if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->orig.coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set collective option mode") - } /* end if */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_term() */ - -#endif /* H5_HAVE_PARALLEL */ +#endif /*H5_HAVE_PARALLEL*/ /*------------------------------------------------------------------------- @@ -1362,53 +1267,3 @@ H5D__typeinfo_term(const H5D_type_info_t *type_info) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__typeinfo_term() */ -#ifdef H5_DEBUG_BUILD - -/*------------------------------------------------------------------------- - * Function: H5D_set_io_info_dxpls - * - * Purpose: Set the metadata and raw data dxpls in an io_info struct - * for sanity checking at the H5FD layer. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Mohamad Chaarawi - * January 2016 - * - *------------------------------------------------------------------------- - */ -herr_t -H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id) -{ - H5P_genplist_t *xfer_plist = NULL; /* Dataset transfer property list object */ - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_BADATOM, FAIL, "can't get new property list object") - - /* create the metadata dxpl */ - if((io_info->md_dxpl_id = H5P_copy_plist(xfer_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dxpl") - - /* Set the dxpl type property */ - dxpl_type = H5FD_RAWDATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set dxpl type property") - - /* Get the property list object */ - if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(io_info->md_dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_BADATOM, FAIL, "can't get new property list object") - - /* Set the dxpl type property */ - dxpl_type = H5FD_METADATA_DXPL; - if(H5P_set(xfer_plist, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set dxpl type property") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_set_io_info_dxpls */ -#endif /* H5_DEBUG_BUILD */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index ec18e86..a591957 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -25,6 +25,7 @@ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5HLprivate.h" /* Local heaps */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -454,8 +455,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, - hid_t dapl_id) +H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) { H5O_layout_t *layout; /* Dataset's layout information */ const H5O_fill_t *fill_prop; /* Pointer to dataset's fill value information */ @@ -463,7 +463,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Sanity checking */ HDassert(file); @@ -479,12 +479,12 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, H5O_pline_t *pline; /* Dataset's I/O pipeline information */ pline = &dset->shared->dcpl_cache.pline; - if(pline->nused > 0 && H5O_msg_append_oh(file, dxpl_id, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline) < 0) + if(pline->nused > 0 && H5O_msg_append_oh(file, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update filter header message") } /* end if */ /* Initialize the layout information for the new dataset */ - if(dset->shared->layout.ops->init && (dset->shared->layout.ops->init)(file, dxpl_id, dset, dapl_id) < 0) + if(dset->shared->layout.ops->init && (dset->shared->layout.ops->init)(file, dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") /* Indicate that the layout information was initialized */ @@ -498,12 +498,11 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, H5D_io_info_t io_info; io_info.dset = dset; - io_info.raw_dxpl_id = H5AC_rawdata_dxpl_id; - io_info.md_dxpl_id = dxpl_id; if(H5D__alloc_storage(&io_info, H5D_ALLOC_CREATE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") - } + } /* end if */ + /* Update external storage message, if it's used */ if(dset->shared->dcpl_cache.efl.nused > 0) { H5O_efl_t *efl = &dset->shared->dcpl_cache.efl; /* Dataset's external file list */ @@ -516,15 +515,15 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, heap_size += H5HL_ALIGN(HDstrlen(efl->slot[u].name) + 1); /* Create the heap for the EFL file names */ - if(H5HL_create(file, dxpl_id, heap_size, &efl->heap_addr/*out*/) < 0) + if(H5HL_create(file, heap_size, &efl->heap_addr/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create EFL file name heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file, dxpl_id, efl->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(file, efl->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_DATASET, H5E_CANTPROTECT, FAIL, "unable to protect EFL file name heap") /* Insert "empty" name first */ - if(UFAIL == H5HL_insert(file, dxpl_id, heap, (size_t)1, "")) { + if(UFAIL == H5HL_insert(file, heap, (size_t)1, "")) { H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") } /* end if */ @@ -533,7 +532,7 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, size_t offset; /* Offset of file name in heap */ /* Insert file name into heap */ - if(UFAIL == (offset = H5HL_insert(file, dxpl_id, heap, + if(UFAIL == (offset = H5HL_insert(file, heap, HDstrlen(efl->slot[u].name) + 1, efl->slot[u].name))) { H5HL_unprotect(heap); HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert file name into heap") @@ -549,11 +548,10 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, heap = NULL; /* Insert EFL message into dataset object header */ - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl) < 0) + if(H5O_msg_append_oh(file, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update external file list message") } /* end if */ - /* Create layout message */ /* (Don't make layout message constant unless allocation time is early and non-filtered, since space may not be allocated) */ /* (Note: this is relying on H5D__alloc_storage not calling H5O_msg_write during dataset creation) */ if(fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type @@ -561,7 +559,14 @@ H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, layout_mesg_flags = H5O_MSG_FLAG_CONSTANT; else layout_mesg_flags = 0; - if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_LAYOUT_ID, layout_mesg_flags, 0, layout) < 0) + + /* Store VDS info in global heap */ + if(H5D_VIRTUAL == layout->type) + if(H5D__virtual_store_layout(file, layout) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to store VDS info") + + /* Create layout message */ + if(H5O_msg_append_oh(file, oh, H5O_LAYOUT_ID, layout_mesg_flags, 0, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout") done: @@ -569,10 +574,10 @@ done: if(ret_value < 0) if(layout_init) /* Destroy any cached layout information for the dataset */ - if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset, dxpl_id) < 0) + if(dset->shared->layout.ops->dest && (dset->shared->layout.ops->dest)(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy layout info") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5D__layout_oh_create() */ @@ -590,7 +595,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) +H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) { htri_t msg_exists; /* Whether a particular type of message exists */ hbool_t layout_copied = FALSE; /* Flag to indicate that layout message was copied */ @@ -603,11 +608,11 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HDassert(plist); /* Get the optional filters message */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { /* Retrieve the I/O pipeline message */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_PLINE_ID, &dataset->shared->dcpl_cache.pline)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") /* Set the I/O pipeline info in the property list */ @@ -621,16 +626,16 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t * values are copied to the dataset create plist so the user can query * them. */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout), dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_LAYOUT_ID, &(dataset->shared->layout))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read data layout message") layout_copied = TRUE; /* Check for external file list message (which might not exist) */ - if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_EFL_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't check if message exists") if(msg_exists) { /* Retrieve the EFL message */ - if(NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl, dxpl_id)) + if(NULL == H5O_msg_read(&(dataset->oloc), H5O_EFL_ID, &dataset->shared->dcpl_cache.efl)) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve message") /* Set the EFL info in the property list */ @@ -645,7 +650,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HDassert(dataset->shared->layout.ops); /* Initialize the layout information for the dataset */ - if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) + if(dataset->shared->layout.ops->init && (dataset->shared->layout.ops->init)(dataset->oloc.file, dataset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize layout information") /* Adjust chunk dimensions to omit datatype size (in last dimension) for creation property */ @@ -657,16 +662,15 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout") /* Set chunk sizes */ - if(H5D_CHUNKED == dataset->shared->layout.type) { + if(H5D_CHUNKED == dataset->shared->layout.type) if(H5D__chunk_set_sizes(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") - } done: - if(ret_value < 0 && layout_copied) { + if(ret_value < 0 && layout_copied) if(H5O_msg_reset(H5O_LAYOUT_ID, &dataset->shared->layout) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout info") - } + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_oh_read() */ @@ -685,7 +689,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags) +H5D__layout_oh_write(H5D_t *dataset, H5O_t *oh, unsigned update_flags) { htri_t msg_exists; /* Whether the layout message exists */ herr_t ret_value = SUCCEED; /* Return value */ @@ -701,7 +705,7 @@ H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_f HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to check if layout message exists") if(msg_exists) { /* Write the layout message to the dataset's header */ - if(H5O_msg_write_oh(dataset->oloc.file, dxpl_id, oh, H5O_LAYOUT_ID, 0, update_flags, &dataset->shared->layout) < 0) + if(H5O_msg_write_oh(dataset->oloc.file, oh, H5O_LAYOUT_ID, 0, update_flags, &dataset->shared->layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout message") } /* end if */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 79572c0..669da68 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -32,6 +32,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -207,31 +208,23 @@ typedef struct H5D_filtered_collective_io_info_t { static herr_t H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__link_chunk_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk, - H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk); static herr_t H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); static herr_t H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5S_t *file_space, const H5S_t *mem_space); static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype *mpi_file_type, - MPI_Datatype *mpi_buf_type); + const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype mpi_file_type, + MPI_Datatype mpi_buf_type); static herr_t H5D__sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); static herr_t H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]); -static herr_t H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_xfer_t xfer_mode); -static herr_t H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_collective_opt_t coll_opt_mode); + uint8_t assign_io_mode[], haddr_t chunk_addr[]); static herr_t H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *min_chunkf); static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, @@ -284,11 +277,12 @@ static int H5D__cmp_filtered_collective_io_info_entry_owner(const void *filtered */ htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, - const H5S_t *mem_space, const H5D_type_info_t *type_info, H5P_genplist_t *dx_plist) + const H5S_t *mem_space, const H5D_type_info_t *type_info) { - int local_cause = 0; /* Local reason(s) for breaking collective mode */ - int global_cause = 0; /* Global reason(s) for breaking collective mode */ - htri_t ret_value = SUCCEED; /* Return value */ + H5FD_mpio_xfer_t io_xfer_mode; /* MPI I/O transfer mode */ + int local_cause = 0; /* Local reason(s) for breaking collective mode */ + int global_cause = 0; /* Global reason(s) for breaking collective mode */ + htri_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -300,7 +294,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* For independent I/O, get out quickly and don't try to form consensus */ - if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_INDEPENDENT) + if(H5CX_get_io_xfer_mode(&io_xfer_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + if(io_xfer_mode == H5FD_MPIO_INDEPENDENT) local_cause |= H5D_MPIO_SET_INDEPENDENT; /* Optimized MPI types flag must be set */ @@ -350,13 +346,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code) } /* end else */ - /* Write the local value of no-collective-cause to the DXPL. */ - if(H5P_set(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set local no collective cause property") - - /* Write the global value of no-collective-cause to the DXPL. */ - if(H5P_set(dx_plist, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, &global_cause) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set global no collective cause property") + /* Set the local & global values of no-collective-cause in the API context */ + H5CX_set_mpio_local_no_coll_cause(local_cause); + H5CX_set_mpio_global_no_coll_cause(global_cause); /* Set the return value, based on the global cause */ ret_value = global_cause > 0 ? FALSE : TRUE; @@ -387,7 +379,7 @@ H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t H5_ATT FUNC_ENTER_PACKAGE H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); - if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->raw_dxpl_id, io_info->u.rbuf) < 0) + if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read") done: @@ -417,7 +409,7 @@ H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t H5_AT /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); - if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->raw_dxpl_id, io_info->u.wbuf) < 0) + if(H5F_block_write(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->u.wbuf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't finish collective parallel write") done: @@ -533,81 +525,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__ioinfo_xfer_mode - * - * Purpose: Switch to between collective & independent MPI I/O - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Friday, August 12, 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_xfer_t xfer_mode) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_STATIC - - /* Change the xfer_mode */ - io_info->dxpl_cache->xfer_mode = xfer_mode; - if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - - /* Change the "single I/O" function pointers */ - if(xfer_mode == H5FD_MPIO_INDEPENDENT) { - /* Set the pointers to the original, non-MPI-specific routines */ - io_info->io_ops.single_read = io_info->orig.io_ops.single_read; - io_info->io_ops.single_write = io_info->orig.io_ops.single_write; - } /* end if */ - else { - HDassert(xfer_mode == H5FD_MPIO_COLLECTIVE); - - /* Set the pointers to the MPI-specific routines */ - io_info->io_ops.single_read = H5D__mpio_select_read; - io_info->io_ops.single_write = H5D__mpio_select_write; - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_xfer_mode() */ - - -/*------------------------------------------------------------------------- - * Function: H5D__ioinfo_coll_opt_mode - * - * Purpose: Switch between using collective & independent MPI I/O w/file - * set view - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: MuQun Yang - * Oct. 5th, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, - H5FD_mpio_collective_opt_t coll_opt_mode) -{ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_STATIC - - /* Change the optimal xfer_mode */ - io_info->dxpl_cache->coll_opt_mode = coll_opt_mode; - if(H5P_set(dx_plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &io_info->dxpl_cache->coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D__ioinfo_coll_opt_mode() */ - - -/*------------------------------------------------------------------------- * Function: H5D__mpio_get_min_chunk * * Purpose: Routine for obtaining minimum number of chunks to cover @@ -699,28 +616,21 @@ H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_ H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; - H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") - /* Obtain the data transfer properties */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") - /* Set the actual I/O mode property. internal_collective_io will not break to * independent I/O, so we set it here. */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: FUNC_LEAVE_NOAPI(ret_value) @@ -746,28 +656,21 @@ H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type H5D_chunk_map_t H5_ATTR_UNUSED *fm) { H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; - H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file)); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") - /* Obtain the data transfer properties */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") - /* Set the actual I/O mode property. internal_collective_io will not break to * independent I/O, so we set it here. */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +717,6 @@ static herr_t H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm) { - H5P_genplist_t *dx_plist; /* Pointer to DXPL */ H5FD_mpio_chunk_opt_t chunk_opt_mode; int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; int sum_chunk = -1; @@ -831,13 +733,9 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HDassert(type_info); HDassert(fm); - /* Obtain the data transfer properties */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - /* Check the optional property list for the collective chunk IO optimization option */ - if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, &chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get chunk optimization option") + if(H5CX_get_mpio_chunk_opt_mode(&chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't get chunk optimization option") if(H5FD_MPIO_CHUNK_ONE_IO == chunk_opt_mode) io_option = H5D_ONE_LINK_CHUNK_IO; /*no opt*/ @@ -855,8 +753,8 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Get the chunk optimization option threshold */ - if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, &one_link_chunk_io_threshold) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get chunk optimization option threshold value") + if(H5CX_get_mpio_chunk_opt_num(&one_link_chunk_io_threshold) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't get chunk optimization option threshold value") /* step 1: choose an IO option */ /* If the average number of chunk per process is greater than a threshold, we will do one link chunked IO. */ @@ -865,54 +763,30 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf #ifdef H5_HAVE_INSTRUMENTED_LIBRARY else temp_not_link_io = TRUE; -#endif +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { - H5P_genplist_t *plist; /* Property list pointer */ - htri_t check_prop; - int new_value; - - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /*** Test collective chunk user-input optimization APIs. ***/ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME); - if(check_prop > 0) { - if(H5D_ONE_LINK_CHUNK_IO == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + /*** Set collective chunk user-input optimization APIs. ***/ + if(H5D_ONE_LINK_CHUNK_IO == io_option) { + if(H5CX_test_set_mpio_coll_chunk_link_hard(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME); - if(check_prop > 0) { - if(H5D_MULTI_CHUNK_IO == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + else if(H5D_MULTI_CHUNK_IO == io_option) { + if(H5CX_test_set_mpio_coll_chunk_multi_hard(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") + } /* end else-if */ + else if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { + if(H5CX_test_set_mpio_coll_chunk_link_num_true(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME); - if(check_prop > 0) { - if(H5D_ONE_LINK_CHUNK_IO_MORE_OPT == io_option) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ - } /* end if */ - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME); - if(check_prop > 0) { - if(temp_not_link_io) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - } /* end if */ + else if(temp_not_link_io) { + if(H5CX_test_set_mpio_coll_chunk_link_num_false(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } -#endif +#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ /* step 2: Go ahead to do IO.*/ switch (io_option) { @@ -925,34 +799,31 @@ H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * complexity in unfiltering the data when it is read all at once into a * single buffer. */ - if (io_info->op_type == H5D_IO_OP_READ) { - if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(io_info->op_type == H5D_IO_OP_READ) { + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") } /* end if */ - else { - if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + else + if(H5D__link_chunk_filtered_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish filtered linked chunk MPI-IO") - } /* end else */ } /* end if */ - else { + else /* Perform unfiltered link chunk collective IO */ - if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk, dx_plist) < 0) + if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") - } /* end else */ break; case H5D_MULTI_CHUNK_IO: /* direct request to do multi-chunk IO */ default: /* multiple chunk IO via threshold */ /* Check if there are any filters in the pipeline */ if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { - if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(H5D__multi_chunk_filtered_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple filtered chunk MPI-IO") } /* end if */ - else { + else /* Perform unfiltered multi chunk collective IO */ - if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(H5D__multi_chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") - } /* end else */ break; } /* end switch */ @@ -1038,16 +909,11 @@ done: * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * - * Modification: - * - Set H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME and H5D_MPIO_ACTUAL_IO_MODE_NAME - * dxpl in this. - * Programmer: Jonathan Kim - * Date: 2012-10-10 *------------------------------------------------------------------------- */ static herr_t H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - H5D_chunk_map_t *fm, int sum_chunk, H5P_genplist_t *dx_plist) + H5D_chunk_map_t *fm, int sum_chunk) { H5D_chunk_addr_info_t *chunk_addr_info_array = NULL; MPI_Datatype chunk_final_mtype; /* Final memory MPI datatype for all chunks with seletion */ @@ -1066,20 +932,16 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ int *chunk_mpi_file_counts = NULL; /* Count of MPI file datatype for each chunk */ int *chunk_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each chunk */ int mpi_code; /* MPI return code */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* Set the actual-chunk-opt-mode property. */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_LINK_CHUNK); /* Set the actual-io-mode property. * Link chunk I/O does not break to independent, so can set right away */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Get the sum # of chunks, if not already available */ if(sum_chunk < 0) { @@ -1122,7 +984,7 @@ H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ mspace = chunk_info->mspace; /* Look up address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk address") ctg_store.contig.dset_addr = udata.chunk_block.offset; } /* end else */ @@ -1312,7 +1174,7 @@ if(H5DEBUG(D)) io_info->store = &ctg_store; /* Perform final collective I/O operation */ - if(H5D__final_collective_io(io_info, type_info, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) + if(H5D__final_collective_io(io_info, type_info, mpi_buf_count, chunk_final_ftype, chunk_final_mtype) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") } /* end else */ @@ -1402,12 +1264,10 @@ if(H5DEBUG(D)) */ static herr_t H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) + H5D_chunk_map_t *fm) { H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; /* The list of chunks used during collective operations */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; /* The actual chunk IO optimization mode */ - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* The chunk IO mode used (Independent vs Collective) */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ MPI_Datatype mem_type = MPI_BYTE; MPI_Datatype file_type = MPI_BYTE; @@ -1425,7 +1285,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HDassert(io_info); HDassert(type_info); HDassert(fm); - HDassert(dx_plist); /* Obtain the current rank of the process and the number of processes */ if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) @@ -1434,14 +1293,12 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual-chunk-opt-mode property. */ - if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_LINK_CHUNK); /* Set the actual-io-mode property. * Link chunk filtered I/O does not break to independent, so can set right away */ - if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective io operation */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) @@ -1454,7 +1311,6 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in /* Construct chunked index info */ index_info.f = io_info->dset->oloc.file; - index_info.dxpl_id = io_info->md_dxpl_id; index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); index_info.layout = &(io_info->dset->shared->layout.u.chunk); index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); @@ -1538,7 +1394,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_in io_info->store = &ctg_store; /* Perform I/O */ - if (H5D__final_collective_io(io_info, type_info, mpi_buf_count, &file_type, &mem_type) < 0) + if (H5D__final_collective_io(io_info, type_info, mpi_buf_count, file_type, mem_type) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") /* Participate in the collective re-insertion of all chunks modified @@ -1594,17 +1450,11 @@ done: * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * - * Modification: - * - Set H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME dxpl in this to go along with - * setting H5D_MPIO_ACTUAL_IO_MODE_NAME dxpl at the bottom. - * Programmer: Jonathan Kim - * Date: 2012-10-10 - * *------------------------------------------------------------------------- */ static herr_t H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) + H5D_chunk_map_t *fm) { H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ @@ -1614,22 +1464,19 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *ty uint8_t *chunk_io_option = NULL; haddr_t *chunk_addr = NULL; H5D_storage_t store; /* union of EFL and chunk pointer in file space */ - H5FD_mpio_xfer_t last_xfer_mode = H5FD_MPIO_COLLECTIVE; /* Last parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ H5FD_mpio_collective_opt_t last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; /* Last parallel transfer with independent IO or collective IO with this mode */ size_t total_chunk; /* Total # of chunks in dataset */ #ifdef H5Dmpio_DEBUG int mpi_rank; #endif size_t u; /* Local index variable */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* actual chunk optimization mode */ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* Set the actual chunk opt mode property */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_MULTI_CHUNK); #ifdef H5Dmpio_DEBUG mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); @@ -1648,7 +1495,7 @@ if(H5DEBUG(D)) #endif /* Obtain IO option for each chunk */ - if(H5D__obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) + if(H5D__obtain_mpio_mode(io_info, fm, chunk_io_option, chunk_addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode") /* Set up contiguous I/O info object */ @@ -1706,7 +1553,7 @@ if(H5DEBUG(D)) fspace = chunk_info->fspace; mspace = chunk_info->mspace; - /* Update the local variable tracking the dxpl's actual io mode property. + /* Update the local variable tracking the actual io mode property. * * Note: H5D_MPIO_COLLECTIVE_MULTI | H5D_MPIO_INDEPENDENT = H5D_MPIO_MIXED * to ease switching between to mixed I/O without checking the current @@ -1720,14 +1567,9 @@ if(H5DEBUG(D)) } /* end else */ /* Switch back to collective I/O */ - if(last_xfer_mode != H5FD_MPIO_COLLECTIVE) { - if(H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") - last_xfer_mode = H5FD_MPIO_COLLECTIVE; - } /* end if */ if(last_coll_opt_mode != H5FD_MPIO_COLLECTIVE_IO) { - if(H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") + if(H5CX_set_mpio_coll_opt(H5FD_MPIO_COLLECTIVE_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't switch to collective I/O") last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; } /* end if */ @@ -1751,7 +1593,7 @@ if(H5DEBUG(D)) fspace = chunk_info->fspace; mspace = chunk_info->mspace; - /* Update the local variable tracking the dxpl's actual io mode. */ + /* Update the local variable tracking the actual io mode. */ actual_io_mode = (H5D_mpio_actual_io_mode_t) (actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT); } /* end if */ else { @@ -1760,8 +1602,8 @@ if(H5DEBUG(D)) /* Using independent I/O with file setview.*/ if(last_coll_opt_mode != H5FD_MPIO_INDIVIDUAL_IO) { - if(H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to individual I/O") + if(H5CX_set_mpio_coll_opt(H5FD_MPIO_INDIVIDUAL_IO) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't switch to individual I/O") last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; } /* end if */ @@ -1778,9 +1620,8 @@ if(H5DEBUG(D)) } /* end else */ } /* end for */ - /* Write the local value of actual io mode to the DXPL. */ - if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + /* Write the local value of actual io mode to the API context. */ + H5CX_set_mpio_actual_io_mode(actual_io_mode); done: if(chunk_io_option) @@ -1850,12 +1691,10 @@ done: */ static herr_t H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) + H5D_chunk_map_t *fm) { H5D_filtered_collective_io_info_t *chunk_list = NULL; /* The list of chunks being read/written */ H5D_filtered_collective_io_info_t *collective_chunk_list = NULL; /* The list of chunks used during collective operations */ - H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; /* The actual chunk IO optimization mode */ - H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; /* The chunk IO mode used (Independent vs Collective) */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ @@ -1875,7 +1714,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HDassert(io_info); HDassert(type_info); HDassert(fm); - HDassert(dx_plist); /* Obtain the current rank of the process and the number of processes */ if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) @@ -1884,14 +1722,12 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") /* Set the actual chunk opt mode property */ - if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_MULTI_CHUNK); /* Set the actual_io_mode property. * Multi chunk I/O does not break to independent, so can set right away */ - if (H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk io mode property") + H5CX_set_mpio_actual_io_mode(H5D_MPIO_CHUNK_COLLECTIVE); /* Build a list of selected chunks in the collective IO operation */ if (H5D__construct_filtered_io_info_list(io_info, type_info, fm, &chunk_list, &chunk_list_num_entries) < 0) @@ -1922,7 +1758,6 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i /* Construct chunked index info */ index_info.f = io_info->dset->oloc.file; - index_info.dxpl_id = io_info->md_dxpl_id; index_info.pline = &(io_info->dset->shared->dcpl_cache.pline); index_info.layout = &(io_info->dset->shared->layout.u.chunk); index_info.storage = &(io_info->dset->shared->layout.storage.u.chunk); @@ -2039,7 +1874,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, const H5D_type_i } /* end else */ /* Perform the I/O */ - if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, &file_type_array[i], &mem_type_array[i]) < 0) + if (H5D__final_collective_io(&ctg_io_info, type_info, mpi_buf_count, file_type_array[i], mem_type_array[i]) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") /* Participate in the collective re-insertion of all chunks modified @@ -2189,7 +2024,7 @@ if(H5DEBUG(D)) #endif /* Perform final collective I/O operation */ - if(H5D__final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, &mpi_file_type, &mpi_buf_type) < 0) + if(H5D__final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, mpi_file_type, mpi_buf_type) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish collective MPI-IO") done: @@ -2222,15 +2057,15 @@ if(H5DEBUG(D)) */ static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) + hsize_t mpi_buf_count, MPI_Datatype mpi_file_type, MPI_Datatype mpi_buf_type) { herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC /* Pass buf type, file type to the file driver. */ - if(H5FD_mpi_setup_collective(io_info->raw_dxpl_id, mpi_buf_type, mpi_file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") + if(H5CX_set_mpi_coll_datatypes(mpi_buf_type, mpi_file_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set MPI-I/O collective I/O datatypes") if(io_info->op_type == H5D_IO_OP_WRITE) { if((io_info->io_ops.single_write)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0) @@ -2444,7 +2279,7 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* User data for querying chunk info */ /* Get address of chunk */ - if(H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") chunk_addr = udata.chunk_block.offset; } /* end if */ @@ -2520,7 +2355,7 @@ done: */ static herr_t H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, - H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]) + uint8_t assign_io_mode[], haddr_t chunk_addr[]) { size_t total_chunks; unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk; @@ -2535,10 +2370,6 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, int root; size_t ic; int mpi_code; -#ifdef H5_HAVE_INSTRUMENTED_LIBRARY - int new_value; - htri_t check_prop; -#endif herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -2555,8 +2386,8 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, /* Setup parameters */ H5_CHECKED_ASSIGN(total_chunks, size_t, fm->layout->u.chunk.nchunks, hsize_t); - if(H5P_get(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, &percent_nproc_per_chunk) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't get percent nproc per chunk") + if(H5CX_get_mpio_chunk_opt_ratio(&percent_nproc_per_chunk) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "couldn't get percent nproc per chunk") /* if ratio is 0, perform collective io */ if(0 == percent_nproc_per_chunk) { if(H5D__chunk_addrmap(io_info, chunk_addr) < 0) @@ -2646,40 +2477,19 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #ifdef H5_HAVE_INSTRUMENTED_LIBRARY { - H5P_genplist_t *plist; /* Property list pointer */ - - /* Get the dataset transfer property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(io_info->raw_dxpl_id))) - HGOTO_ERROR(H5E_IO, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); - if(check_prop > 0) { - for(ic = 0; ic < total_chunks; ic++) { - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") - break; - } /* end if */ - } /* end for */ - } /* end if */ - - check_prop = H5P_exist_plist(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); - if(check_prop > 0) { - int temp_count = 0; + hbool_t coll_op = FALSE; - for(ic = 0; ic < total_chunks; ic++) { - if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { - temp_count++; - break; - } /* end if */ - } /* end for */ - if(temp_count == 0) { - new_value = 0; - if(H5P_set(plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") + for(ic = 0; ic < total_chunks; ic++) + if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { + if(H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") + coll_op = TRUE; + break; } /* end if */ - } /* end if */ + + if(!coll_op) + if(H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(0) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to set property value") } #endif @@ -2732,7 +2542,6 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ HDassert(fm); HDassert(chunk_list); HDassert(num_entries); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); if ((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") @@ -2745,15 +2554,15 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ hssize_t select_npoints; hssize_t chunk_npoints; - if (NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t)))) + if(NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate local io info array buffer") chunk_node = H5SL_first(fm->sel_chunks); - for (i = 0; chunk_node; i++) { + for(i = 0; chunk_node; i++) { chunk_info = (H5D_chunk_info_t *) H5SL_item(chunk_node); /* Obtain this chunk's address */ - if (H5D__chunk_lookup(io_info->dset, io_info->md_dxpl_id, chunk_info->scaled, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, chunk_info->scaled, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") local_info_array[i].index = chunk_info->index; @@ -3000,8 +2809,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty mem_iter_init = TRUE; /* Collect the modification data into the buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, mod_data_p)) + if(!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, mod_data_p)) HGOTO_ERROR(H5E_IO, H5E_CANTGATHER, FAIL, "couldn't gather from write buffer") /* Send modification data to new owner */ @@ -3212,6 +3020,8 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk H5D_chunk_info_t *chunk_info = NULL; H5S_sel_iter_t *mem_iter = NULL; /* Memory iterator for H5D__scatter_mem/H5D__gather_mem */ unsigned char *mod_data = NULL; /* Chunk modification data sent by a process to a chunk's owner */ + H5Z_EDC_t err_detect; /* Error detection info */ + H5Z_cb_t filter_cb; /* I/O filter callback function */ unsigned filter_mask = 0; hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ hssize_t extent_npoints; @@ -3232,6 +3042,12 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HDassert(type_info); HDassert(fm); + /* Retrieve filter settings from API context */ + if(H5CX_get_err_detect(&err_detect) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get error detection info") + if(H5CX_get_filter_cb(&filter_cb) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O filter callback function") + /* Look up the chunk and get its file and memory dataspaces */ if (NULL == (chunk_info = (H5D_chunk_info_t *) H5SL_search(fm->sel_chunks, &chunk_entry->index))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, FAIL, "can't locate chunk in skip list") @@ -3253,19 +3069,19 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* If this is not a full chunk overwrite or this is a read operation, the chunk must be * read from the file and unfiltered. */ - if (!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { + if(!chunk_entry->full_overwrite || io_info->op_type == H5D_IO_OP_READ) { chunk_entry->chunk_states.new_chunk.length = chunk_entry->chunk_states.chunk_current.length; /* Currently, these chunk reads are done independently and will likely * cause issues with collective metadata reads enabled. In the future, * this should be refactored to use collective chunk reads - JTH */ - if (H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, - chunk_entry->chunk_states.new_chunk.length, H5AC_rawdata_dxpl_id, chunk_entry->buf) < 0) + if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, chunk_entry->chunk_states.chunk_current.offset, + chunk_entry->chunk_states.new_chunk.length, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_entry->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) + if(H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, H5Z_FLAG_REVERSE, + &filter_mask, err_detect, filter_cb, (size_t *)&chunk_entry->chunk_states.new_chunk.length, + &buf_size, &chunk_entry->buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "couldn't unfilter chunk for modifying") } /* end if */ else { @@ -3291,8 +3107,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk */ switch (io_info->op_type) { case H5D_IO_OP_READ: - if (H5D__scatter_mem(chunk_entry->buf, chunk_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, io_info->u.rbuf) < 0) + if (H5D__scatter_mem(chunk_entry->buf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer") break; @@ -3301,8 +3116,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer") /* Gather modification data from the application write buffer into a temporary buffer */ - if (!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, tmp_gath_buf)) + if(!H5D__gather_mem(io_info->u.wbuf, chunk_info->mspace, mem_iter, (size_t)iter_nelmts, tmp_gath_buf)) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't gather from write buffer") if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -3320,8 +3134,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk /* Scatter the owner's modification data into the chunk data buffer according to * the file space. */ - if (H5D__scatter_mem(tmp_gath_buf, chunk_info->fspace, mem_iter, - (size_t) iter_nelmts, io_info->dxpl_cache, chunk_entry->buf) < 0) + if(H5D__scatter_mem(tmp_gath_buf, chunk_info->fspace, mem_iter, (size_t)iter_nelmts, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to chunk data buffer") if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -3351,8 +3164,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") /* Update the chunk data with the received modification data */ - if (H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, - io_info->dxpl_cache, chunk_entry->buf) < 0) + if(H5D__scatter_mem(mod_data_p, dataspace, mem_iter, (size_t) iter_nelmts, chunk_entry->buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "couldn't scatter to write buffer") if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) @@ -3367,18 +3179,18 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk } /* end for */ /* Filter the chunk */ - if (H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, - io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, - (size_t *) &chunk_entry->chunk_states.new_chunk.length, &buf_size, &chunk_entry->buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + if(H5Z_pipeline(&io_info->dset->shared->dcpl_cache.pline, 0, &filter_mask, + err_detect, filter_cb, (size_t *)&chunk_entry->chunk_states.new_chunk.length, + &buf_size, &chunk_entry->buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, FAIL, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ if (chunk_entry->chunk_states.new_chunk.length > ((size_t) 0xffffffff)) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "chunk too large for 32-bit length") #endif - break; + default: HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "invalid I/O operation") } /* end switch */ diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 97ec5d6..be421b6 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -145,7 +145,7 @@ H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info) nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; /* Allocate space for max dataset chunks */ - addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, nbytes); + addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, nbytes); if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed") @@ -355,7 +355,7 @@ H5D__none_idx_delete(const H5D_chk_idx_info_t *idx_info) /* chunk size * max # of chunks */ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, idx_info->storage->idx_addr, nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -401,14 +401,14 @@ H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->storage); /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Allocate dataset chunks in the dest. file */ if(H5D__none_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Doh.c b/src/H5Doh.c index 9abbdff..f8ce69f 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -23,6 +23,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ @@ -45,15 +46,13 @@ /********************/ static void *H5O__dset_get_copy_file_udata(void); static void H5O__dset_free_copy_file_udata(void *); -static htri_t H5O__dset_isa(H5O_t *loc); -static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); +static htri_t H5O__dset_isa(const H5O_t *loc); +static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); static H5O_loc_t *H5O__dset_get_oloc(hid_t obj_id); -static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, +static herr_t H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); -static herr_t H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id); +static herr_t H5O__dset_flush(void *_obj_ptr); /*********************/ @@ -148,7 +147,7 @@ H5O__dset_free_copy_file_udata(void *_udata) /* Release copy of dataset's datatype, if it was set */ if(udata->src_dtype) - H5T_close(udata->src_dtype); + H5T_close_real(udata->src_dtype); /* Release copy of dataset's filter pipeline, if it was set */ if(udata->common.src_pline) @@ -179,7 +178,7 @@ H5O__dset_free_copy_file_udata(void *_udata) *------------------------------------------------------------------------- */ static htri_t -H5O__dset_isa(H5O_t *oh) +H5O__dset_isa(const H5O_t *oh) { htri_t exists; /* Flag if header message of interest exists */ htri_t ret_value = TRUE; /* Return value */ @@ -219,10 +218,9 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__dset_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5D_t *dset = NULL; /* Dataset opened */ - htri_t isdapl; /* lapl_id is a dapl */ hid_t dapl_id; /* dapl to use to open this dataset */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -230,30 +228,41 @@ H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t a HDassert(obj_loc); - /* If the lapl passed in is a dapl, use it. Otherwise, use the default dapl */ - if(lapl_id == H5P_DEFAULT) - isdapl = FALSE; - else - if((isdapl = H5P_isa_class(lapl_id, H5P_DATASET_ACCESS)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOMPARE, FAIL, "unable to compare property list classes") - - if(isdapl) - dapl_id = lapl_id; - else + /* Get the LAPL (which is a superclass of DAPLs) from the API context, but + * if it's the default link access property list or a custom link access + * property list but not a dataset access property list, use the default + * dataset access property list instead. (Since LAPLs don't have the + * additional properties that DAPLs have) + */ + dapl_id = H5CX_get_lapl(); + if(dapl_id == H5P_LINK_ACCESS_DEFAULT) dapl_id = H5P_DATASET_ACCESS_DEFAULT; + else { + htri_t is_lapl, is_dapl; /* Class of LAPL from API context */ + + /* Check class of LAPL from API context */ + if((is_lapl = H5P_isa_class(dapl_id, H5P_LINK_ACCESS)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get LAPL status") + if((is_dapl = H5P_isa_class(dapl_id, H5P_DATASET_ACCESS)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, H5I_INVALID_HID, "unable to get DAPL status") + + /* Switch to default DAPL if not an actual DAPL in the API context */ + if(!is_dapl && is_lapl) + dapl_id = H5P_DATASET_ACCESS_DEFAULT; + } /* end else */ /* Open the dataset */ - if(NULL == (dset = H5D_open(obj_loc, dapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") + if(NULL == (dset = H5D_open(obj_loc, dapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open dataset") /* Register an ID for the dataset */ if((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataset") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataset") done: if(ret_value < 0) if(dset && H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release dataset") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__dset_open() */ @@ -273,7 +282,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5D_obj_create_t *crt_info = (H5D_obj_create_t *)_crt_info; /* Dataset creation parameters */ H5D_t *dset = NULL; /* New dataset created */ @@ -287,7 +296,7 @@ H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the dataset */ - if(NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") /* Set up the new dataset's location */ @@ -357,7 +366,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) { H5O_layout_t layout; /* Data storage layout message */ H5O_efl_t efl; /* External File List message */ @@ -376,14 +385,14 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * HDassert(bh_info); /* Get the layout message from the object header */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_LAYOUT_ID, &layout)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") layout_read = TRUE; /* Check for chunked dataset storage */ if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { /* Get size of chunk index */ - if(H5D__chunk_bh_info(loc, dxpl_id, oh, &layout, &(bh_info->index_size)) < 0) + if(H5D__chunk_bh_info(loc, oh, &layout, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info") } /* end if */ else if(layout.type == H5D_VIRTUAL @@ -391,7 +400,7 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * size_t virtual_heap_size; /* Get size of global heap object for virtual dataset */ - if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) + if(H5HG_get_obj_size(loc->file, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get global heap size for virtual dataset mapping") /* Return heap size */ @@ -407,12 +416,12 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * HDmemset(&efl, 0, sizeof(efl)); /* Get External File List message from the object header */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_EFL_ID, &efl)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message") efl_read = TRUE; /* Get size of local heap for EFL message's file list */ - if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0) + if(H5D__efl_bh_info(loc->file, &efl, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info") } /* end if */ @@ -441,7 +450,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id) +H5O__dset_flush(void *_obj_ptr) { H5D_t *dset = (H5D_t *)_obj_ptr; /* Pointer to dataset object */ H5O_type_t obj_type; /* Type of object at location */ @@ -453,12 +462,12 @@ H5O__dset_flush(void *_obj_ptr, hid_t dxpl_id) HDassert(&dset->oloc); /* Check that the object found is the correct type */ - if(H5O_obj_type(&dset->oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&dset->oloc, &obj_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") - if(H5D__flush_real(dset, dxpl_id) < 0) + if(H5D__flush_real(dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") done: diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 542abd0..ce0cdcc 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -30,12 +30,12 @@ #include "H5Dprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5B2private.h" /* v2 B-trees */ -#include "H5Fprivate.h" /* File access */ -#include "H5Gprivate.h" /* Groups */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5B2private.h" /* v2 B-trees */ +#include "H5Fprivate.h" /* File access */ +#include "H5Gprivate.h" /* Groups */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ /**************************/ /* Package Private Macros */ @@ -45,19 +45,13 @@ #define H5D_MINHDR_SIZE 256 /* [Simple] Macro to construct a H5D_io_info_t from it's components */ -#define H5D_BUILD_IO_INFO_WRT(io_info, ds, dxpl_c, dxpl_m, dxpl_r, str, buf) \ +#define H5D_BUILD_IO_INFO_WRT(io_info, ds, str, buf) \ (io_info)->dset = ds; \ - (io_info)->dxpl_cache = dxpl_c; \ - (io_info)->raw_dxpl_id = dxpl_r; \ - (io_info)->md_dxpl_id = dxpl_m; \ (io_info)->store = str; \ (io_info)->op_type = H5D_IO_OP_WRITE; \ (io_info)->u.wbuf = buf -#define H5D_BUILD_IO_INFO_RD(io_info, ds, dxpl_c, dxpl_m, dxpl_r, str, buf) \ +#define H5D_BUILD_IO_INFO_RD(io_info, ds, str, buf) \ (io_info)->dset = ds; \ - (io_info)->dxpl_cache = dxpl_c; \ - (io_info)->raw_dxpl_id = dxpl_r; \ - (io_info)->md_dxpl_id = dxpl_m; \ (io_info)->store = str; \ (io_info)->op_type = H5D_IO_OP_READ; \ (io_info)->u.rbuf = buf @@ -122,7 +116,7 @@ struct H5D_chunk_map_t; /* Function pointers for I/O on particular types of dataset layouts */ typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset); -typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, +typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, const H5D_t *dset, hid_t dapl_id); typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage); typedef herr_t (*H5D_layout_io_init_func_t)(const struct H5D_io_info_t *io_info, @@ -141,9 +135,9 @@ typedef ssize_t (*H5D_layout_readvv_func_t)(const struct H5D_io_info_t *io_info, typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -typedef herr_t (*H5D_layout_flush_func_t)(H5D_t *dataset, hid_t dxpl_id); +typedef herr_t (*H5D_layout_flush_func_t)(H5D_t *dataset); typedef herr_t (*H5D_layout_io_term_func_t)(const struct H5D_chunk_map_t *cm); -typedef herr_t (*H5D_layout_dest_func_t)(H5D_t *dataset, hid_t dxpl_id); +typedef herr_t (*H5D_layout_dest_func_t)(H5D_t *dataset); /* Typedef for grouping layout I/O routines */ typedef struct H5D_layout_ops_t { @@ -210,20 +204,9 @@ typedef enum H5D_io_op_type_t { typedef struct H5D_io_info_t { const H5D_t *dset; /* Pointer to dataset being operated on */ -#ifndef H5_HAVE_PARALLEL - const -#endif /* H5_HAVE_PARALLEL */ - H5D_dxpl_cache_t *dxpl_cache; /* Pointer to cached DXPL info */ - hid_t raw_dxpl_id; /* Original DXPL ID */ - hid_t md_dxpl_id; /* metadata dxpl needed for parallel HDF5 */ #ifdef H5_HAVE_PARALLEL MPI_Comm comm; /* MPI communicator for file */ hbool_t using_mpi_vfd; /* Whether the file is using an MPI-based VFD */ - struct { - H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ - H5D_io_ops_t io_ops; /* I/O operation function pointers */ - } orig; #endif /* H5_HAVE_PARALLEL */ H5D_storage_t *store; /* Dataset storage info */ H5D_layout_ops_t layout_ops; /* Dataset layout I/O operation function pointers */ @@ -243,7 +226,6 @@ typedef struct H5D_io_info_t { /* Typedef for chunked dataset index operation info */ typedef struct H5D_chk_idx_info_t { H5F_t *f; /* File pointer for operation */ - hid_t dxpl_id; /* DXPL ID for operation */ const H5O_pline_t *pline; /* I/O pipeline info */ H5O_layout_chunk_t *layout; /* Chunk layout description */ H5O_storage_chunk_t *storage; /* Chunk storage description */ @@ -313,7 +295,7 @@ typedef herr_t (*H5D_chunk_delete_func_t)(const H5D_chk_idx_info_t *idx_info); typedef herr_t (*H5D_chunk_copy_setup_func_t)(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); typedef herr_t (*H5D_chunk_copy_shutdown_func_t)(H5O_storage_chunk_t *storage_src, - H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); + H5O_storage_chunk_t *storage_dst); typedef herr_t (*H5D_chunk_size_func_t)(const H5D_chk_idx_info_t *idx_info, hsize_t *idx_size); typedef herr_t (*H5D_chunk_reset_func_t)(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -532,7 +514,6 @@ typedef struct { H5S_t *mspace; /* Memory dataspace for operation */ void *fl_tbuf; /* Ptr to the temporary buffer we are using for fixed-length data */ void *vl_tbuf; /* Ptr to the temporary buffer we are using for VL data */ - hid_t xfer_pid; /* ID of the dataset xfer property list */ hsize_t size; /* Accumulated number of bytes for the selection */ } H5D_vlen_bufsize_t; @@ -540,7 +521,6 @@ typedef struct { /*****************************/ /* Package Private Variables */ /*****************************/ -extern H5D_dxpl_cache_t H5D_def_dxpl_cache; /* Storage layout class I/O operations */ H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_CONTIG[1]; @@ -567,45 +547,44 @@ H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1]; /******************************/ H5_DLL H5D_t *H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, - hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); + hid_t dcpl_id, hid_t dapl_id); H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, - hid_t dapl_id, hid_t dxpl_id); -H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, - hid_t dapl_id, hid_t dxpl_id); -H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, - hid_t dxpl_id); + hid_t dapl_id); +H5_DLL H5D_t *H5D__create_anon(H5F_t *file, hid_t type_id, const H5S_t *space, + hid_t dcpl_id, hid_t dapl_id); +H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id); +H5_DLL hid_t H5D__get_space(const H5D_t *dset); +H5_DLL hid_t H5D__get_type(const H5D_t *dset); +H5_DLL herr_t H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation); H5_DLL herr_t H5D__alloc_storage(const H5D_io_info_t *io_info, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); -H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); -H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, hid_t dxpl_id, const hsize_t *offset, hsize_t *storage_size); +H5_DLL herr_t H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size); +H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, + hsize_t *storage_size); H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); H5_DLL herr_t H5D__check_filters(H5D_t *dataset); -H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); -H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); -H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset, hid_t dxpl_id); -#ifdef H5_DEBUG_BUILD -H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); -#endif /* H5_DEBUG_BUILD */ +H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size); +H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset); +H5_DLL herr_t H5D__flush_real(H5D_t *dataset); +H5_DLL herr_t H5D__flush(H5D_t *dset, hid_t dset_id); +H5_DLL hid_t H5D__get_create_plist(const H5D_t *dset); +H5_DLL herr_t H5D__mark(const H5D_t *dataset, unsigned flags); +H5_DLL herr_t H5D__refresh(hid_t dset_id, H5D_t *dataset); /* To convert a dataset's chunk indexing type to v1 B-tree */ -H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D__format_convert(H5D_t *dataset); /* Internal I/O routines */ H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); + const H5S_t *mem_space, const H5S_t *file_space, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, - void *buf/*out*/); + const H5S_t *mem_space, const H5S_t *file_space, void *buf/*out*/); H5_DLL herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, - const void *buf); + const H5S_t *mem_space, const H5S_t *file_space, const void *buf); /* Functions that perform direct serial I/O operations */ H5_DLL herr_t H5D__select_read(const H5D_io_info_t *io_info, @@ -616,12 +595,10 @@ H5_DLL herr_t H5D__select_write(const H5D_io_info_t *io_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Functions that perform scatter-gather serial I/O operations */ -H5_DLL herr_t H5D__scatter_mem(const void *_tscat_buf, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - const H5D_dxpl_cache_t *dxpl_cache, void *_buf); -H5_DLL size_t H5D__gather_mem(const void *_buf, - const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, - const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); +H5_DLL herr_t H5D__scatter_mem(const void *_tscat_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, void *_buf); +H5_DLL size_t H5D__gather_mem(const void *_buf, const H5S_t *space, + H5S_sel_iter_t *iter, size_t nelmts, void *_tgath_buf/*out*/); H5_DLL herr_t H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); @@ -637,16 +614,14 @@ H5_DLL herr_t H5D__layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache); H5_DLL herr_t H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache); -H5_DLL herr_t H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, - H5D_t *dset, hid_t dapl_id); -H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id, +H5_DLL herr_t H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, + hid_t dapl_id); +H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dapl_id, H5P_genplist_t *plist); -H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, - unsigned update_flags); +H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, H5O_t *oh, unsigned update_flags); /* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, - H5O_storage_contig_t *storage); +H5_DLL herr_t H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage); H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D__contig_fill(const H5D_io_info_t *io_info); H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -657,43 +632,39 @@ H5_DLL herr_t H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *t H5D_chunk_map_t *fm); H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, - H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, - const H5O_storage_t *store); + H5O_copy_t *cpy_info); +H5_DLL herr_t H5D__contig_delete(H5F_t *f, const H5O_storage_t *store); /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); -H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, - const hsize_t *scaled, H5D_chunk_ud_t *udata); -H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); +H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, + H5D_chunk_ud_t *udata); +H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes); H5_DLL herr_t H5D__chunk_allocate(const H5D_io_info_t *io_info, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, hsize_t scaled[]); -H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, - hsize_t old_dim[]); -H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, - const hsize_t *old_dim); +H5_DLL herr_t H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim); H5_DLL herr_t H5D__chunk_set_sizes(H5D_t *dset); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ -H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset); H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, - const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, + const H5O_pline_t *pline_src, H5O_copy_t *cpy_info); +H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *btree_size); -H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); -H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_storage_t *store); -H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, +H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, FILE *stream); +H5_DLL herr_t H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *store); +H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t data_size, const void *buf); -H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hid_t dxpl_id, hsize_t *offset, +H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); @@ -703,39 +674,38 @@ H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); H5_DLL herr_t H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx_info_t *new_idx_info); /* Functions that operate on compact dataset storage */ -H5_DLL herr_t H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__compact_fill(const H5D_t *dset); H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, - H5O_copy_t *cpy_info, hid_t dxpl_id); + H5O_copy_t *cpy_info); /* Functions that operate on virtual dataset storage */ +H5_DLL herr_t H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout); H5_DLL herr_t H5D__virtual_copy_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__virtual_set_extent_unlim(const H5D_t *dset); H5_DLL herr_t H5D__virtual_reset_layout(H5O_layout_t *layout); -H5_DLL herr_t H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst, - hid_t dxpl_id); -H5_DLL herr_t H5D__virtual_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, - hid_t dapl_id); +H5_DLL herr_t H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage); +H5_DLL herr_t H5D__virtual_copy(H5F_t *f_src, H5O_layout_t *layout_dst); +H5_DLL herr_t H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); H5_DLL hbool_t H5D__virtual_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t **head); -H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__virtual_hold_source_dset_files(const H5D_t *dset, + H5D_virtual_held_file_t **head); +H5_DLL herr_t H5D__virtual_refresh_source_dsets(H5D_t *dset); H5_DLL herr_t H5D__virtual_release_source_dset_files(H5D_virtual_held_file_t *head); /* Functions that operate on EFL (External File List)*/ H5_DLL hbool_t H5D__efl_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, - hsize_t *heap_size); +H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size); /* Functions that perform fill value operations on datasets */ H5_DLL herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, - const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id); + const H5T_t *buf_type, const H5S_t *space); H5_DLL herr_t H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, - size_t nelmts, size_t min_buf_size, hid_t dxpl_id); -H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id); + size_t nelmts, size_t min_buf_size); +H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts); H5_DLL herr_t H5D__fill_term(H5D_fill_buf_info_t *fb_info); #ifdef H5_HAVE_PARALLEL @@ -775,7 +745,7 @@ H5_DLL herr_t H5D__chunk_collective_write(H5D_io_info_t *io_info, * memory and the file */ H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, const H5S_t *mem_space, - const H5D_type_info_t *type_info, H5P_genplist_t *dx_plist); + const H5D_type_info_t *type_info); #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index fb994d8..0b37690 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -119,23 +119,6 @@ /* Typedef for dataset in memory (defined in H5Dpkg.h) */ typedef struct H5D_t H5D_t; -/* Typedef for cached dataset transfer property list information */ -typedef struct H5D_dxpl_cache_t { - size_t max_temp_buf; /* Maximum temporary buffer size (H5D_XFER_MAX_TEMP_BUF_NAME) */ - void *tconv_buf; /* Temporary conversion buffer (H5D_XFER_TCONV_BUF_NAME) */ - void *bkgr_buf; /* Background conversion buffer (H5D_XFER_BKGR_BUF_NAME) */ - H5T_bkg_t bkgr_buf_type; /* Background buffer type (H5D_XFER_BKGR_BUF_NAME) */ - H5Z_EDC_t err_detect; /* Error detection info (H5D_XFER_EDC_NAME) */ - double btree_split_ratio[3];/* B-tree split ratios (H5D_XFER_BTREE_SPLIT_RATIO_NAME) */ - size_t vec_size; /* Size of hyperslab vector (H5D_XFER_HYPER_VECTOR_SIZE_NAME) */ -#ifdef H5_HAVE_PARALLEL - H5FD_mpio_xfer_t xfer_mode; /* Parallel transfer for this request (H5D_XFER_IO_XFER_MODE_NAME) */ - H5FD_mpio_collective_opt_t coll_opt_mode; /* Parallel transfer with independent IO or collective IO with this mode */ -#endif /*H5_HAVE_PARALLEL*/ - H5Z_cb_t filter_cb; /* Filter callback function (H5D_XFER_FILTER_CB_NAME) */ - H5Z_data_xform_t *data_xform_prop; /* Data transform prop (H5D_XFER_XFORM_NAME) */ -} H5D_dxpl_cache_t; - /* Typedef for cached dataset creation property list information */ typedef struct H5D_dcpl_cache_t { H5O_fill_t fill; /* Fill value info (H5D_CRT_FILL_VALUE_NAME) */ @@ -169,22 +152,19 @@ typedef struct H5D_append_flush_t { /******************************/ H5_DLL herr_t H5D_init(void); -H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id); +H5_DLL H5D_t *H5D_open(const H5G_loc_t *loc, hid_t dapl_id); H5_DLL herr_t H5D_close(H5D_t *dataset); -H5_DLL herr_t H5D_mult_refresh_close(hid_t dset_id, hid_t dxpl_id); -H5_DLL herr_t H5D_mult_refresh_reopen(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D_mult_refresh_close(hid_t dset_id); +H5_DLL herr_t H5D_mult_refresh_reopen(H5D_t *dataset); H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset); H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); -H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5D_flush_all(const H5F_t *f); H5_DLL hid_t H5D_get_create_plist(H5D_t *dset); H5_DLL hid_t H5D_get_access_plist(H5D_t *dset); -H5_DLL hid_t H5D_get_space(H5D_t *dset); -H5_DLL hid_t H5D_get_type(H5D_t *dset); /* Functions that operate on vlen data */ -H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, - void *buf); +H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, void *buf); /* Functions that operate on chunked storage */ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); @@ -202,7 +182,7 @@ H5_DLL herr_t H5D_virtual_parse_source_name(const char *source_name, H5_DLL herr_t H5D_virtual_free_parsed_name(H5O_storage_virtual_name_seg_t *name_seg); /* Functions that operate on indexed storage */ -H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, +H5_DLL herr_t H5D_btree_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims, const uint32_t *dim); #endif /* _H5Dprivate_H */ diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index baa844a..790674a 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -35,13 +35,13 @@ /* Bit flags for the H5Pset_chunk_opts() and H5Pget_chunk_opts() */ #define H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS (0x0002u) -/* Property names for H5LTDdirect_chunk_write */ +/* Property names for H5DOwrite_chunk */ #define H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME "direct_chunk_flag" #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME "direct_chunk_filters" #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME "direct_chunk_offset" #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME "direct_chunk_datasize" -/* Property names for H5LTDdirect_chunk_read */ +/* Property names for H5DOread_chunk */ #define H5D_XFER_DIRECT_CHUNK_READ_FLAG_NAME "direct_chunk_read_flag" #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_NAME "direct_chunk_read_offset" #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_NAME "direct_chunk_read_filters" diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 0ae69ee..f636eb7 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -22,6 +22,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -48,8 +49,7 @@ static size_t H5D__gather_file(const H5D_io_info_t *io_info, const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, void *buf); static herr_t H5D__compound_opt_read(size_t nelmts, const H5S_t *mem_space, - H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, - const H5D_type_info_t *type_info, void *user_buf/*out*/); + H5S_sel_iter_t *iter, const H5D_type_info_t *type_info, void *user_buf/*out*/); static herr_t H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); @@ -103,6 +103,7 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, size_t orig_mem_len, mem_len; /* Length of sequence in memory */ size_t nseq; /* Number of sequences generated */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Return value */ @@ -120,9 +121,13 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, tmp_io_info.op_type = H5D_IO_OP_WRITE; tmp_io_info.u.wbuf = _buf; + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = tmp_io_info.dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -199,6 +204,7 @@ H5D__gather_file(const H5D_io_info_t *_io_info, size_t orig_mem_len, mem_len; /* Length of sequence in memory */ size_t nseq; /* Number of sequences generated */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ size_t ret_value = nelmts; /* Return value */ @@ -218,9 +224,13 @@ H5D__gather_file(const H5D_io_info_t *_io_info, tmp_io_info.op_type = H5D_IO_OP_READ; tmp_io_info.u.rbuf = _buf; + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(tmp_io_info.dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = tmp_io_info.dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -279,8 +289,7 @@ done: */ herr_t H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, - H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, - void *_buf/*out*/) + H5S_sel_iter_t *iter, size_t nelmts, void *_buf/*out*/) { uint8_t *buf = (uint8_t *)_buf; /* Get local copies for address arithmetic */ const uint8_t *tscat_buf = (const uint8_t *)_tscat_buf; @@ -290,6 +299,7 @@ H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, size_t nseq; /* Number of sequences generated */ size_t curr_seq; /* Current sequence being processed */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Number of elements scattered */ @@ -300,12 +310,15 @@ H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); - HDassert(dxpl_cache); HDassert(buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -364,8 +377,7 @@ done: */ size_t H5D__gather_mem(const void *_buf, const H5S_t *space, - H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, - void *_tgath_buf/*out*/) + H5S_sel_iter_t *iter, size_t nelmts, void *_tgath_buf/*out*/) { const uint8_t *buf = (const uint8_t *)_buf; /* Get local copies for address arithmetic */ uint8_t *tgath_buf = (uint8_t *)_tgath_buf; @@ -375,6 +387,7 @@ H5D__gather_mem(const void *_buf, const H5S_t *space, size_t nseq; /* Number of sequences generated */ size_t curr_seq; /* Current sequence being processed */ size_t nelem; /* Number of elements used in sequences */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ size_t ret_value = nelmts; /* Number of elements gathered */ @@ -385,12 +398,15 @@ H5D__gather_mem(const void *_buf, const H5S_t *space, HDassert(space); HDassert(iter); HDassert(nelmts > 0); - HDassert(dxpl_cache); HDassert(tgath_buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -446,7 +462,6 @@ herr_t H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { - const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ void *buf = io_info->u.rbuf; /* Local pointer to application buffer */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ @@ -516,12 +531,12 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * bypass the rest of steps. */ if(type_info->cmpd_subset && H5T_SUBSET_FALSE != type_info->cmpd_subset->subset) { - if(H5D__compound_opt_read(smine_nelmts, mem_space, mem_iter, dxpl_cache, type_info, buf /*out*/) < 0) + if(H5D__compound_opt_read(smine_nelmts, mem_space, mem_iter, type_info, buf /*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ else { if(H5T_BKG_YES == type_info->need_bkg) { - n = H5D__gather_mem(buf, mem_space, bkg_iter, smine_nelmts, dxpl_cache, type_info->bkg_buf/*out*/); + n = H5D__gather_mem(buf, mem_space, bkg_iter, smine_nelmts, type_info->bkg_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ @@ -531,18 +546,25 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf */ if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, - type_info->bkg_buf, io_info->md_dxpl_id) < 0) + type_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") /* Do the data transform after the conversion (since we're using type mem_type) */ - if(!type_info->is_xform_noop) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + if(!type_info->is_xform_noop) { + H5Z_data_xform_t *data_transform; /* Data transform info */ + + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + + if(H5Z_xform_eval(data_transform, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") + } /* end if */ /* * Scatter the data into memory. */ - if(H5D__scatter_mem(type_info->tconv_buf, mem_space, mem_iter, smine_nelmts, dxpl_cache, buf/*out*/) < 0) + if(H5D__scatter_mem(type_info->tconv_buf, mem_space, mem_iter, smine_nelmts, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end else */ } /* end for */ @@ -582,7 +604,6 @@ herr_t H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { - const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ const void *buf = io_info->u.wbuf; /* Local pointer to application buffer */ H5S_sel_iter_t *mem_iter = NULL; /* Memory selection iteration info*/ hbool_t mem_iter_init = FALSE; /* Memory selection iteration info has been initialized */ @@ -639,7 +660,7 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_in * buffer. Also gather data from the file into the background buffer * if necessary. */ - n = H5D__gather_mem(buf, mem_space, mem_iter, smine_nelmts, dxpl_cache, type_info->tconv_buf/*out*/); + n = H5D__gather_mem(buf, mem_space, mem_iter, smine_nelmts, type_info->tconv_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed") @@ -663,16 +684,23 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_in /* Do the data transform before the type conversion (since * transforms must be done in the memory type). */ - if(!type_info->is_xform_noop) - if(H5Z_xform_eval(dxpl_cache->data_xform_prop, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Error performing data transform") + if(!type_info->is_xform_noop) { + H5Z_data_xform_t *data_transform; /* Data transform info */ + + /* Retrieve info from API context */ + if(H5CX_get_data_transform(&data_transform) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") + + if(H5Z_xform_eval(data_transform, type_info->tconv_buf, smine_nelmts, type_info->mem_type) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") + } /* end if */ /* * Perform datatype conversion. */ if(H5T_convert(type_info->tpath, type_info->src_type_id, type_info->dst_type_id, smine_nelmts, (size_t)0, (size_t)0, type_info->tconv_buf, - type_info->bkg_buf, io_info->md_dxpl_id) < 0) + type_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end else */ @@ -735,8 +763,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__compound_opt_read(size_t nelmts, const H5S_t *space, - H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, +H5D__compound_opt_read(size_t nelmts, const H5S_t *space, H5S_sel_iter_t *iter, const H5D_type_info_t *type_info, void *user_buf/*out*/) { uint8_t *ubuf = (uint8_t *)user_buf; /* Cast for pointer arithmetic */ @@ -744,6 +771,7 @@ H5D__compound_opt_read(size_t nelmts, const H5S_t *space, hsize_t *off = NULL; /* Pointer to sequence offsets */ size_t *len = NULL; /* Pointer to sequence lengths */ size_t src_stride, dst_stride, copy_size; + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ herr_t ret_value = SUCCEED; /* Return value */ @@ -753,16 +781,19 @@ H5D__compound_opt_read(size_t nelmts, const H5S_t *space, HDassert(nelmts > 0); HDassert(space); HDassert(iter); - HDassert(dxpl_cache); HDassert(type_info); HDassert(type_info->cmpd_subset); HDassert(H5T_SUBSET_SRC == type_info->cmpd_subset->subset || H5T_SUBSET_DST == type_info->cmpd_subset->subset); HDassert(user_buf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (len = H5FL_SEQ_MALLOC(size_t, vec_size))) @@ -924,8 +955,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, size_t type_size; /* Datatype element size */ hssize_t nelmts; /* Number of remaining elements in selection */ size_t nelmts_scatter = 0; /* Number of elements to scatter to dst_buf */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -940,10 +970,10 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") - - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(H5AC_noio_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -982,7 +1012,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback returned more elements than in selection") /* Scatter data */ - if(H5D__scatter_mem(src_buf, dst_space, iter, nelmts_scatter, dxpl_cache, dst_buf) < 0) + if(H5D__scatter_mem(src_buf, dst_space, iter, nelmts_scatter, dst_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "scatter failed") nelmts -= (hssize_t)nelmts_scatter; @@ -994,6 +1024,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dscatter() */ @@ -1027,8 +1059,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, hssize_t nelmts; /* Number of remaining elements in selection */ size_t dst_buf_nelmts; /* Number of elements that can fit in dst_buf */ size_t nelmts_gathered; /* Number of elements gathered from src_buf */ - H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ - H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1046,10 +1077,10 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "destination buffer size is 0") if(dst_buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination buffer provided") - - /* Fill the DXPL cache values for later use */ - if(H5D__get_dxpl_cache(H5AC_noio_dxpl_id, &dxpl_cache) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get datatype element size */ if(0 == (type_size = H5T_GET_SIZE(type))) @@ -1081,7 +1112,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, /* Loop until all data has been scattered */ while(nelmts > 0) { /* Gather data */ - if(0 == (nelmts_gathered = H5D__gather_mem(src_buf, src_space, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dxpl_cache, dst_buf))) + if(0 == (nelmts_gathered = H5D__gather_mem(src_buf, src_space, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dst_buf))) HGOTO_ERROR(H5E_IO, H5E_CANTCOPY, FAIL, "gather failed") HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); @@ -1099,6 +1130,8 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") if(iter) iter = H5FL_FREE(H5S_sel_iter_t, iter); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Dgather() */ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index b4d0515..0ec3423 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -28,6 +28,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -99,6 +100,7 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, size_t curr_file_seq; /* Current file sequence to operate on */ size_t mem_nseq; /* Number of sequences generated in the file */ size_t file_nseq; /* Number of sequences generated in memory */ + size_t dxpl_vec_size; /* Vector length from API context's DXPL */ size_t vec_size; /* Vector length */ ssize_t tmp_file_len; /* Temporary number of bytes in file sequence */ herr_t ret_value = SUCCEED; /* Return value */ @@ -109,12 +111,15 @@ H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, HDassert(io_info); HDassert(io_info->dset); HDassert(io_info->store); - HDassert(TRUE == H5P_isa_class(io_info->raw_dxpl_id, H5P_DATASET_XFER)); HDassert(io_info->u.rbuf); + /* Get info from API context */ + if(H5CX_get_vec_size(&dxpl_vec_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve I/O vector size") + /* Allocate the vector I/O arrays */ - if(io_info->dxpl_cache->vec_size > H5D_IO_VECTOR_SIZE) - vec_size = io_info->dxpl_cache->vec_size; + if(dxpl_vec_size > H5D_IO_VECTOR_SIZE) + vec_size = dxpl_vec_size; else vec_size = H5D_IO_VECTOR_SIZE; if(NULL == (mem_len = H5FL_SEQ_MALLOC(size_t, vec_size))) diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index e999449..321d258 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -243,13 +243,11 @@ H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata idx_info->storage->u.single.filter_mask = udata->filter_mask; } /* end if */ - if(dset) { - if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0) { + if(dset) + if(dset->shared->dcpl_cache.fill.alloc_time != H5D_ALLOC_TIME_EARLY || idx_info->pline->nused > 0) /* Mark the layout dirty so that the address of the single chunk will be flushed later */ - if(H5D__mark(dset, idx_info->dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark layout as dirty") - } /* end if */ - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -382,7 +380,7 @@ H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t else nbytes = idx_info->layout->size; - if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, idx_info->storage->idx_addr, nbytes) < 0) + if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->storage->idx_addr, nbytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks") idx_info->storage->idx_addr = HADDR_UNDEF; @@ -461,14 +459,14 @@ H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(idx_info_dst->storage); /* Set copied metadata tag */ - H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Set up information at the destination file */ if(H5D__single_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3be2353..d62bac7 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -82,14 +82,13 @@ static herr_t H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t static herr_t H5D__virtual_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__virtual_flush(H5D_t *dset); /* Other functions */ static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, - H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id); -static herr_t H5D__virtual_reset_source_dset( - H5O_storage_virtual_ent_t *virtual_ent, + H5O_storage_virtual_srcdset_t *source_dset); +static herr_t H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, H5O_storage_virtual_srcdset_t *source_dset); static herr_t H5D__virtual_str_append(const char *src, size_t src_len, char **p, char **buf, size_t *buf_size); @@ -98,7 +97,7 @@ static herr_t H5D__virtual_copy_parsed_name( static herr_t H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name_seg_t *parsed_name, size_t static_strlen, size_t nsubs, hsize_t blockno, char **built_name); -static herr_t H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__virtual_init_all(const H5D_t *dset); static herr_t H5D__virtual_pre_io(H5D_io_info_t *io_info, H5O_storage_virtual_t *storage, const H5S_t *file_space, const H5S_t *mem_space, hsize_t *tot_nelmts); @@ -390,6 +389,140 @@ done: /*------------------------------------------------------------------------- + * Function: H5D__virtual_store_layout + * + * Purpose: Store virtual dataset layout information, for new dataset + * + * Note: We assume here that the contents of the heap block cannot + * change! If this ever stops being the case we must change + * this code to allow overwrites of the heap block. -NAF + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Sunday, Feberuary 11, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) +{ + uint8_t *heap_block = NULL; /* Block to add to heap */ + size_t *str_size = NULL; /* Array for VDS entry string lengths */ + uint8_t *heap_block_p; /* Pointer into the heap block, while encoding */ + size_t block_size; /* Total size of block needed */ + hsize_t tmp_nentries; /* Temp. variable for # of VDS entries */ + uint32_t chksum; /* Checksum for heap data */ + size_t i; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Sanity checking */ + HDassert(f); + HDassert(layout); + HDassert(layout->storage.u.virt.serial_list_hobjid.addr == HADDR_UNDEF); + + /* Create block if # of used entries > 0 */ + if(layout->storage.u.virt.list_nused > 0) { + /* Allocate array for caching results of strlen */ + if(NULL == (str_size = (size_t *)H5MM_malloc(2 * layout->storage.u.virt.list_nused * sizeof(size_t)))) + HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate string length array") + + /* + * Calculate heap block size + */ + + /* Version and number of entries */ + block_size = (size_t)1 + H5F_SIZEOF_SIZE(f); + + /* Calculate size of each entry */ + for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + hssize_t select_serial_size; /* Size of serialized selection */ + + HDassert(layout->storage.u.virt.list[i].source_file_name); + HDassert(layout->storage.u.virt.list[i].source_dset_name); + HDassert(layout->storage.u.virt.list[i].source_select); + HDassert(layout->storage.u.virt.list[i].source_dset.virtual_select); + + /* Source file name */ + str_size[2 * i] = HDstrlen(layout->storage.u.virt.list[i].source_file_name) + (size_t)1; + block_size += str_size[2 * i]; + + /* Source dset name */ + str_size[(2 * i) + 1] = HDstrlen(layout->storage.u.virt.list[i].source_dset_name) + (size_t)1; + block_size += str_size[(2 * i) + 1]; + + /* Source selection */ + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_select)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + block_size += (size_t)select_serial_size; + + /* Virtual dataset selection */ + if((select_serial_size = H5S_SELECT_SERIAL_SIZE(layout->storage.u.virt.list[i].source_dset.virtual_select)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") + block_size += (size_t)select_serial_size; + } /* end for */ + + /* Checksum */ + block_size += 4; + + + /* Allocate heap block */ + if(NULL == (heap_block = (uint8_t *)H5MM_malloc(block_size))) + HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate heap block") + + + /* + * Encode heap block + */ + heap_block_p = heap_block; + + /* Encode heap block encoding version */ + *heap_block_p++ = (uint8_t)H5O_LAYOUT_VDS_GH_ENC_VERS; + + /* Number of entries */ + tmp_nentries = (hsize_t)layout->storage.u.virt.list_nused; + H5F_ENCODE_LENGTH(f, heap_block_p, tmp_nentries) + + /* Encode each entry */ + for(i = 0; i < layout->storage.u.virt.list_nused; i++) { + /* Source file name */ + HDmemcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_file_name, str_size[2 * i]); + heap_block_p += str_size[2 * i]; + + /* Source dataset name */ + HDmemcpy((char *)heap_block_p, layout->storage.u.virt.list[i].source_dset_name, str_size[(2 * i) + 1]); + heap_block_p += str_size[(2 * i) + 1]; + + /* Source selection */ + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_select, &heap_block_p) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") + + /* Virtual selection */ + if(H5S_SELECT_SERIALIZE(layout->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") + } /* end for */ + + /* Checksum */ + chksum = H5_checksum_metadata(heap_block, block_size - (size_t)4, 0); + UINT32ENCODE(heap_block_p, chksum) + + /* Insert block into global heap */ + if(H5HG_insert(f, block_size, heap_block, &(layout->storage.u.virt.serial_list_hobjid)) < 0) /* Casting away const OK --NAF */ + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") + } /* end if */ + +done: + heap_block = (uint8_t *)H5MM_xfree(heap_block); + str_size = (size_t *)H5MM_xfree(str_size); + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D__virtual_store_layout() */ + + +/*------------------------------------------------------------------------- * Function: H5D__virtual_copy_layout * * Purpose: Deep copies virtual storage layout message in memory. @@ -650,35 +783,32 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) *------------------------------------------------------------------------- */ herr_t -H5D__virtual_copy(H5F_t H5_ATTR_UNUSED *f_dst, H5O_layout_t *layout_dst, - hid_t H5_ATTR_UNUSED dxpl_id) +H5D__virtual_copy(H5F_t *f_dst, H5O_layout_t *layout_dst) { herr_t ret_value = SUCCEED; -#ifdef NOT_YET FUNC_ENTER_PACKAGE -#endif /* NOT_YET */ - FUNC_ENTER_PACKAGE_NOERR #ifdef NOT_YET /* Check for copy to the same file */ if(f_dst == f_src) { /* Increase reference count on global heap object */ - if((heap_rc = H5HG_link(f_dst, dxpl_id, (H5HG_t *)&(layout_dst->u.virt.serial_list_hobjid), 1)) < 0) + if((heap_rc = H5HG_link(f_dst, (H5HG_t *)&(layout_dst->u.virt.serial_list_hobjid), 1)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTMODIFY, FAIL, "unable to adjust global heap refence count") } /* end if */ else #endif /* NOT_YET */ { - /* Reset global heap id so a new heap object is created when the message - * is flushed */ + /* Reset global heap id */ layout_dst->storage.u.virt.serial_list_hobjid.addr = HADDR_UNDEF; layout_dst->storage.u.virt.serial_list_hobjid.idx = (size_t)0; + + /* Write the VDS data to destination file's heap */ + if(H5D__virtual_store_layout(f_dst, layout_dst) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to store VDS info") } /* end block/else */ -#ifdef NOT_YET done: -#endif /* NOT_YET */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_copy() */ @@ -696,7 +826,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage) +H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage) { #ifdef NOT_YET int heap_rc; /* Reference count of global heap object */ @@ -714,12 +844,12 @@ H5D__virtual_delete(H5F_t *f, hid_t dxpl_id, H5O_storage_t *storage) if(storage->u.virt.serial_list_hobjid.addr != HADDR_UNDEF) { #ifdef NOT_YET /* Unlink the global heap block */ - if((heap_rc = H5HG_link(f, dxpl_id, (H5HG_t *)&(storage->u.virt.serial_list_hobjid), -1)) < 0) + if((heap_rc = H5HG_link(f, (H5HG_t *)&(storage->u.virt.serial_list_hobjid), -1)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTMODIFY, FAIL, "unable to adjust global heap refence count") if(heap_rc == 0) #endif /* NOT_YET */ /* Delete the global heap block */ - if(H5HG_remove(f, dxpl_id, (H5HG_t *)&(storage->u.virt.serial_list_hobjid)) < 0) + if(H5HG_remove(f, (H5HG_t *)&(storage->u.virt.serial_list_hobjid)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to remove heap object") } /* end if */ @@ -747,7 +877,7 @@ done: static herr_t H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *virtual_ent, - H5O_storage_virtual_srcdset_t *source_dset, hid_t dxpl_id) + H5O_storage_virtual_srcdset_t *source_dset) { H5F_t *src_file = NULL; /* Source file */ hbool_t src_file_open = FALSE; /* Whether we have opened and need to close src_file */ @@ -766,7 +896,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, /* Check if we need to open the source file */ if(HDstrcmp(source_dset->file_name, ".")) { /* Open the source file */ - if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl, dxpl_id))) + if(NULL == (src_file = H5F_open(source_dset->file_name, H5F_INTENT(vdset->oloc.file) & (H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE | H5F_ACC_SWMR_READ), H5P_FILE_CREATE_DEFAULT, vdset->shared->layout.storage.u.virt.source_fapl))) H5E_clear_stack(NULL); /* Quick hack until proper support for H5Fopen with missing file is implemented */ else src_file_open = TRUE; @@ -783,7 +913,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to get path for root group") /* Open the source dataset */ - if(NULL == (source_dset->dset = H5D__open_name(&src_root_loc, source_dset->dset_name, vdset->shared->layout.storage.u.virt.source_dapl, dxpl_id))) { + if(NULL == (source_dset->dset = H5D__open_name(&src_root_loc, source_dset->dset_name, vdset->shared->layout.storage.u.virt.source_dapl))) { H5E_clear_stack(NULL); /* Quick hack until proper support for H5Dopen with missing file is implemented */ /* Dataset does not exist */ @@ -1299,7 +1429,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) +H5D__virtual_set_extent_unlim(const H5D_t *dset) { H5O_storage_virtual_t *storage; hsize_t new_dims[H5S_MAX_RANK]; @@ -1335,7 +1465,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) /* Non-printf mapping */ /* Open source dataset */ if(!storage->list[i].source_dset.dset) - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset, dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* Check if source dataset is open */ @@ -1473,7 +1603,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) storage->list[i].sub_dset[j].clipped_virtual_select = storage->list[i].sub_dset[j].virtual_select; /* Open source dataset */ - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].sub_dset[j], dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") if(storage->list[i].sub_dset[j].dset) { @@ -1560,7 +1690,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset, hid_t dxpl_id) /* Mark the space as dirty, for later writing to the file */ if(H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR) - if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ @@ -1727,7 +1857,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id) +H5D__virtual_init_all(const H5D_t *dset) { H5O_storage_virtual_t *storage; hsize_t virtual_dims[H5S_MAX_RANK]; @@ -1757,7 +1887,7 @@ H5D__virtual_init_all(const H5D_t *dset, hid_t dxpl_id) /* Non-printf mapping */ /* Open source dataset */ if(!storage->list[i].source_dset.dset) - if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset, dxpl_id) < 0) + if(H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* Check if source dataset is open */ @@ -1949,8 +2079,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_init(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5D_t *dset, - hid_t dapl_id) +H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) { H5O_storage_virtual_t *storage; /* Convenience pointer */ H5P_genplist_t *dapl; /* Data access property list object pointer */ @@ -2100,7 +2229,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Initialize layout if necessary */ if(!storage->init) - if(H5D__virtual_init_all(io_info->dset, io_info->md_dxpl_id) < 0) + if(H5D__virtual_init_all(io_info->dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize virtual layout") /* Initialize tot_nelmts */ @@ -2158,7 +2287,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, * open the source dataset to patch it */ if(storage->list[i].source_space_status != H5O_VIRTUAL_STATUS_CORRECT) { HDassert(!storage->list[i].sub_dset[j].dset); - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j], io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") } /* end if */ @@ -2230,7 +2359,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Open source dataset */ if(!storage->list[i].sub_dset[j].dset) /* Try to open dataset */ - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j], io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* If the source dataset is not open, mark the selected @@ -2267,7 +2396,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, /* Open source dataset */ if(!storage->list[i].source_dset.dset) /* Try to open dataset */ - if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset, io_info->md_dxpl_id) < 0) + if(H5D__virtual_open_source_dset(io_info->dset, &storage->list[i], &storage->list[i].source_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") /* If the source dataset is not open, mark the selected elements @@ -2389,7 +2518,7 @@ H5D__virtual_read_one(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space") /* Perform read on source dataset */ - if(H5D__read(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->raw_dxpl_id, io_info->u.rbuf) < 0) + if(H5D__read(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read source dataset") /* Close projected_src_space */ @@ -2506,8 +2635,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "unable to clip fill selection") /* Write fill values to memory buffer */ - if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, - type_info->mem_type, fill_space, io_info->md_dxpl_id) < 0) + if(H5D__fill(io_info->dset->shared->dcpl_cache.fill.buf, io_info->dset->shared->type, io_info->u.rbuf, type_info->mem_type, fill_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "filling buf failed") #ifndef NDEBUG @@ -2581,7 +2709,7 @@ H5D__virtual_write_one(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTCLIP, FAIL, "can't project virtual intersection onto source space") /* Perform write on source dataset */ - if(H5D__write(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->raw_dxpl_id, io_info->u.wbuf) < 0) + if(H5D__write(source_dset->dset, type_info->dst_type_id, source_dset->projected_mem_space, projected_src_space, io_info->u.wbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write to source dataset") /* Close projected_src_space */ @@ -2692,7 +2820,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id) +H5D__virtual_flush(H5D_t *dset) { H5O_storage_virtual_t *storage; /* Convenient pointer into layout struct */ size_t i, j; /* Local index variables */ @@ -2713,13 +2841,13 @@ H5D__virtual_flush(H5D_t *dset, hid_t dxpl_id) for(j = 0; j < storage->list[i].sub_dset_nused; j++) if(storage->list[i].sub_dset[j].dset) /* Flush source dataset */ - if(H5D__flush_real(storage->list[i].sub_dset[j].dset, dxpl_id) < 0) + if(H5D__flush_real(storage->list[i].sub_dset[j].dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush source dataset") } /* end if */ else if(storage->list[i].source_dset.dset) /* Flush source dataset */ - if(H5D__flush_real(storage->list[i].source_dset.dset, dxpl_id) < 0) + if(H5D__flush_real(storage->list[i].source_dset.dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to flush source dataset") done: @@ -2794,12 +2922,10 @@ H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t * } /* end if */ done: - if(ret_value < 0) { + if(ret_value < 0) /* Release hold on files and delete list on error */ - if(*head) - if(H5D__virtual_release_source_dset_files(*head) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release source datasets' files held open") - } /* end if */ + if(*head && H5D__virtual_release_source_dset_files(*head) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't release source datasets' files held open") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__virtual_hold_source_dset_files() */ @@ -2818,7 +2944,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__virtual_refresh_source_dset(H5D_t **dset, hid_t dxpl_id) +H5D__virtual_refresh_source_dset(H5D_t **dset) { hid_t dset_id; /* Temporary dataset identifier */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2833,7 +2959,7 @@ H5D__virtual_refresh_source_dset(H5D_t **dset, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register source dataset ID") /* Refresh source dataset */ - if(H5D__refresh(dset_id, *dset, dxpl_id) < 0) + if(H5D__refresh(dset_id, *dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") /* Discard the identifier & replace the dataset */ @@ -2858,7 +2984,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id) +H5D__virtual_refresh_source_dsets(H5D_t *dset) { H5O_storage_virtual_t *storage; /* Convenient pointer into layout struct */ size_t i; /* Local index variable */ @@ -2883,14 +3009,14 @@ H5D__virtual_refresh_source_dsets(H5D_t *dset, hid_t dxpl_id) /* Check if sub-source dataset is open */ if(storage->list[i].sub_dset[j].dset) /* Refresh sub-source dataset */ - if(H5D__virtual_refresh_source_dset(&storage->list[i].sub_dset[j].dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dset(&storage->list[i].sub_dset[j].dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") } /* end if */ else /* Check if source dataset is open */ if(storage->list[i].source_dset.dset) /* Refresh source dataset */ - if(H5D__virtual_refresh_source_dset(&storage->list[i].source_dset.dset, dxpl_id) < 0) + if(H5D__virtual_refresh_source_dset(&storage->list[i].source_dset.dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to refresh source dataset") done: diff --git a/src/H5EA.c b/src/H5EA.c index c524d49..9ceb144 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -59,8 +59,7 @@ /******************/ /* Typedef for generically unprotecting an object */ -typedef herr_t (*H5EA__unprotect_func_t)(void *thing, hid_t dxpl_id, - unsigned cache_flags); +typedef herr_t (*H5EA__unprotect_func_t)(void *thing, unsigned cache_flags); /********************/ @@ -73,11 +72,11 @@ typedef herr_t (*H5EA__unprotect_func_t)(void *thing, hid_t dxpl_id, /********************/ static herr_t -H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_extend, +H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func); -static H5EA_t *H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, - hbool_t from_open, void *ctx_udata); +static H5EA_t *H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, + void *ctx_udata); /*********************/ @@ -131,7 +130,7 @@ H5FL_BLK_DEFINE(ea_native_elmt); */ BEGIN_FUNC(STATIC, ERR, H5EA_t *, NULL, NULL, -H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx_udata)) +H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array */ @@ -148,7 +147,7 @@ H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array info") /* Lock the array header into memory */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Check for pending array deletion */ @@ -172,10 +171,10 @@ H5EA__new(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, hbool_t from_open, void *ctx CATCH - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(STATIC) /* end H5EA__new() */ @@ -197,7 +196,7 @@ END_FUNC(STATIC) /* end H5EA__new() */ */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udata)) +H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array */ @@ -213,11 +212,11 @@ H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udat HDcompile_assert(H5EA_NUM_CLS_ID == NELMTS(H5EA_client_class_g)); /* Create extensible array header */ - if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, dxpl_id, cparam, ctx_udata))) + if(HADDR_UNDEF == (ea_addr = H5EA__hdr_create(f, cparam, ctx_udata))) H5E_THROW(H5E_CANTINIT, "can't create extensible array header") /* Allocate and initialize new extensible array wrapper */ - if(NULL == (ea = H5EA__new(f, dxpl_id, ea_addr, FALSE, ctx_udata))) + if(NULL == (ea = H5EA__new(f, ea_addr, FALSE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper") /* Set the return value */ @@ -226,7 +225,7 @@ H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, void *ctx_udat CATCH if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(PRIV) /* end H5EA_create() */ @@ -248,7 +247,7 @@ END_FUNC(PRIV) /* end H5EA_create() */ */ BEGIN_FUNC(PRIV, ERR, H5EA_t *, NULL, NULL, -H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) +H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata)) /* Local variables */ H5EA_t *ea = NULL; /* Pointer to new extensible array wrapper */ @@ -260,7 +259,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) HDassert(H5F_addr_defined(ea_addr)); /* Allocate and initialize new extensible array wrapper */ - if(NULL == (ea = H5EA__new(f, dxpl_id, ea_addr, TRUE, ctx_udata))) + if(NULL == (ea = H5EA__new(f, ea_addr, TRUE, ctx_udata))) H5E_THROW(H5E_CANTINIT, "allocation and/or initialization failed for extensible array wrapper") /* Set the return value */ @@ -269,7 +268,7 @@ H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) CATCH if(!ret_value) - if(ea && H5EA_close(ea, dxpl_id) < 0) + if(ea && H5EA_close(ea) < 0) H5E_THROW(H5E_CLOSEERROR, "unable to close extensible array") END_FUNC(PRIV) /* end H5EA_open() */ @@ -354,7 +353,7 @@ END_FUNC(PRIV) /* end H5EA_get_addr() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_extend, +H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned thing_acc, void **thing, uint8_t **thing_elmt_buf, hsize_t *thing_elmt_idx, H5EA__unprotect_func_t *thing_unprot_func)) @@ -395,7 +394,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the index block */ - hdr->idx_blk_addr = H5EA__iblock_create(hdr, dxpl_id, &stats_changed); + hdr->idx_blk_addr = H5EA__iblock_create(hdr, &stats_changed); if(!H5F_addr_defined(hdr->idx_blk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create index block") hdr_dirty = TRUE; @@ -405,7 +404,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, thing_acc))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check if element is in index block */ @@ -442,7 +441,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Create data block */ dblk_off = hdr->sblk_info[sblk_idx].start_idx + (dblk_idx * hdr->sblk_info[sblk_idx].dblk_nelmts); - dblk_addr = H5EA__dblock_create(hdr, dxpl_id, iblock, &stats_changed, dblk_off, hdr->sblk_info[sblk_idx].dblk_nelmts); + dblk_addr = H5EA__dblock_create(hdr, iblock, &stats_changed, dblk_off, hdr->sblk_info[sblk_idx].dblk_nelmts); if(!H5F_addr_defined(dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block") @@ -455,7 +454,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, iblock, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, thing_acc))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, iblock, iblock->dblk_addrs[dblk_idx], hdr->sblk_info[sblk_idx].dblk_nelmts, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)iblock->dblk_addrs[dblk_idx]) /* Adjust index to offset in data block */ @@ -487,7 +486,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext haddr_t sblk_addr; /* Address of data block created */ /* Create super block */ - sblk_addr = H5EA__sblock_create(hdr, dxpl_id, iblock, &stats_changed, sblk_idx); + sblk_addr = H5EA__sblock_create(hdr, iblock, &stats_changed, sblk_idx); if(!H5F_addr_defined(sblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array super block") @@ -500,7 +499,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect super block */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, iblock, iblock->sblk_addrs[sblk_off], sblk_idx, thing_acc))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, iblock, iblock->sblk_addrs[sblk_off], sblk_idx, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)iblock->sblk_addrs[sblk_off]) /* Compute the data block index in super block */ @@ -516,7 +515,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Create data block */ dblk_off = hdr->sblk_info[sblk_idx].start_idx + (dblk_idx * hdr->sblk_info[sblk_idx].dblk_nelmts); - dblk_addr = H5EA__dblock_create(hdr, dxpl_id, sblock, &stats_changed, dblk_off, sblock->dblk_nelmts); + dblk_addr = H5EA__dblock_create(hdr, sblock, &stats_changed, dblk_off, sblock->dblk_nelmts); if(!H5F_addr_defined(dblk_addr)) H5E_THROW(H5E_CANTCREATE, "unable to create extensible array data block") @@ -563,7 +562,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext /* Check if we are allowed to create the thing */ if(0 == (thing_acc & H5AC__READ_ONLY_FLAG)) { /* i.e. r/w access */ /* Create the data block page */ - if(H5EA__dblk_page_create(hdr, dxpl_id, sblock, dblk_page_addr) < 0) + if(H5EA__dblk_page_create(hdr, sblock, dblk_page_addr) < 0) H5E_THROW(H5E_CANTCREATE, "unable to create data block page") /* Mark data block page as initialized in super block */ @@ -575,7 +574,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ /* Protect data block page */ - if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, dxpl_id, sblock, dblk_page_addr, thing_acc))) + if(NULL == (dblk_page = H5EA__dblk_page_protect(hdr, sblock, dblk_page_addr, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Check if there is already a dependency on the header */ @@ -593,7 +592,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, hbool_t will_ext } /* end if */ else { /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, sblock, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, thing_acc))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, sblock, sblock->dblk_addrs[dblk_idx], sblock->dblk_nelmts, thing_acc))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)sblock->dblk_addrs[dblk_idx]) /* Check if there is already a dependency on the header */ @@ -635,14 +634,14 @@ CATCH H5E_THROW(H5E_CANTMARKDIRTY, "unable to mark extensible array header as modified") /* Release resources */ - if(iblock && *thing != iblock && H5EA__iblock_unprotect(iblock, dxpl_id, iblock_cache_flags) < 0) + if(iblock && *thing != iblock && H5EA__iblock_unprotect(iblock, iblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") /* (Note: super blocks don't contain elements, so don't have a '*thing != sblock' check) */ - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, sblock_cache_flags) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, sblock_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") - if(dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") - if(dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block page") END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ @@ -663,7 +662,7 @@ END_FUNC(STATIC) /* end H5EA__lookup_elmt() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) +H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -685,7 +684,7 @@ H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) /* Look up the array metadata containing the element we want to set */ will_extend = (idx >= hdr->stats.stored.max_idx_set); - if(H5EA__lookup_elmt(ea, dxpl_id, idx, will_extend, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, idx, will_extend, H5AC__NO_FLAGS_SET, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Sanity check */ @@ -707,7 +706,7 @@ H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt)) CATCH /* Release resources */ - if(thing && (thing_unprot_func)(thing, dxpl_id, thing_cache_flags) < 0) + if(thing && (thing_unprot_func)(thing, thing_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") END_FUNC(PRIV) /* end H5EA_set() */ @@ -728,7 +727,7 @@ END_FUNC(PRIV) /* end H5EA_set() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) +H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -755,7 +754,7 @@ H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) hdr->f = ea->f; /* Look up the array metadata containing the element we want to set */ - if(H5EA__lookup_elmt(ea, dxpl_id, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) + if(H5EA__lookup_elmt(ea, idx, FALSE, H5AC__READ_ONLY_FLAG, &thing, &thing_elmt_buf, &thing_elmt_idx, &thing_unprot_func) < 0) H5E_THROW(H5E_CANTPROTECT, "unable to protect array metadata") /* Check if the thing holding the element has been created yet */ @@ -771,7 +770,7 @@ H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt)) CATCH /* Release thing */ - if(thing && (thing_unprot_func)(thing, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(thing && (thing_unprot_func)(thing, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") END_FUNC(PRIV) /* end H5EA_get() */ @@ -793,7 +792,7 @@ END_FUNC(PRIV) /* end H5EA_get() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) +H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -818,7 +817,7 @@ H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent)) hdr->f = ea->f; /* Add the extensible 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 extensible array as child of proxy") hdr->parent = parent; } /* end if */ @@ -843,7 +842,7 @@ END_FUNC(PRIV) /* end H5EA_depend() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_close(H5EA_t *ea, hid_t dxpl_id)) +H5EA_close(H5EA_t *ea)) /* Local variables */ hbool_t pending_delete = FALSE; /* Whether the array is pending deletion */ @@ -894,7 +893,7 @@ H5EA_close(H5EA_t *ea, 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 = H5EA__hdr_protect(ea->f, dxpl_id, ea_addr, NULL, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5EA__hdr_protect(ea->f, ea_addr, NULL, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTLOAD, "unable to load extensible array header") /* Set the shared array header's file context for this operation */ @@ -908,7 +907,7 @@ H5EA_close(H5EA_t *ea, 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(H5EA__hdr_delete(hdr, dxpl_id) < 0) + if(H5EA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array") } /* end if */ else { @@ -944,7 +943,7 @@ END_FUNC(PRIV) /* end H5EA_close() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) +H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -956,7 +955,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) HDassert(H5F_addr_defined(ea_addr)); /* Lock the array header into memory */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) /* Check for files using shared array header */ @@ -967,7 +966,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) hdr->f = f; /* Delete array now, starting with header (unprotects header) */ - if(H5EA__hdr_delete(hdr, dxpl_id) < 0) + if(H5EA__hdr_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array") hdr = NULL; } /* end if */ @@ -975,7 +974,7 @@ H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata)) CATCH /* Unprotect the header, if an error occurred */ - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PRIV) /* end H5EA_delete() */ @@ -995,7 +994,7 @@ END_FUNC(PRIV) /* end H5EA_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_iterate(H5EA_t *ea, hid_t dxpl_id, H5EA_operator_t op, void *udata)) +H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata)) /* Local variables */ uint8_t *elmt = NULL; @@ -1017,7 +1016,7 @@ H5EA_iterate(H5EA_t *ea, hid_t dxpl_id, H5EA_operator_t op, void *udata)) int cb_ret; /* Return value from callback */ /* Get array element */ - if(H5EA_get(ea, dxpl_id, u, elmt) < 0) + if(H5EA_get(ea, u, elmt) < 0) H5E_THROW(H5E_CANTGET, "unable to delete fixed array") /* Make callback */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index def38af..8138991 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -110,7 +110,7 @@ static herr_t H5EA__cache_dblock_serialize(const H5F_t *f, void *image, size_t l void *thing); static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5EA__cache_dblock_free_icr(void *thing); -static herr_t H5EA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); +static herr_t H5EA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5EA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5EA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); @@ -1875,7 +1875,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) +H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)) /* Local variables */ const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index e67a5a8..1a2b973 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -93,7 +93,7 @@ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t obj_addr)) /* Local variables */ @@ -110,14 +110,13 @@ H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(cls); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Print opening message */ @@ -169,7 +168,7 @@ H5EA__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 extensible array debugging context") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_debug() */ @@ -190,7 +189,7 @@ END_FUNC(PKG) /* end H5EA__hdr_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, +H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ @@ -209,21 +208,20 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *s HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Sanity check */ HDassert(H5F_addr_eq(hdr->idx_blk_addr, addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__READ_ONLY_FLAG))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Print opening message */ @@ -292,9 +290,9 @@ H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *s CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__iblock_debug() */ @@ -315,7 +313,7 @@ END_FUNC(PKG) /* end H5EA__iblock_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr)) /* Local variables */ @@ -334,19 +332,18 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect super block */ /* (Note: setting parent of super block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, (H5EA_iblock_t *)hdr, addr, sblk_idx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -384,9 +381,9 @@ H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__sblock_debug() */ @@ -407,7 +404,7 @@ END_FUNC(PKG) /* end H5EA__sblock_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, size_t dblk_nelmts, haddr_t obj_addr)) /* Local variables */ @@ -428,19 +425,18 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(dblk_nelmts > 0); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create extensible array debugging context") - } /* end if */ /* Load the extensible array header */ - if(NULL == (hdr = H5EA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5EA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load extensible array header") /* Protect data block */ /* (Note: setting parent of data block to 'hdr' for this operation should be OK -QAK) */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, hdr, addr, dblk_nelmts, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -467,9 +463,9 @@ H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release extensible array debugging context") - if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") - if(hdr && H5EA__hdr_unprotect(hdr, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__dblock_debug() */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 2b07356..6dd2e98 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -148,8 +148,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_alloc() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, - haddr_t addr)) +H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr)) /* Local variables */ H5EA_dblk_page_t *dblk_page = NULL; /* Extensible array data block page */ @@ -171,13 +170,13 @@ H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, H5E_THROW(H5E_CANTSET, "can't set extensible array data block page elements to class's fill value") /* Cache the new extensible array data block page */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block page to cache") inserted = TRUE; /* Add data block page as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -214,7 +213,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_dblk_page_t *, NULL, NULL, -H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, +H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags)) /* Local variables */ @@ -234,13 +233,13 @@ H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_sblock_t *parent, udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (dblk_page = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) + if(NULL == (dblk_page = (H5EA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblk_page->top_proxy) { /* Add data block page as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -252,7 +251,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block page, if it was protected */ - if(dblk_page && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long long)dblk_page->addr) } /* end if */ @@ -275,8 +274,7 @@ END_FUNC(PKG) /* end H5EA__dblk_page_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, hid_t dxpl_id, - unsigned cache_flags)) +H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags)) /* Local variables */ @@ -284,7 +282,7 @@ H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, hid_t dxpl_id, HDassert(dblk_page); /* Unprotect the data block page */ - if(H5AC_unprotect(dblk_page->hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) + if(H5AC_unprotect(dblk_page->hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block page, address = %llu", (unsigned long long)dblk_page->addr) CATCH diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 7df0ee9..d926fd5 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -160,8 +160,8 @@ END_FUNC(PKG) /* end H5EA__dblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts)) +H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, + hsize_t dblk_off, size_t nelmts)) /* Local variables */ H5EA_dblock_t *dblock = NULL; /* Extensible array data block */ @@ -184,7 +184,7 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, dblock->block_off = dblk_off; /* Allocate space for the data block on disk */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_DBLOCK, (hsize_t)dblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array data block") dblock->addr = dblock_addr; @@ -195,13 +195,13 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, H5E_THROW(H5E_CANTSET, "can't set extensible array data block elements to class's fill value") /* Cache the new extensible array data block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array data block to cache") inserted = TRUE; /* Add data block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -228,7 +228,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array data block from cache") /* Release data block's disk space */ - if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dxpl_id, dblock->addr, (hsize_t)dblock->size) < 0) + if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release extensible array data block") /* Destroy data block */ @@ -292,8 +292,8 @@ END_FUNC(PKG) /* end H5EA__dblock_sblk_idx() */ */ BEGIN_FUNC(PKG, ERR, H5EA_dblock_t *, NULL, NULL, -H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags)) +H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, + size_t dblk_nelmts, unsigned flags)) /* Local variables */ H5EA_dblock_t *dblock; /* Extensible array data block */ @@ -314,13 +314,13 @@ H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (dblock = (H5EA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags))) + if(NULL == (dblock = (H5EA_dblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblock->top_proxy) { /* Add data block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -333,7 +333,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block, if it was protected */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long long)dblock->addr) } /* end if */ @@ -355,7 +355,7 @@ END_FUNC(PKG) /* end H5EA__dblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags)) /* Local variables */ @@ -363,7 +363,7 @@ H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flag HDassert(dblock); /* Unprotect the data block */ - if(H5AC_unprotect(dblock->hdr->f, dxpl_id, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(dblock->hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array data block, address = %llu", (unsigned long long)dblock->addr) CATCH @@ -386,8 +386,8 @@ END_FUNC(PKG) /* end H5EA__dblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, - haddr_t dblk_addr, size_t dblk_nelmts)) +H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, + size_t dblk_nelmts)) /* Local variables */ H5EA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -399,7 +399,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, HDassert(dblk_nelmts > 0); /* Protect data block */ - if(NULL == (dblock = H5EA__dblock_protect(hdr, dxpl_id, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5EA__dblock_protect(hdr, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if this is a paged data block */ @@ -418,7 +418,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, for(u = 0; u < npages; u++) { /* Evict the data block page from the metadata cache */ /* (OK to call if it doesn't exist in the cache) */ - if(H5AC_expunge_entry(hdr->f, dxpl_id, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache") /* Advance to next page address */ @@ -428,7 +428,7 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, CATCH /* Finished deleting data block in metadata cache */ - if(dblock && H5EA__dblock_unprotect(dblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(dblock && H5EA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array data block") END_FUNC(PKG) /* end H5EA__dblock_delete() */ diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 92d7c4d..62a23b8 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -355,8 +355,7 @@ END_FUNC(PKG) /* end H5EA__hdr_free_elmts() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, - void *ctx_udata)) +H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5EA_hdr_t *hdr = NULL; /* Extensible array header */ @@ -415,7 +414,7 @@ H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, (hsize_t)hdr->size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, (hsize_t)hdr->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header") /* Create 'top' proxy for extensible array entries */ @@ -424,13 +423,13 @@ H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy") /* Cache the new extensible array header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_EARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") /* Set address of array header to return */ @@ -445,7 +444,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, dxpl_id, hdr->addr, (hsize_t)hdr->size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_EARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to free extensible array header") /* Destroy header */ @@ -626,7 +625,7 @@ END_FUNC(PKG) /* end H5EA__hdr_modified() */ */ BEGIN_FUNC(PKG, ERR, H5EA_hdr_t *, NULL, NULL, -H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, +H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags)) /* Local variables */ @@ -646,7 +645,7 @@ H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_EARRAY_HDR, ea_addr, &udata, flags))) + if(NULL == (hdr = (H5EA_hdr_t *)H5AC_protect(f, H5AC_EARRAY_HDR, ea_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array header, address = %llu", (unsigned long long)ea_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -657,7 +656,7 @@ H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata, H5E_THROW(H5E_CANTCREATE, "can't create extensible array entry proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") } /* end if */ @@ -684,7 +683,7 @@ END_FUNC(PKG) /* end H5EA__hdr_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) +H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags)) /* Local variables */ @@ -692,7 +691,7 @@ H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array hdr, address = %llu", (unsigned long long)hdr->addr) CATCH @@ -715,7 +714,7 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) +H5EA__hdr_delete(H5EA_hdr_t *hdr)) /* Local variables */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ @@ -741,7 +740,7 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) /* Check for index block */ if(H5F_addr_defined(hdr->idx_blk_addr)) { /* Delete index block */ - if(H5EA__iblock_delete(hdr, dxpl_id) < 0) + if(H5EA__iblock_delete(hdr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array index block") } /* end if */ @@ -751,7 +750,7 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) CATCH /* Unprotect the header, deleting it if an error hasn't occurred */ - if(H5EA__hdr_unprotect(hdr, dxpl_id, cache_flags) < 0) + if(H5EA__hdr_unprotect(hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array header") END_FUNC(PKG) /* end H5EA__hdr_delete() */ diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index e25e3ef..1b5957a 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -176,7 +176,7 @@ END_FUNC(PKG) /* end H5EA__iblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__iblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, hbool_t *stats_changed)) +H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Extensible array index block */ @@ -202,7 +202,7 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); #endif /* QAK */ /* Allocate space for the index block on disk */ - if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (iblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_IBLOCK, (hsize_t)iblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array index block") iblock->addr = iblock_addr; @@ -230,13 +230,13 @@ HDfprintf(stderr, "%s: iblock->size = %Zu\n", FUNC, iblock->size); } /* end if */ /* Cache the new extensible array index block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_IBLOCK, iblock_addr, iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array index block to cache") inserted = TRUE; /* Add index block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, iblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") iblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -265,7 +265,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array index block from cache") /* Release index block's disk space */ - if(H5F_addr_defined(iblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5F_addr_defined(iblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release file space for extensible array index block") /* Destroy index block */ @@ -291,7 +291,7 @@ END_FUNC(PKG) /* end H5EA__iblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_iblock_t *, NULL, NULL, -H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned flags)) +H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ @@ -307,13 +307,13 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Protect the index block */ - if(NULL == (iblock = (H5EA_iblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags))) + if(NULL == (iblock = (H5EA_iblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_IBLOCK, hdr->idx_blk_addr, hdr, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == iblock->top_proxy) { /* Add index block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, iblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, iblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") iblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -325,7 +325,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the index block, if it was protected */ - if(iblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, H5AC__NO_FLAGS_SET) < 0) + if(iblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long long)iblock->addr) } /* end if */ @@ -347,7 +347,7 @@ END_FUNC(PKG) /* end H5EA__iblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_unprotect(H5EA_iblock_t *iblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags)) /* Local variables */ @@ -359,7 +359,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(iblock); /* Unprotect the index block */ - if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) + if(H5AC_unprotect(iblock->hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array index block, address = %llu", (unsigned long long)iblock->addr) CATCH @@ -382,7 +382,7 @@ END_FUNC(PKG) /* end H5EA__iblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__iblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id)) +H5EA__iblock_delete(H5EA_hdr_t *hdr)) /* Local variables */ H5EA_iblock_t *iblock = NULL; /* Pointer to index block */ @@ -396,7 +396,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(H5F_addr_defined(hdr->idx_blk_addr)); /* Protect index block */ - if(NULL == (iblock = H5EA__iblock_protect(hdr, dxpl_id, H5AC__NO_FLAGS_SET))) + if(NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array index block, address = %llu", (unsigned long long)hdr->idx_blk_addr) /* Check for index block having data block pointers */ @@ -411,7 +411,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Check for data block existing */ if(H5F_addr_defined(iblock->dblk_addrs[u])) { /* Delete data block */ - if(H5EA__dblock_delete(hdr, dxpl_id, iblock, iblock->dblk_addrs[u], hdr->sblk_info[sblk_idx].dblk_nelmts) < 0) + if(H5EA__dblock_delete(hdr, iblock, iblock->dblk_addrs[u], hdr->sblk_info[sblk_idx].dblk_nelmts) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block") iblock->dblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -436,7 +436,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); /* Check for data block existing */ if(H5F_addr_defined(iblock->sblk_addrs[u])) { /* Delete super block */ - if(H5EA__sblock_delete(hdr, dxpl_id, iblock, iblock->sblk_addrs[u], (unsigned)(u + iblock->nsblks)) < 0) + if(H5EA__sblock_delete(hdr, iblock, iblock->sblk_addrs[u], (unsigned)(u + iblock->nsblks)) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array super block") iblock->sblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -445,7 +445,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); CATCH /* Finished deleting index block in metadata cache */ - if(iblock && H5EA__iblock_unprotect(iblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(iblock && H5EA__iblock_unprotect(iblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array index block") END_FUNC(PKG) /* end H5EA__iblock_delete() */ diff --git a/src/H5EApkg.h b/src/H5EApkg.h index e162fab..fb9afc0 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -396,7 +396,7 @@ H5_DLL herr_t H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, /* Header routines */ H5_DLL H5EA_hdr_t *H5EA__hdr_alloc(H5F_t *f); H5_DLL herr_t H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata); -H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, +H5_DLL haddr_t H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata); H5_DLL void *H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts); H5_DLL herr_t H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts); @@ -405,71 +405,65 @@ H5_DLL herr_t H5EA__hdr_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr); H5_DLL size_t H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_modified(H5EA_hdr_t *hdr); -H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, +H5_DLL H5EA_hdr_t *H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags); -H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags); -H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5EA__hdr_delete(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__hdr_dest(H5EA_hdr_t *hdr); /* Index block routines */ H5_DLL H5EA_iblock_t *H5EA__iblock_alloc(H5EA_hdr_t *hdr); -H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - hbool_t *stats_changed); -H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - unsigned flags); -H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id); +H5_DLL haddr_t H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed); +H5_DLL H5EA_iblock_t *H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags); +H5_DLL herr_t H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags); +H5_DLL herr_t H5EA__iblock_delete(H5EA_hdr_t *hdr); H5_DLL herr_t H5EA__iblock_dest(H5EA_iblock_t *iblock); /* Super block routines */ H5_DLL H5EA_sblock_t *H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx); -H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, hbool_t *stats_changed, unsigned sblk_idx); -H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, - unsigned flags); -H5_DLL herr_t H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx); +H5_DLL haddr_t H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + hbool_t *stats_changed, unsigned sblk_idx); +H5_DLL H5EA_sblock_t *H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + haddr_t sblk_addr, unsigned sblk_idx, unsigned flags); +H5_DLL herr_t H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags); +H5_DLL herr_t H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, + haddr_t sblk_addr, unsigned sblk_idx); H5_DLL herr_t H5EA__sblock_dest(H5EA_sblock_t *sblock); /* Data block routines */ H5_DLL H5EA_dblock_t *H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts); -H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL haddr_t H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize_t dblk_off, size_t nelmts); H5_DLL unsigned H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx); -H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, - void *parent, haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags); -H5_DLL herr_t H5EA__dblock_unprotect(H5EA_dblock_t *dblock, hid_t dxpl_id, - unsigned cache_flags); -H5_DLL herr_t H5EA__dblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, void *parent, +H5_DLL H5EA_dblock_t *H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, + haddr_t dblk_addr, size_t dblk_nelmts, unsigned flags); +H5_DLL herr_t H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags); +H5_DLL herr_t H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dblk_nelmts); H5_DLL herr_t H5EA__dblock_dest(H5EA_dblock_t *dblock); /* Data block page routines */ H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent); -H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, hid_t dxpl_id, - H5EA_sblock_t *parent, haddr_t addr); -H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, + haddr_t addr); +H5_DLL H5EA_dblk_page_t *H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_page_addr, unsigned flags); H5_DLL herr_t H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, - hid_t dxpl_id, unsigned cache_flags); + unsigned cache_flags); H5_DLL herr_t H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5EA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t obj_addr); -H5_DLL herr_t H5EA__iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr); -H5_DLL herr_t H5EA__sblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, unsigned sblk_idx, haddr_t obj_addr); -H5_DLL herr_t H5EA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5EA_class_t *cls, haddr_t hdr_addr, size_t dblk_nelmts, haddr_t obj_addr); diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index cda1d46..1195256 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -72,7 +72,7 @@ typedef struct H5EA_class_t { herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */ herr_t (*decode)(const void *raw, void *elmt, size_t nelmts, void *ctx); /* Decode elements from disk storage form to native form */ herr_t (*debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Print an element for debugging */ - void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ + void *(*crt_dbg_ctx)(H5F_t *f, haddr_t obj_addr); /* Create debugging context */ herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ } H5EA_class_t; @@ -133,17 +133,17 @@ H5_DLLVAR const H5EA_class_t H5EA_CLS_FILT_CHUNK[1]; /***************************************/ /* General routines */ -H5_DLL H5EA_t *H5EA_create(H5F_t *f, hid_t dxpl_id, const H5EA_create_t *cparam, +H5_DLL H5EA_t *H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata); -H5_DLL H5EA_t *H5EA_open(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata); +H5_DLL H5EA_t *H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata); H5_DLL herr_t H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts); H5_DLL herr_t H5EA_get_addr(const H5EA_t *ea, haddr_t *addr); -H5_DLL herr_t H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt); -H5_DLL herr_t H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt); -H5_DLL herr_t H5EA_depend(H5EA_t *ea, hid_t dxpl_id, H5AC_proxy_entry_t *parent); -H5_DLL herr_t H5EA_iterate(H5EA_t *fa, hid_t dxpl_id, H5EA_operator_t op, void *udata); -H5_DLL herr_t H5EA_close(H5EA_t *ea, hid_t dxpl_id); -H5_DLL herr_t H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr, void *ctx_udata); +H5_DLL herr_t H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt); +H5_DLL herr_t H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt); +H5_DLL herr_t H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5EA_iterate(H5EA_t *fa, H5EA_operator_t op, void *udata); +H5_DLL herr_t H5EA_close(H5EA_t *ea); +H5_DLL herr_t H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata); H5_DLL herr_t H5EA_patch_file(H5EA_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index 4e291c0..b4671f8 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -186,8 +186,8 @@ END_FUNC(PKG) /* end H5EA__sblock_alloc() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, - hbool_t *stats_changed, unsigned sblk_idx)) +H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_changed, + unsigned sblk_idx)) /* Local variables */ H5EA_sblock_t *sblock = NULL; /* Extensible array super block */ @@ -210,7 +210,7 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, sblock->block_off = hdr->sblk_info[sblk_idx].start_idx; /* Allocate space for the super block on disk */ - if(HADDR_UNDEF == (sblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_SBLOCK, dxpl_id, (hsize_t)sblock->size))) + if(HADDR_UNDEF == (sblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_EARRAY_SBLOCK, (hsize_t)sblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array super block") sblock->addr = sblock_addr; @@ -218,13 +218,13 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, H5VM_array_fill(sblock->dblk_addrs, &tmp_addr, sizeof(haddr_t), sblock->ndblks); /* Cache the new extensible array super block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_EARRAY_SBLOCK, sblock_addr, sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add extensible array super block to cache") inserted = TRUE; /* Add super block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, sblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") sblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -248,7 +248,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove extensible array super block from cache") /* Release super block's disk space */ - if(H5F_addr_defined(sblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_SBLOCK, dxpl_id, sblock->addr, (hsize_t)sblock->size) < 0) + if(H5F_addr_defined(sblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_EARRAY_SBLOCK, sblock->addr, (hsize_t)sblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release extensible array super block") /* Destroy super block */ @@ -274,7 +274,7 @@ END_FUNC(PKG) /* end H5EA__sblock_create() */ */ BEGIN_FUNC(PKG, ERR, H5EA_sblock_t *, NULL, NULL, -H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, +H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx, unsigned flags)) /* Local variables */ @@ -295,13 +295,13 @@ H5EA__sblock_protect(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, udata.sblk_addr = sblk_addr; /* Protect the super block */ - if(NULL == (sblock = (H5EA_sblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags))) + if(NULL == (sblock = (H5EA_sblock_t *)H5AC_protect(hdr->f, H5AC_EARRAY_SBLOCK, sblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == sblock->top_proxy) { /* Add super block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, sblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, sblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add extensible array entry as child of array proxy") sblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -313,7 +313,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the super block, if it was protected */ - if(sblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, H5AC__NO_FLAGS_SET) < 0) + if(sblock && H5AC_unprotect(hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long long)sblock->addr) } /* end if */ @@ -335,7 +335,7 @@ END_FUNC(PKG) /* end H5EA__sblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, unsigned cache_flags)) +H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags)) /* Local variables */ @@ -343,7 +343,7 @@ H5EA__sblock_unprotect(H5EA_sblock_t *sblock, hid_t dxpl_id, unsigned cache_flag HDassert(sblock); /* Unprotect the super block */ - if(H5AC_unprotect(sblock->hdr->f, dxpl_id, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) + if(H5AC_unprotect(sblock->hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect extensible array super block, address = %llu", (unsigned long long)sblock->addr) CATCH @@ -366,7 +366,7 @@ END_FUNC(PKG) /* end H5EA__sblock_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, +H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, unsigned sblk_idx)) /* Local variables */ @@ -378,7 +378,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, HDassert(H5F_addr_defined(sblk_addr)); /* Protect super block */ - if(NULL == (sblock = H5EA__sblock_protect(hdr, dxpl_id, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) + if(NULL == (sblock = H5EA__sblock_protect(hdr, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect extensible array super block, address = %llu", (unsigned long long)sblk_addr) /* Iterate over data blocks */ @@ -386,7 +386,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, /* Check for data block existing */ if(H5F_addr_defined(sblock->dblk_addrs[u])) { /* Delete data block */ - if(H5EA__dblock_delete(hdr, dxpl_id, sblock, sblock->dblk_addrs[u], sblock->dblk_nelmts) < 0) + if(H5EA__dblock_delete(hdr, sblock, sblock->dblk_addrs[u], sblock->dblk_nelmts) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete extensible array data block") sblock->dblk_addrs[u] = HADDR_UNDEF; } /* end if */ @@ -394,7 +394,7 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, hid_t dxpl_id, H5EA_iblock_t *parent, CATCH /* Finished deleting super block in metadata cache */ - if(sblock && H5EA__sblock_unprotect(sblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(sblock && H5EA__sblock_unprotect(sblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array super block") END_FUNC(PKG) /* end H5EA__sblock_delete() */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 422ea68..3da7996 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -76,7 +76,7 @@ static herr_t H5EA__test_fill(void *nat_blk, size_t nelmts); static herr_t H5EA__test_encode(void *raw, const void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr); +static void *H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr); static herr_t H5EA__test_dst_dbg_context(void *_ctx); /*********************/ @@ -356,7 +356,7 @@ END_FUNC(STATIC) /* end H5EA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) +H5EA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5EA__ctx_cb_t *ctx; /* Context for callbacks */ diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 57e7485..44a542e 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -72,8 +72,7 @@ typedef struct H5E_t H5E_t; * H5_END_TAG statements. Resets the metadata tag before leaving the function. */ #define HGOTO_ERROR_TAG(maj, min, ret_val, ...) { \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ - HERROR(H5E_CACHE, H5E_CANTTAG, "unable to apply metadata tag"); \ + H5AC_tag(prv_tag, NULL); \ HCOMMON_ERROR(maj, min, __VA_ARGS__); \ HGOTO_DONE(ret_val) \ } @@ -90,9 +89,8 @@ typedef struct H5E_t H5E_t; * HGOTO_DONE_TAG macro, used like HGOTO_DONE between H5_BEGIN_TAG and * H5_END_TAG statements. Resets the metadata tag before leaving the function. */ -#define HGOTO_DONE_TAG(ret_val, err) { \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) < 0) \ - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ +#define HGOTO_DONE_TAG(ret_val) { \ + H5AC_tag(prv_tag, NULL); \ HGOTO_DONE(ret_val) \ } diff --git a/src/H5F.c b/src/H5F.c index f435502..414bb19 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -24,6 +24,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ @@ -33,7 +34,6 @@ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tprivate.h" /* Datatypes */ @@ -79,7 +79,7 @@ static const H5I_class_t H5I_FILE_CLS[1] = {{ H5I_FILE, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5F_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5F__close_cb /* Callback routine for closing objects of this class */ }}; @@ -355,6 +355,7 @@ done: htri_t H5Fis_hdf5(const char *name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -363,13 +364,19 @@ H5Fis_hdf5(const char *name) /* Check args and all the boring stuff. */ if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* call the private is_HDF5 function */ - if((ret_value = H5F__is_hdf5(name, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id)) < 0) + /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ + if((ret_value = H5F__is_hdf5(name)) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable open file") done: - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fis_hdf5() */ @@ -401,36 +408,40 @@ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id;/* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); /* Check/fix arguments */ if (!filename || !*filename) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file name") /* In this routine, we only accept the following flags: * H5F_ACC_EXCL, H5F_ACC_TRUNC and H5F_ACC_SWMR_WRITE */ if (flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid flags") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid flags") /* The H5F_ACC_EXCL and H5F_ACC_TRUNC flags are mutually exclusive */ if ((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "mutually exclusive flags for file creation") /* Check file creation property list */ if (H5P_DEFAULT == fcpl_id) fcpl_id = H5P_FILE_CREATE_DEFAULT; else if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not file create property list") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for @@ -441,19 +452,21 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; /* Create a new file or truncate an existing file. */ - if (NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") + if (NULL == (new_file = H5F__create(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to create file") /* Get an atom for the file */ if ((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file") /* Keep this ID in file object structure */ new_file->file_id = ret_value; done: - if (ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") + if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fcreate() */ @@ -482,45 +495,51 @@ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { H5F_t *new_file = NULL; /* file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "*sIui", filename, flags, fapl_id); /* Check/fix arguments. */ if(!filename || !*filename) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file name") /* Reject undefined flags (~H5F_ACC_PUBLIC_FLAGS) and the H5F_ACC_TRUNC & H5F_ACC_EXCL flags */ if((flags & ~H5F_ACC_PUBLIC_FLAGS) || (flags & H5F_ACC_TRUNC) || (flags & H5F_ACC_EXCL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file open flags") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid file open flags") /* Asking for SWMR write access on a read-only file is invalid */ if((flags & H5F_ACC_SWMR_WRITE) && 0 == (flags & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "SWMR write access on a file open for read-only access is not allowed") + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR write access on a file open for read-only access is not allowed") /* Asking for SWMR read access on a non-read-only file is invalid */ if((flags & H5F_ACC_SWMR_READ) && (flags & H5F_ACC_RDWR)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "SWMR read access on a file open for read-write access is not allowed") + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "SWMR read access on a file open for read-write access is not allowed") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, H5I_INVALID_HID, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the file */ - if(NULL == (new_file = H5F_open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open file") + if(NULL == (new_file = H5F__open(filename, flags, H5P_FILE_CREATE_DEFAULT, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, H5I_INVALID_HID, "unable to open file") /* Get an atom for the file */ if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle") /* Keep this ID in file object structure */ new_file->file_id = ret_value; done: if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, H5I_INVALID_HID, "problems closing file") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fopen() */ @@ -540,6 +559,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) { H5F_t *f = NULL; /* File to flush */ H5O_loc_t *oloc = NULL; /* Object location for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -623,20 +643,24 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) * to be flushed. */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { - /* Flush other files, depending on scope */ - if(H5F_SCOPE_GLOBAL == scope) { - /* Call the flush routine for mounted file hierarchies */ - if(H5F_flush_mounts(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") - } /* end if */ - else { - /* Call the flush routine, for this file */ - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - } /* end else */ + hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, object_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Flush the file */ + if(H5F__flush(f, scope) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fflush() */ @@ -658,39 +682,28 @@ done: herr_t H5Fclose(hid_t file_id) { - H5F_t *f = NULL; - int nref; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); - /* Check/fix arguments. */ - if (H5I_FILE != H5I_get_type(file_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") + /* Check arguments */ + if(H5I_FILE != H5I_get_type(file_id)) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file ID") - /* Flush file if this is the last reference to this id and we have write - * intent, unless it will be flushed by the "shared" file being closed. - * This is only necessary to replicate previous behaviour, and could be - * disabled by an option/property to improve performance. - */ - if (NULL == (f = (H5F_t *)H5I_object(file_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if ((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { - if ((nref = H5I_get_ref(file_id, FALSE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") - if (nref == 1) - if (H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } - - /* Decrement reference count on atom. When it reaches zero the file will - * be closed. - */ - if (H5I_dec_app_ref(file_id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Close the file */ + if(H5F__close(file_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "closing file ID failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclose() */ @@ -739,7 +752,7 @@ H5Freopen(hid_t file_id) done: if(ret_value < 0 && new_file) - if(H5F__dest(new_file, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if(H5F__dest(new_file, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") FUNC_LEAVE_API(ret_value) @@ -810,6 +823,7 @@ H5Fget_freespace(hid_t file_id) { H5F_t *file; /* File object for file ID */ hsize_t tot_space; /* Amount of free space in the file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -819,13 +833,20 @@ H5Fget_freespace(hid_t file_id) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* Go get the actual amount of free space in the file */ - if(H5MF_get_freespace(file, H5AC_ind_read_dxpl_id, &tot_space, NULL) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the free space in the file */ + if(H5F__get_freespace(file, &tot_space) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") ret_value = (hssize_t)tot_space; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_freespace() */ @@ -915,6 +936,7 @@ ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) { H5F_t *file; /* File object for file ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -924,11 +946,19 @@ H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* call private get_file_image function */ - if((ret_value = H5F_get_file_image(file, buf_ptr, buf_len, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id)) < 0) + /* (Should not trigger raw data I/O - QAK, 2018/01/03) */ + if((ret_value = H5F__get_file_image(file, buf_ptr, buf_len)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file image") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Fget_file_image() */ @@ -1199,6 +1229,7 @@ herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1226,28 +1257,18 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) } /* end else */ HDassert(f->shared); - /* Reset file info struct */ - HDmemset(finfo, 0, sizeof(*finfo)); - - /* Get the size of the superblock and any superblock extensions */ - if(H5F__super_size(f, H5AC_ind_read_dxpl_id, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock sizes") - - /* Get the size of any persistent free space */ - if(H5MF_get_freespace(f, H5AC_ind_read_dxpl_id, &finfo->free.tot_space, &finfo->free.meta_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve free space information") - - /* Check for SOHM info */ - if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_read_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - /* Set version # fields */ - finfo->super.version = f->shared->sblock->super_vers; - finfo->sohm.version = f->shared->sohm_vers; - finfo->free.version = HDF5_FREESPACE_VERSION; + /* Get the file info */ + if(H5F__get_info(f, finfo) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info2() */ @@ -1363,6 +1384,7 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/) { H5F_t *file; /* Top file in mount hierarchy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1374,11 +1396,18 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, if(sect_info && nsects == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "nsects must be > 0") - /* Go get the free-space section information in the file */ - if((ret_value = H5MF_get_free_sections(file, H5AC_ind_read_dxpl_id, type, nsects, sect_info)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the free-space section information in the file */ + if((ret_value = H5F__get_free_sections(file, type, nsects, sect_info)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_free_sections() */ @@ -1397,8 +1426,9 @@ done: herr_t H5Fclear_elink_file_cache(hid_t file_id) { - H5F_t *file; /* File */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *file; /* File */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); @@ -1407,12 +1437,21 @@ H5Fclear_elink_file_cache(hid_t file_id) if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* Release the EFC */ - if(file->shared->efc) - if(H5F_efc_release(file->shared->efc) < 0) + /* See if there's an EFC */ + if(file->shared->efc) { +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Release the EFC */ + if(H5F__efc_release(file->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") + } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ @@ -1450,18 +1489,10 @@ done: herr_t H5Fstart_swmr_write(hid_t file_id) { + H5F_t *file; /* File info */ hbool_t ci_load = FALSE; /* whether MDC ci load requested */ hbool_t ci_write = FALSE; /* whether MDC CI write requested */ - H5F_t *file = NULL; /* File info */ - size_t grp_dset_count=0; /* # of open objects: groups & datasets */ - size_t nt_attr_count=0; /* # of opened named datatypes + opened attributes */ - hid_t *obj_ids=NULL; /* List of ids */ - H5G_loc_t *obj_glocs=NULL; /* Group location of the object */ - H5O_loc_t *obj_olocs=NULL; /* Object location */ - H5G_name_t *obj_paths=NULL; /* Group hierarchy path */ - size_t u; /* Local index variable */ - hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ - H5F_io_info2_t fio_info; /* I/O info for operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1491,154 +1522,21 @@ H5Fstart_swmr_write(hid_t file_id) if(ci_load || ci_write ) HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, FAIL, "can't have both SWMR and MDC cache image") - /* Flush the superblock extension */ - if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock extension") - - /* Flush data buffers */ - if(H5F__flush(file, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") - - /* Get the # of opened named datatypes and attributes */ - if(H5F_get_obj_count(file, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - if(nt_attr_count) - HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") - - /* Get the # of opened datasets and groups */ - if(H5F_get_obj_count(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") - - if(grp_dset_count) { - /* Allocate space for group and object locations */ - if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") - if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") - if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") - if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") - - /* Get the list of opened object ids (groups & datasets) */ - if(H5F_get_obj_ids(file, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") - - /* Refresh opened objects (groups, datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) { - H5O_loc_t *oloc; /* object location */ - H5G_loc_t tmp_loc; - - /* Set up the id's group location */ - obj_glocs[u].oloc = &obj_olocs[u]; - obj_glocs[u].path = &obj_paths[u]; - H5G_loc_reset(&obj_glocs[u]); - - /* get the id's object location */ - if((oloc = H5O_get_loc(obj_ids[u])) == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") - - /* Make deep local copy of object's location information */ - H5G_loc(obj_ids[u], &tmp_loc); - H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); - - /* Close the object */ - if(H5I_dec_ref(obj_ids[u]) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") - } /* end for */ - } /* end if */ - - /* Set up I/O info for operation */ - fio_info.f = file; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Flush and reset the accumulator */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") - - /* Turn on SWMR write in shared file open flags */ - file->shared->flags |= H5F_ACC_SWMR_WRITE; - - /* Mark the file in SWMR writing mode */ - file->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; - - /* Set up metadata read attempts */ - file->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; - - /* Initialize "retries" and "retries_nbins" */ - if(H5F_set_retries(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Turn off usage of accumulator */ - file->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - setup = TRUE; - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - - /* Evict all flushed entries in the cache except the pinned superblock */ - if(H5F__evict_cache_entries(file, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") - - /* Refresh (reopen) the objects (groups & datasets) in the file */ - for(u = 0; u < grp_dset_count; u++) - if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], H5AC_ind_read_dxpl_id, TRUE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") - - /* Unlock the file */ - if(H5FD_unlock(file->shared->lf) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + /* Call the internal routine */ + if(H5F__start_swmr_write(file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: - if(ret_value < 0 && setup) { - HDassert(file); - - /* Re-enable accumulator */ - file->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; - if(H5FD_set_feature_flags(file->shared->lf, file->shared->feature_flags) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") - - /* Reset the # of read attempts */ - file->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; - if(H5F_set_retries(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") - - /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ - file->shared->flags &= ~H5F_ACC_SWMR_WRITE; - - /* Unmark the file: not in SWMR writing mode */ - file->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); - - /* Mark superblock as dirty */ - if(H5F_super_dirty(file) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - - /* Flush the superblock */ - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, H5AC_ind_read_dxpl_id) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") - } /* end if */ - - /* Free memory */ - if(obj_ids) - H5MM_xfree(obj_ids); - if(obj_glocs) - H5MM_xfree(obj_glocs); - if(obj_olocs) - H5MM_xfree(obj_olocs); - if(obj_paths) - H5MM_xfree(obj_paths); - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fstart_swmr_write() */ @@ -1752,6 +1650,7 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) { H5F_t *f; /* File */ unsigned latest_flags; /* Latest format flags for file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1764,8 +1663,18 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) /* Check if the value is changing */ latest_flags = H5F_USE_LATEST_FLAGS(f, H5F_LATEST_ALL_FLAGS); if(latest_format != (H5F_LATEST_ALL_FLAGS == latest_flags)) { + hid_t fapl_id = H5P_DEFAULT; /* FAPL to use */ + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&fapl_id, H5P_CLS_FACC, file_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Call the flush routine, for this file */ - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if(H5F__flush_real(f, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") /* Toggle the 'latest format' flag */ @@ -1773,12 +1682,14 @@ H5Fset_latest_format(hid_t file_id, hbool_t latest_format) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fset_latest_format() */ /*------------------------------------------------------------------------- - * Function: H5Fformat_convert_super (Internal) + * Function: H5Fformat_convert * * Purpose: Downgrade the superblock version to v2 and * downgrade persistent file space to non-persistent @@ -1790,59 +1701,35 @@ done: herr_t H5Fformat_convert(hid_t fid) { - herr_t ret_value = SUCCEED; /* Return value */ + H5F_t *f; /* File to flush */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fid); - if(H5I_FILE == H5I_get_type(fid)) { - H5F_t *f; /* File to flush */ - hbool_t mark_dirty = FALSE; - - /* Get file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + if(H5I_FILE != H5I_get_type(fid)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") - /* Check if the superblock should be downgraded */ - if(f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { - f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST; - mark_dirty = TRUE; - } /* end if */ + /* Get file object */ + if(NULL == (f = (H5F_t *)H5I_object(fid))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - /* Check for persistent freespace manager, which needs to be downgraded */ - if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && - f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && - f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && - f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { - /* Check to remove free-space manager info message from superblock extension */ - if(H5F_addr_defined(f->shared->sblock->ext_addr)) - if(H5F_super_ext_remove_msg(f, H5AC_ind_read_dxpl_id, H5O_FSINFO_ID) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") - - /* Close freespace manager */ - if(H5MF_try_close(f, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address") - - /* Set non-persistent freespace manager */ - f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF; - f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF; - f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF; - f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF; - - /* Indicate that the superblock should be marked dirty */ - mark_dirty = TRUE; - } /* end if */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(fid, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Check if we should mark the superblock dirty */ - if(mark_dirty) - /* Mark superblock as dirty */ - if(H5F_super_dirty(f) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") - } /* end if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") + /* Call the internal routine */ + if(H5F__format_convert(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCONVERT, FAIL, "unable to convert file format") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fformat_convert() */ diff --git a/src/H5FA.c b/src/H5FA.c index d421eec..61aaa53 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -62,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); /*********************/ @@ -118,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 */ @@ -135,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 */ @@ -159,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() */ @@ -183,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 */ @@ -199,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 */ @@ -212,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() */ @@ -233,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 */ @@ -245,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 */ @@ -254,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() */ @@ -335,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 */ @@ -357,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 */ @@ -365,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 */ @@ -397,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 */ @@ -406,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 */ @@ -421,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() */ @@ -443,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 */ @@ -468,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 */ @@ -508,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 */ @@ -518,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() */ @@ -540,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 */ @@ -591,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 */ @@ -605,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 { @@ -640,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 */ @@ -652,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 */ @@ -663,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 */ @@ -671,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() */ @@ -694,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; @@ -716,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 */ @@ -749,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 */ @@ -774,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 */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 19fdb74..1f199e9 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -88,7 +88,7 @@ static herr_t H5FA__cache_dblock_serialize(const H5F_t *f, void *image, size_t l void *thing); static herr_t H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5FA__cache_dblock_free_icr(void *thing); -static herr_t H5FA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size); +static herr_t H5FA__cache_dblock_fsf_size(const void *thing, hsize_t *fsf_size); static herr_t H5FA__cache_dblk_page_get_initial_load_size(void *udata, size_t *image_len); static htri_t H5FA__cache_dblk_page_verify_chksum(const void *image_ptr, size_t len, void *udata_ptr); @@ -975,7 +975,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_free_icr() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5FA__cache_dblock_fsf_size(const void *_thing, size_t *fsf_size)) +H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)) const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index 7444eae..b578cf2 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -91,7 +91,7 @@ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t obj_addr)) /* Local variables */ @@ -108,14 +108,13 @@ H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(cls); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Print opening message */ @@ -148,7 +147,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 && 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(PKG) /* end H5FA__hdr_debug() */ @@ -169,7 +168,7 @@ END_FUNC(PKG) /* end H5FA__hdr_debug() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr)) /* Local variables */ @@ -189,18 +188,17 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde HDassert(H5F_addr_defined(obj_addr)); /* Check for debugging context callback available */ - if(cls->crt_dbg_ctx) { + if(cls->crt_dbg_ctx) /* Create debugging context */ - if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, dxpl_id, obj_addr))) + if(NULL == (dbg_ctx = cls->crt_dbg_ctx(f, obj_addr))) H5E_THROW(H5E_CANTGET, "unable to create fixed array debugging context") - } /* end if */ /* Load the fixed array header */ - if(NULL == (hdr = H5FA__hdr_protect(f, dxpl_id, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5FA__hdr_protect(f, hdr_addr, dbg_ctx, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load fixed array header") /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)addr) /* Print opening message */ @@ -244,7 +242,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde if(((page_idx + 1) == dblock->npages) && (nelmts_left = hdr->cparam.nelmts % dblock->dblk_page_nelmts)) dblk_page_nelmts = (size_t)nelmts_left; - 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) HDfprintf(stream, "%*sElements in page %Zu:\n", indent, "", page_idx); @@ -253,7 +251,7 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde if((hdr->cparam.cls->debug)(stream, (indent + 3), MAX(0, (fwidth - 3)), (hsize_t)u, ((uint8_t *)dblk_page->elmts) + (hdr->cparam.cls->nat_elmt_size * u)) < 0) H5E_THROW(H5E_CANTGET, "can't get element for debugging") } /* end for */ - if(H5FA__dblk_page_unprotect(dblk_page, dxpl_id, H5AC__NO_FLAGS_SET) < 0) + if(H5FA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block page") /* Advance to next page address */ @@ -274,9 +272,9 @@ H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int inde CATCH if(dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) H5E_THROW(H5E_CANTRELEASE, "unable to release fixed array debugging context") - 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(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(PKG) /* end H5FA__dblock_debug() */ diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index baf4286..effdeb2 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -147,7 +147,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_alloc() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, size_t nelmts)) +H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts)) /* Local variables */ H5FA_dblk_page_t *dblk_page = NULL; /* Fixed array data block page */ @@ -176,13 +176,13 @@ HDfprintf(stderr, "%s: dblk_page->size = %Zu\n", FUNC, dblk_page->size); H5E_THROW(H5E_CANTSET, "can't set fixed array data block page elements to class's fill value") /* Cache the new fixed array data block page */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block page to cache") inserted = TRUE; /* Add data block page as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -218,7 +218,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_create() */ */ BEGIN_FUNC(PKG, ERR, H5FA_dblk_page_t *, NULL, NULL, -H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_page_addr, +H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags)) /* Local variables */ @@ -242,13 +242,13 @@ HDfprintf(stderr, "%s: Called\n", FUNC); udata.dblk_page_addr = dblk_page_addr; /* Protect the data block page */ - if(NULL == (dblk_page = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) + if(NULL == (dblk_page = (H5FA_dblk_page_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block page, address = %llu", (unsigned long long)dblk_page_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblk_page->top_proxy) { /* Add data block page as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblk_page) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblk_page) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblk_page->top_proxy = hdr->top_proxy; } /* end if */ @@ -261,7 +261,7 @@ CATCH /* Clean up on error */ if(!ret_value) { /* Release the data block page, if it was protected */ - if(dblk_page && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) + if(dblk_page && H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu", (unsigned long long)dblk_page->addr) } /* end if */ @@ -283,8 +283,7 @@ END_FUNC(PKG) /* end H5FA__dblk_page_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, hid_t dxpl_id, - unsigned cache_flags)) +H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags)) /* Local variables */ @@ -296,7 +295,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(dblk_page); /* Unprotect the data block page */ - if(H5AC_unprotect(dblk_page->hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) + if(H5AC_unprotect(dblk_page->hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block page, address = %llu", (unsigned long long)dblk_page->addr) CATCH diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 432bf58..a6a8ced 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -184,7 +184,7 @@ 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)) +H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Fixed array data block */ @@ -203,7 +203,7 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) hdr->stats.dblk_size = dblock->size = H5FA_DBLOCK_SIZE(dblock); /* Allocate space for the data block on disk */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FARRAY_DBLOCK, (hsize_t)dblock->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for fixed array data block") dblock->addr = dblock_addr; @@ -214,13 +214,13 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty)) H5E_THROW(H5E_CANTSET, "can't set fixed array data block elements to class's fill value") /* Cache the new fixed array data block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FARRAY_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array data block to cache") inserted = TRUE; /* Add data block as child of 'top' proxy */ if(hdr->top_proxy) { - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -241,7 +241,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array data block from cache") /* Release data block's disk space */ - if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dxpl_id, dblock->addr, (hsize_t)dblock->size) < 0) + if(H5F_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to release fixed array data block") /* Destroy data block */ @@ -266,8 +266,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, - unsigned flags)) +H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags)) /* Local variables */ H5FA_dblock_t *dblock; /* Fixed array data block */ @@ -285,13 +284,13 @@ H5FA__dblock_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr, udata.dblk_addr = dblk_addr; /* Protect the data block */ - if(NULL == (dblock = (H5FA_dblock_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags))) + if(NULL == (dblock = (H5FA_dblock_t *)H5AC_protect(hdr->f, H5AC_FARRAY_DBLOCK, dblk_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Create top proxy, if it doesn't exist */ if(hdr->top_proxy && NULL == dblock->top_proxy) { /* Add data block as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dxpl_id, dblock) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, hdr->f, dblock) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") dblock->top_proxy = hdr->top_proxy; } /* end if */ @@ -304,7 +303,7 @@ CATCH /* Clean up on error */ if(!ret_value) /* Release the data block, if it was protected */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu", (unsigned long long)dblock->addr) END_FUNC(PKG) /* end H5FA__dblock_protect() */ @@ -324,7 +323,7 @@ END_FUNC(PKG) /* end H5FA__dblock_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flags)) +H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags)) /* Local variables */ @@ -332,7 +331,7 @@ H5FA__dblock_unprotect(H5FA_dblock_t *dblock, hid_t dxpl_id, unsigned cache_flag HDassert(dblock); /* Unprotect the data block */ - if(H5AC_unprotect(dblock->hdr->f, dxpl_id, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(dblock->hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to unprotect fixed array data block, address = %llu", (unsigned long long)dblock->addr) CATCH @@ -354,7 +353,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)) +H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr)) /* Local variables */ H5FA_dblock_t *dblock = NULL; /* Pointer to data block */ @@ -364,7 +363,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) HDassert(H5F_addr_defined(dblk_addr)); /* Protect data block */ - if(NULL == (dblock = H5FA__dblock_protect(hdr, dxpl_id, dblk_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5FA__dblock_protect(hdr, dblk_addr, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array data block, address = %llu", (unsigned long long)dblk_addr) /* Check if data block is paged */ @@ -379,7 +378,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) for(u = 0; u < dblock->npages; u++) { /* Evict the data block page from the metadata cache */ /* (OK to call if it doesn't exist in the cache) */ - if(H5AC_expunge_entry(hdr->f, dxpl_id, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page_addr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTEXPUNGE, "unable to remove array data block page from metadata cache") /* Advance to next page address */ @@ -390,7 +389,7 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, hid_t dxpl_id, haddr_t dblk_addr)) CATCH /* Finished deleting data block in metadata cache */ - if(dblock && H5FA__dblock_unprotect(dblock, dxpl_id, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(dblock && H5FA__dblock_unprotect(dblock, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array data block") END_FUNC(PKG) /* end H5FA__dblock_delete() */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 6809f02..2e3db0b 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -178,8 +178,7 @@ END_FUNC(PKG) /* end H5FA__hdr_init() */ */ BEGIN_FUNC(PKG, ERR, haddr_t, HADDR_UNDEF, HADDR_UNDEF, -H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, - void *ctx_udata)) +H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata)) /* Local variables */ H5FA_hdr_t *hdr = NULL; /* Fixed array header */ @@ -215,7 +214,7 @@ H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_FARRAY_HDR, dxpl_id, (hsize_t)hdr->size))) + if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_FARRAY_HDR, (hsize_t)hdr->size))) H5E_THROW(H5E_CANTALLOC, "file allocation failed for Fixed Array header") /* Create 'top' proxy for extensible array entries */ @@ -224,13 +223,13 @@ H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy") /* Cache the new Fixed Array header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FARRAY_HDR, hdr->addr, hdr, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTINSERT, "can't add fixed array header to cache") inserted = TRUE; /* Add header as child of 'top' proxy */ if(hdr->top_proxy) - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") /* Set address of array header to return */ @@ -246,7 +245,7 @@ CATCH H5E_THROW(H5E_CANTREMOVE, "unable to remove fixed array header from cache") /* Release header's disk space */ - if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, dxpl_id, hdr->addr, (hsize_t)hdr->size) < 0) + if(H5F_addr_defined(hdr->addr) && H5MF_xfree(f, H5FD_MEM_FARRAY_HDR, hdr->addr, (hsize_t)hdr->size) < 0) H5E_THROW(H5E_CANTFREE, "unable to free Fixed Array header") /* Destroy header */ @@ -421,8 +420,7 @@ END_FUNC(PKG) /* end H5FA__hdr_modified() */ */ 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, - unsigned flags)) +H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, unsigned flags)) /* Local variables */ H5FA_hdr_t *hdr; /* Fixed array header */ @@ -441,7 +439,7 @@ H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, udata.ctx_udata = ctx_udata; /* Protect the header */ - if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, dxpl_id, H5AC_FARRAY_HDR, fa_addr, &udata, flags))) + if(NULL == (hdr = (H5FA_hdr_t *)H5AC_protect(f, H5AC_FARRAY_HDR, fa_addr, &udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to protect fixed array header, address = %llu", (unsigned long long)fa_addr) hdr->f = f; /* (Must be set again here, in case the header was already in the cache -QAK) */ @@ -452,7 +450,7 @@ H5FA__hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata, H5E_THROW(H5E_CANTCREATE, "can't create fixed array entry proxy") /* Add header as child of 'top' proxy */ - if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, dxpl_id, hdr) < 0) + if(H5AC_proxy_entry_add_child(hdr->top_proxy, f, hdr) < 0) H5E_THROW(H5E_CANTSET, "unable to add fixed array entry as child of array proxy") } /* end if */ @@ -479,7 +477,7 @@ END_FUNC(PKG) /* end H5FA__hdr_protect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) +H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags)) /* Local variables */ @@ -487,7 +485,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, hid_t dxpl_id, unsigned cache_flags)) HDassert(hdr); /* Unprotect the header */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, 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 @@ -509,7 +507,7 @@ END_FUNC(PKG) /* end H5EA__hdr_unprotect() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) +H5FA__hdr_delete(H5FA_hdr_t *hdr)) /* Local variables */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting header */ @@ -535,7 +533,7 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) /* Check for Fixed Array Data block */ if(H5F_addr_defined(hdr->dblk_addr)) { /* Delete Fixed Array Data block */ - if(H5FA__dblock_delete(hdr, dxpl_id, hdr->dblk_addr) < 0) + if(H5FA__dblock_delete(hdr, hdr->dblk_addr) < 0) H5E_THROW(H5E_CANTDELETE, "unable to delete fixed array data block") } /* end if */ @@ -545,7 +543,7 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr, hid_t dxpl_id)) CATCH /* Unprotect the header, deleting it if an error hasn't occurred */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release fixed array header") END_FUNC(PKG) /* end H5FA__hdr_delete() */ diff --git a/src/H5FApkg.h b/src/H5FApkg.h index 6f0a43a..720c046 100644 --- a/src/H5FApkg.h +++ b/src/H5FApkg.h @@ -267,7 +267,7 @@ H5_DLL herr_t H5FA__destroy_flush_depend(H5AC_info_t *parent_entry, /* Header routines */ H5_DLL H5FA_hdr_t *H5FA__hdr_alloc(H5F_t *f); H5_DLL herr_t H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata); -H5_DLL haddr_t H5FA__hdr_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, void *ctx_udata); +H5_DLL haddr_t H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata); H5_DLL void *H5FA__hdr_alloc_elmts(H5FA_hdr_t *hdr, size_t nelmts); H5_DLL herr_t H5FA__hdr_free_elmts(H5FA_hdr_t *hdr, size_t nelmts, void *elmts); H5_DLL herr_t H5FA__hdr_incr(H5FA_hdr_t *hdr); @@ -275,40 +275,35 @@ 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, unsigned flags); -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 H5FA_hdr_t *H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, + unsigned flags); +H5_DLL herr_t H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags); +H5_DLL herr_t H5FA__hdr_delete(H5FA_hdr_t *hdr); 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); -H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, hid_t dxpl_id, hbool_t *hdr_dirty); +H5_DLL haddr_t H5FA__dblock_create(H5FA_hdr_t *hdr, 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, unsigned flags); -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); +H5_DLL H5FA_dblock_t *H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, + unsigned flags); +H5_DLL herr_t H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags); +H5_DLL herr_t H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr); H5_DLL herr_t H5FA__dblock_dest(H5FA_dblock_t *dblock); /* Data block page routines */ -H5_DLL herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t addr, size_t nelmts); +H5_DLL herr_t H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts); H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts); -H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_protect(H5FA_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblk_page_addr, size_t dblk_page_nelmts, unsigned flags); -H5_DLL herr_t H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, - hid_t dxpl_id, unsigned cache_flags); +H5_DLL H5FA_dblk_page_t *H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, + size_t dblk_page_nelmts, unsigned flags); +H5_DLL herr_t H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags); H5_DLL herr_t H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5FA__hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, haddr_t obj_addr); -H5_DLL herr_t H5FA__dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, const H5FA_class_t *cls, - haddr_t hdr_addr, haddr_t obj_addr); +H5_DLL herr_t H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, const H5FA_class_t *cls, haddr_t obj_addr); +H5_DLL herr_t H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, + int indent, int fwidth, const H5FA_class_t *cls, haddr_t hdr_addr, haddr_t obj_addr); /* Testing routines */ #ifdef H5FA_TESTING diff --git a/src/H5FAprivate.h b/src/H5FAprivate.h index 1e44126..98a9af4 100644 --- a/src/H5FAprivate.h +++ b/src/H5FAprivate.h @@ -70,7 +70,7 @@ typedef struct H5FA_class_t { herr_t (*encode)(void *raw, const void *elmt, size_t nelmts, void *ctx); /* Encode elements from native form to disk storage form */ herr_t (*decode)(const void *raw, void *elmt, size_t nelmts, void *ctx); /* Decode elements from disk storage form to native form */ herr_t (*debug)(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); /* Print an element for debugging */ - void *(*crt_dbg_ctx)(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr); /* Create debugging context */ + void *(*crt_dbg_ctx)(H5F_t *f, haddr_t obj_addr); /* Create debugging context */ herr_t (*dst_dbg_ctx)(void *dbg_ctx); /* Destroy debugging context */ } H5FA_class_t; @@ -118,17 +118,17 @@ H5_DLLVAR const H5FA_class_t H5FA_CLS_FILT_CHUNK[1]; /***************************************/ /* General routines */ -H5_DLL H5FA_t *H5FA_create(H5F_t *f, hid_t dxpl_id, const H5FA_create_t *cparam, +H5_DLL H5FA_t *H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata); -H5_DLL H5FA_t *H5FA_open(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata); +H5_DLL H5FA_t *H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata); H5_DLL herr_t H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts); H5_DLL herr_t H5FA_get_addr(const H5FA_t *fa, haddr_t *addr); -H5_DLL herr_t H5FA_set(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, const void *elmt); -H5_DLL herr_t H5FA_get(const H5FA_t *fa, hid_t dxpl_id, hsize_t idx, void *elmt); -H5_DLL herr_t H5FA_depend(H5FA_t *fa, hid_t dxpl_id, H5AC_proxy_entry_t *parent); -H5_DLL herr_t H5FA_iterate(H5FA_t *fa, hid_t dxpl_id, H5FA_operator_t op, void *udata); -H5_DLL herr_t H5FA_close(H5FA_t *fa, hid_t dxpl_id); -H5_DLL herr_t H5FA_delete(H5F_t *f, hid_t dxpl_id, haddr_t fa_addr, void *ctx_udata); +H5_DLL herr_t H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt); +H5_DLL herr_t H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt); +H5_DLL herr_t H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent); +H5_DLL herr_t H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata); +H5_DLL herr_t H5FA_close(H5FA_t *fa); +H5_DLL herr_t H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata); H5_DLL herr_t H5FA_patch_file(H5FA_t *fa, H5F_t *f); /* Statistics routines */ diff --git a/src/H5FAtest.c b/src/H5FAtest.c index 3c6d8e4..4b03036 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -76,8 +76,7 @@ static herr_t H5FA__test_decode(const void *raw, void *elmt, size_t nelmts, void *ctx); static herr_t H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void *elmt); -static void *H5FA__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, - haddr_t obj_addr); +static void *H5FA__test_crt_dbg_context(H5F_t *f, haddr_t obj_addr); /*********************/ @@ -341,7 +340,7 @@ END_FUNC(STATIC) /* end H5FA__test_debug() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED obj_addr)) +H5FA__test_crt_dbg_context(H5F_t H5_ATTR_UNUSED *f, haddr_t H5_ATTR_UNUSED obj_addr)) /* Local variables */ H5FA__test_ctx_t *ctx; /* Context for callbacks */ diff --git a/src/H5FD.c b/src/H5FD.c index 405e2d8..41111f5 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -31,6 +31,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ @@ -1023,6 +1024,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ haddr_t ret_value = HADDR_UNDEF; FUNC_ENTER_API(HADDR_UNDEF) @@ -1040,15 +1042,23 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, HADDR_UNDEF, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(HADDR_UNDEF == (ret_value = H5FD_alloc_real(file, dxpl_id, type, size, NULL, NULL))) + if(HADDR_UNDEF == (ret_value = H5FD__alloc_real(file, type, size, NULL, NULL))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory") /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, HADDR_UNDEF, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDalloc() */ @@ -1072,6 +1082,7 @@ done: herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1087,13 +1098,21 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_free_real(file, dxpl_id, type, addr - file->base_addr, size) < 0) + if(H5FD_free_real(file, type, addr - file->base_addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDfree() */ @@ -1359,7 +1378,7 @@ herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - H5FD_io_info_t fdio_info; /* File driver I/O object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1378,27 +1397,21 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") - /* Set up the file driver I/O info object */ - fdio_info.file = file; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_read(&fdio_info, type, addr - file->base_addr, size, buf) < 0) + if(H5FD_read(file, type, addr - file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDread() */ @@ -1421,7 +1434,7 @@ herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { - H5FD_io_info_t fdio_info; /* File driver I/O object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1439,27 +1452,21 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz if(!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") - /* Set up the file driver I/O info object */ - fdio_info.file = file; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* The real work */ /* (Note compensating for base address addition in internal routine) */ - if(H5FD_write(&fdio_info, type, addr - file->base_addr, size, buf) < 0) + if(H5FD_write(file, type, addr - file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5FDwrite() */ @@ -1482,6 +1489,7 @@ done: herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1495,14 +1503,22 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(H5FD_flush(file, dxpl_id, closing) < 0) + if(H5FD_flush(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "file flush request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5FDflush() */ /*------------------------------------------------------------------------- @@ -1516,15 +1532,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_flush(H5FD_t *file, hid_t dxpl_id, hbool_t closing) +H5FD_flush(H5FD_t *file, hbool_t closing) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(file && file->cls); - if(file->cls->flush && (file->cls->flush)(file, dxpl_id, closing) < 0) + if(file->cls->flush && (file->cls->flush)(file, H5CX_get_dxpl(), closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed") done: @@ -1545,6 +1562,7 @@ done: herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1558,14 +1576,22 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Do the real work */ - if(H5FD_truncate(file, dxpl_id, closing) < 0) + if(H5FD_truncate(file, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "file flush request failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_VFL, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5FDtruncate() */ /*------------------------------------------------------------------------- @@ -1579,15 +1605,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_truncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing) +H5FD_truncate(H5FD_t *file, hbool_t closing) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(file && file->cls); - if(file->cls->truncate && (file->cls->truncate)(file, dxpl_id, closing) < 0) + /* Dispatch to driver */ + if(file->cls->truncate && (file->cls->truncate)(file, H5CX_get_dxpl(), closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "driver truncate request failed") done: diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 98ece84..aacc5c0 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -1265,7 +1265,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; @@ -1274,7 +1274,7 @@ H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) - if(file->memb[u] && H5FD_flush(file->memb[u], dxpl_id, closing) < 0) + if(file->memb[u] && H5FD_flush(file->memb[u], closing) < 0) nerrors++; if(nerrors) @@ -1300,7 +1300,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) +H5FD_family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { H5FD_family_t *file = (H5FD_family_t*)_file; unsigned u, nerrors = 0; @@ -1309,7 +1309,7 @@ H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) - if(file->memb[u] && H5FD_truncate(file->memb[u], dxpl_id, closing) < 0) + if(file->memb[u] && H5FD_truncate(file->memb[u], closing) < 0) nerrors++; if(nerrors) diff --git a/src/H5FDint.c b/src/H5FDint.c index 52fbc23..023ff57 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ @@ -91,9 +92,8 @@ *------------------------------------------------------------------------- */ herr_t -H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) +H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) { - H5FD_t *file; haddr_t addr, eoa, eof; uint8_t buf[H5F_SIGNATURE_LEN]; unsigned n, maxpow; @@ -101,8 +101,7 @@ H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) FUNC_ENTER_NOAPI_NOINIT - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file); /* Find the least N such that 2^N is larger than the file size */ @@ -123,7 +122,7 @@ H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr) addr = (8 == n) ? 0 : (haddr_t)1 << n; if(H5FD_set_eoa(file, H5FD_MEM_SUPER, addr + H5F_SIGNATURE_LEN) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to set EOA value for file signature") - if(H5FD_read(fdio_info, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0) + if(H5FD_read(file, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to read file signature") if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) break; @@ -161,47 +160,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, - size_t size, void *buf/*out*/) +H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/) { - H5FD_t *file; - H5P_genplist_t *io_dxpl; - haddr_t eoa = HADDR_UNDEF; - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id; /* DXPL for operation */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file && file->cls); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->meta_dxpl), H5P_CLS_DATASET_XFER_g)); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->raw_dxpl), H5P_CLS_DATASET_XFER_g)); HDassert(buf); - /* Set up proper DXPL for I/O */ - if(H5FD_MEM_DRAW == type) - io_dxpl = fdio_info->raw_dxpl; - else - io_dxpl = fdio_info->meta_dxpl; - - /* Sanity check the dxpl type against the mem type */ -#ifdef H5_DEBUG_BUILD - { - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - - /* get the dxpl type */ - if(H5P_get(io_dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type") - - /* we shouldn't be here if the dxpl is labeled with NO I/O */ - HDassert(H5FD_NOIO_DXPL != dxpl_type); - - if(H5FD_MEM_DRAW == type) - HDassert(H5FD_RAWDATA_DXPL == dxpl_type); - else - HDassert(H5FD_METADATA_DXPL == dxpl_type); - } -#endif /* H5_DEBUG_BUILD */ + /* Get proper DXPL for I/O */ + dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ @@ -211,9 +183,6 @@ H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ - if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") - /* * If the file is open for SWMR read access, allow access to data past * the end of the allocated space (the 'eoa'). This is done because the @@ -221,11 +190,18 @@ H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, * objects being written within the file by the application performing * SWMR write operations. */ - if(!(file->access_flags & H5F_ACC_SWMR_READ) && ((addr + file->base_addr + size) > eoa)) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu, eoa = %llu", (unsigned long long)(addr + file->base_addr), (unsigned long long)size, (unsigned long long)eoa) + if(!(file->access_flags & H5F_ACC_SWMR_READ)) { + haddr_t eoa; + + if(HADDR_UNDEF == (eoa = (file->cls->get_eoa)(file, type))) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver get_eoa request failed") + + if((addr + file->base_addr + size) > eoa) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu, eoa = %llu", (unsigned long long)(addr + file->base_addr), (unsigned long long)size, (unsigned long long)eoa) + } /* end if */ /* Dispatch to driver */ - if((file->cls->read)(file, type, H5P_PLIST_ID(io_dxpl), addr + file->base_addr, size, buf) < 0) + if((file->cls->read)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") done: @@ -247,47 +223,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, - size_t size, const void *buf) +H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf) { - H5FD_t *file; - H5P_genplist_t *io_dxpl; - haddr_t eoa = HADDR_UNDEF; - herr_t ret_value = SUCCEED; /* Return value */ + hid_t dxpl_id; /* DXPL for operation */ + haddr_t eoa = HADDR_UNDEF; /* EOA for file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fdio_info); - file = fdio_info->file; + /* Sanity checks */ HDassert(file && file->cls); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->meta_dxpl), H5P_CLS_DATASET_XFER_g)); - HDassert(TRUE == H5P_class_isa(H5P_CLASS(fdio_info->raw_dxpl), H5P_CLS_DATASET_XFER_g)); HDassert(buf); - /* Set up proper DXPL for I/O */ - if(H5FD_MEM_DRAW == type) - io_dxpl = fdio_info->raw_dxpl; - else - io_dxpl = fdio_info->meta_dxpl; - - /* Sanity check the dxpl type against the mem type */ -#ifdef H5_DEBUG_BUILD - { - H5FD_dxpl_type_t dxpl_type; /* Property indicating the type of the internal dxpl */ - - /* get the dxpl type */ - if(H5P_get(io_dxpl, H5FD_DXPL_TYPE_NAME, &dxpl_type) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't retrieve dxpl type") - - /* we shouldn't be here if the dxpl is labeled with NO I/O */ - HDassert(H5FD_NOIO_DXPL != dxpl_type); - - if(H5FD_MEM_DRAW == type) - HDassert(H5FD_RAWDATA_DXPL == dxpl_type); - else - HDassert(H5FD_METADATA_DXPL == dxpl_type); - } -#endif /* H5_DEBUG_BUILD */ + /* Get proper DXPL for I/O */ + dxpl_id = H5CX_get_dxpl(); #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ @@ -304,7 +254,7 @@ H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, haddr_t addr, (unsigned long long)(addr+ file->base_addr), (unsigned long long)size, (unsigned long long)eoa) /* Dispatch to driver */ - if((file->cls->write)(file, type, H5P_PLIST_ID(io_dxpl), addr + file->base_addr, size, buf) < 0) + if((file->cls->write)(file, type, dxpl_id, addr + file->base_addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") done: diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 98e1b1a..4b42a73 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -21,6 +21,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ @@ -175,9 +176,8 @@ H5FD_get_mpi_info(H5FD_t *file, void** mpi_info) HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */ /* Dispatch to driver */ - if ((ret_value=(cls->get_mpi_info)(file, mpi_info)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, \ - "driver get_mpi_info request failed") + if((ret_value = (cls->get_mpi_info)(file, mpi_info)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_mpi_info request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -480,44 +480,5 @@ done: FUNC_LEAVE_NOAPI(ret_value) } #endif /* NOT_YET */ - - -/*------------------------------------------------------------------------- - * Function: H5FD_mpi_setup_collective - * - * Purpose: Set the buffer type BTYPE, file type FTYPE for a data - * transfer. Also request a MPI type transfer. - * - * Return: Success: 0 - * Failure: -1 - * - * Programmer: Robb Matzke - * Monday, August 9, 1999 - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, MPI_Datatype *ftype) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") - - /* Set buffer MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, btype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") - - /* Set File MPI type */ - if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, ftype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mpi_setup_collective() */ - #endif /* H5_HAVE_PARALLEL */ + diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f594d8e..0801b17 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -23,6 +23,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -1410,8 +1411,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, haddr_t addr, size_t size, - void *buf/*out*/) +H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, + hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; MPI_Offset mpi_off; @@ -1430,7 +1431,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had int io_size; /* Actual number of bytes requested */ int n; #endif - H5P_genplist_t *plist = NULL; /* Property list pointer */ hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; @@ -1442,9 +1442,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had #endif HDassert(file); HDassert(H5FD_MPIO==file->pub.driver_id); - /* Make certain we have the correct type of property list */ - HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); HDassert(buf); /* Portably initialize MPI status variable */ @@ -1467,13 +1464,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had if(type == H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ - /* Obtain the data transfer properties */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Get the transfer mode from the API context */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1487,11 +1480,9 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had /* Remember that views are used */ use_view_this_time = TRUE; - /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") + /* Prepare for a full-blown xfer using btype, ftype, and disp */ + if(H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O datatypes") /* * Set the file view when we are using MPI derived types @@ -1508,18 +1499,15 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t dxpl_id, had /* Read the data. */ if(use_view_this_time) { - H5FD_mpio_collective_opt_t coll_opt_mode; + H5FD_mpio_collective_opt_t coll_opt_mode; #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_read: using MPIO collective mode\n"); #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ - HDassert(plist); - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") + if(H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG @@ -1710,8 +1698,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *buf) +H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, + haddr_t addr, size_t size, const void *buf) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; MPI_Offset mpi_off; @@ -1729,7 +1717,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif int size_i; hbool_t use_view_this_time = FALSE; - H5P_genplist_t *plist = NULL; /* Property list pointer */ H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ herr_t ret_value = SUCCEED; @@ -1741,9 +1728,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif HDassert(file); HDassert(H5FD_MPIO==file->pub.driver_id); - /* Make certain we have the correct type of property list */ - HDassert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); - HDassert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); HDassert(buf); /* Portably initialize MPI status variable */ @@ -1761,13 +1745,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, fprintf(stdout, "in H5FD_mpio_write mpi_off=%ld size_i=%d\n", (long)mpi_off, size_i); #endif - /* Obtain the data transfer properties */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") + /* Get the transfer mode from the API context */ + if(H5CX_get_io_xfer_mode(&xfer_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1781,11 +1761,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Remember that views are used */ use_view_this_time = TRUE; - /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") + /* Prepare for a full-blown xfer using btype, ftype, and disp */ + if(H5CX_get_mpi_coll_datatypes(&buf_type, &file_type) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O datatypes") /* * Set the file view when we are using MPI derived types @@ -1809,10 +1787,8 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, #endif /* Get the collective_opt property to check whether the application wants to do IO individually. */ - HDassert(plist); - /* get the transfer mode from the dxpl */ - if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") + if(H5CX_get_mpio_coll_opt(&coll_opt_mode) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG diff --git a/src/H5FDpkg.h b/src/H5FDpkg.h index 31dcf8d..6f47efb 100644 --- a/src/H5FDpkg.h +++ b/src/H5FDpkg.h @@ -50,10 +50,10 @@ /******************************/ /* Package Private Prototypes */ /******************************/ -H5_DLL haddr_t H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, - hsize_t size, haddr_t *align_addr, hsize_t *align_size); -H5_DLL herr_t H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, - haddr_t addr, hsize_t size); +H5_DLL haddr_t H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, + haddr_t *align_addr, hsize_t *align_size); +H5_DLL herr_t H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + hsize_t size); /* Testing functions */ #ifdef H5FD_TESTING diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index e758951..0430064 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -103,30 +103,6 @@ typedef struct H5FD_mpio_fapl_t { } H5FD_mpio_fapl_t; #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_DEBUG_BUILD -/* Definitions for the internal DXPL types created in H5AC__init_package() */ -typedef enum { - H5FD_METADATA_DXPL = 0, - H5FD_NOIO_DXPL, - H5FD_RAWDATA_DXPL -} H5FD_dxpl_type_t; - -#define H5FD_DXPL_TYPE_NAME "H5P_dxpl_type" -#endif /* H5_DEBUG_BUILD */ - -/* I/O Info for an operation */ -typedef struct H5FD_io_info_t { - H5FD_t *file; /* File driver object */ -#ifndef H5_DEBUG_BUILD - const -#endif /* H5_DEBUG_BUILD */ - H5P_genplist_t *meta_dxpl; /* Metadata DXPL object */ -#ifndef H5_DEBUG_BUILD - const -#endif /* H5_DEBUG_BUILD */ - H5P_genplist_t *raw_dxpl; /* Raw data DXPL object */ -} H5FD_io_info_t; - /*****************************/ /* Library Private Variables */ @@ -141,7 +117,7 @@ typedef struct H5FD_io_info_t { struct H5F_t; H5_DLL int H5FD_term_interface(void); -H5_DLL herr_t H5FD_locate_signature(H5FD_io_info_t *fdio_info, haddr_t *sig_addr); +H5_DLL herr_t H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr); H5_DLL H5FD_class_t *H5FD_get_class(hid_t id); H5_DLL hsize_t H5FD_sb_size(H5FD_t *file); H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf); @@ -154,12 +130,12 @@ H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); -H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, +H5_DLL haddr_t H5FD_alloc(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); -H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, +H5_DLL herr_t H5FD_free(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t addr, hsize_t size); H5_DLL htri_t H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, - hid_t dxpl_id, haddr_t blk_end, hsize_t extra_requested); + haddr_t blk_end, hsize_t extra_requested); H5_DLL haddr_t H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr); H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type); @@ -167,12 +143,12 @@ H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); H5_DLL herr_t H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); -H5_DLL herr_t H5FD_read(H5FD_io_info_t *fdio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf/*out*/); -H5_DLL herr_t H5FD_write(const H5FD_io_info_t *fdio_info, H5FD_mem_t type, - haddr_t addr, size_t size, const void *buf); -H5_DLL herr_t H5FD_flush(H5FD_t *file, hid_t dxpl_id, hbool_t closing); -H5_DLL herr_t H5FD_truncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); +H5_DLL herr_t H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf/*out*/); +H5_DLL herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); +H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing); +H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing); H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw); H5_DLL herr_t H5FD_unlock(H5FD_t *file); H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum); @@ -193,8 +169,6 @@ H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info); H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); #endif /* NOT_YET */ -H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, - MPI_Datatype *ftype); H5_DLL herr_t H5FD_set_mpio_atomicity(H5FD_t *file, hbool_t flag); H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 0af755f..e158a44 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ @@ -131,7 +132,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_alloc_real + * Function: H5FD__alloc_real * * Purpose: Allocate space in the file with the VFD * Note: the handling of alignment is moved up from each driver to @@ -146,8 +147,8 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, - haddr_t *frag_addr, hsize_t *frag_size) +H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr, + hsize_t *frag_size) { hsize_t orig_size = size; /* Original allocation size */ haddr_t eoa; /* Address of end-of-allocated space */ @@ -156,7 +157,7 @@ H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, hbool_t use_alloc_size; /* Just pass alloc size to the driver */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI(HADDR_UNDEF) + FUNC_ENTER_PACKAGE #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); #endif /* H5FD_ALLOC_DEBUG */ @@ -196,7 +197,7 @@ HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); /* For the multi/split driver: the size passed down to the alloc callback is the original size from H5FD_alloc() */ /* For all other drivers: the size passed down to the alloc callback is the size + [possibly] alignment size */ if(file->cls->alloc) { - ret_value = (file->cls->alloc)(file, type, dxpl_id, use_alloc_size ? size : size + extra); + ret_value = (file->cls->alloc)(file, type, H5CX_get_dxpl(), use_alloc_size ? size : size + extra); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed") } /* end if */ @@ -222,7 +223,7 @@ done: HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); #endif /* H5FD_ALLOC_DEBUG */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_alloc_real() */ +} /* end H5FD__alloc_real() */ /*------------------------------------------------------------------------- @@ -244,7 +245,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ haddr_t -H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, +H5FD_alloc(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { haddr_t ret_value = HADDR_UNDEF; /* Return value */ @@ -258,12 +259,12 @@ H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, HDassert(size > 0); /* Call the real 'alloc' routine */ - ret_value = H5FD_alloc_real(file, dxpl_id, type, size, frag_addr, frag_size); + ret_value = H5FD__alloc_real(file, type, size, frag_addr, frag_size); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "real 'alloc' request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, HADDR_UNDEF, "unable to mark EOA info as dirty") done: @@ -285,7 +286,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) +H5FD_free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -317,7 +318,7 @@ HDfprintf(stderr, "%s: type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)type #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: Letting VFD free space\n", FUNC); #endif /* H5FD_ALLOC_DEBUG */ - if((file->cls->free)(file, type, dxpl_id, addr, size) < 0) + if((file->cls->free)(file, type, H5CX_get_dxpl(), addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "driver free request failed") } /* end if */ /* Check if this free block is at the end of file allocated space. @@ -369,8 +370,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, - haddr_t addr, hsize_t size) +H5FD_free(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -383,11 +383,11 @@ H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, HDassert(size > 0); /* Call the real 'free' routine */ - if(H5FD_free_real(file, dxpl_id, type, addr, size) < 0) + if(H5FD_free_real(file, type, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "real 'free' request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA info as dirty") done: @@ -414,8 +414,8 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hid_t dxpl_id, - haddr_t blk_end, hsize_t extra_requested) +H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, + hsize_t extra_requested) { haddr_t eoa; /* End of allocated space in file */ htri_t ret_value = FALSE; /* Return value */ @@ -443,7 +443,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_VFL, H5E_CANTEXTEND, FAIL, "driver extend request failed") /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA info as dirty") /* Indicate success */ diff --git a/src/H5FO.c b/src/H5FO.c index 627ee64..7bbf7fa 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -208,7 +208,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) +H5FO_delete(H5F_t *f, haddr_t addr) { H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value=SUCCEED; /* Return value */ @@ -227,7 +227,7 @@ H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Check if the object was deleted from the file */ if(open_obj->deleted) { - if(H5O_delete(f, dxpl_id, addr) < 0) + if(H5O_delete(f, addr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") } /* end if */ diff --git a/src/H5FOprivate.h b/src/H5FOprivate.h index aa85c29..49e8126 100644 --- a/src/H5FOprivate.h +++ b/src/H5FOprivate.h @@ -37,7 +37,7 @@ typedef H5SL_t H5FO_t; /* Currently, all open objects are stored in skip l H5_DLL herr_t H5FO_create(const H5F_t *f); H5_DLL void *H5FO_opened(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag); -H5_DLL herr_t H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); +H5_DLL herr_t H5FO_delete(H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted); H5_DLL hbool_t H5FO_marked(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5FO_dest(const H5F_t *f); diff --git a/src/H5FS.c b/src/H5FS.c index b789dfd..ec2dc11 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -101,7 +101,7 @@ H5FL_DEFINE(H5FS_t); *------------------------------------------------------------------------- */ H5FS_t * -H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, +H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ @@ -138,11 +138,11 @@ HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, ncl /* Check if the free space tracker is supposed to be persistant */ if(fs_addr) { /* Allocate space for the free space header */ - if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size))) + if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, (hsize_t)fspace->hdr_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't add free space header to cache") /* Return free space header address to caller, if desired */ @@ -184,7 +184,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ H5FS_t * -H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, uint16_t nclasses, +H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ @@ -209,7 +209,7 @@ HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\ cache_udata.addr = fs_addr; /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, NULL, "unable to load free space header") #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: fspace->sect_addr = %a\n", FUNC, fspace->sect_addr); @@ -228,7 +228,7 @@ HDfprintf(stderr, "%s: fspace->rc = %u\n", FUNC, fspace->rc); fspace->align_thres = threshold; /* Unlock free space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, NULL, "unable to release free space header") /* Set return value */ @@ -252,7 +252,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr) +H5FS_delete(H5F_t *f, haddr_t fs_addr) { H5FS_t *fspace = NULL; /* Free space header loaded from file */ H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */ @@ -320,7 +320,7 @@ HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_ad #endif /* H5FS_DEBUG */ /* Protect the free space header */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space header") /* Sanity check */ @@ -361,7 +361,7 @@ HDfprintf(stderr, "%s: Expunging free space section info from cache\n", FUNC); if (!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; - if(H5AC_expunge_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, cache_flags) < 0) + if(H5AC_expunge_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove free space section info from cache") } /* end block */ @@ -374,15 +374,14 @@ HDfprintf(stderr, "%s: Done expunging free space section info from cache\n", FUN HDfprintf(stderr, "%s: Deleting free space section info from file\n", FUNC); #endif /* H5FS_DEBUG */ /* Release the space in the file */ - if(!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_addr, fspace->alloc_sect_size) < 0) + if(!H5F_IS_TMP_ADDR(f, fspace->sect_addr)) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_addr, fspace->alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to release free space sections") - } /* end if */ } /* end else */ } /* end if */ done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -403,7 +402,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace) +H5FS_close(H5F_t *f, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ @@ -441,7 +440,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") } /* end if */ else { - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") } /* end if */ fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -456,7 +455,7 @@ HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC); HDassert(H5F_addr_defined(fspace->sect_addr)); /* Cache the free space section info */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") } /* end if */ else { @@ -498,7 +497,7 @@ HDfprintf(stderr, "%s: Section info in temp. address space went 'go away'\n", FU HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") } /* end if */ else { - if((status = H5MF_try_shrink(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_addr, fspace->alloc_sect_size)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_addr, fspace->alloc_sect_size)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for absorbing section info") else if(status == FALSE) { /* Section info can't "go away", but it's free. Allow @@ -539,7 +538,7 @@ HDfprintf(stderr, "%s: Section info is NOT for file free space\n", FUNC); /* Free previous serialized sections disk space */ if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, old_sect_addr, old_alloc_sect_size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, old_sect_addr, old_alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space sections") } /* end if */ } /* end else */ @@ -819,7 +818,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id) +H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -831,11 +830,11 @@ H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id) if(!H5F_addr_defined(fspace->addr)) { /* Allocate space for the free space header */ - if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)H5FS_HEADER_SIZE(f)))) + if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, (hsize_t)H5FS_HEADER_SIZE(f)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space header to cache") } /* end if */ @@ -860,7 +859,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) +H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ @@ -871,7 +870,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) HDassert(fspace); if(!H5F_addr_defined(fspace->sect_addr) && fspace->sinfo && fspace->serial_sect_count > 0) { - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for section info") fspace->alloc_sect_size = fspace->sect_size; @@ -880,7 +879,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty") /* Cache the free-space section info */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") /* Since space has been allocated for the section info and the sinfo @@ -908,7 +907,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) +H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space) { haddr_t saved_addr; /* Previous address of item */ unsigned cache_flags; /* Flags for unprotecting cache entries */ @@ -937,13 +936,12 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Protect the free space sections */ 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__READ_ONLY_FLAG))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unload and release ownership of the free-space manager section info */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") } /* end if */ @@ -956,7 +954,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Free space for the free-space manager section info */ if(!H5F_IS_TMP_ADDR(f, saved_addr)) { if(free_file_space && - H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, saved_addr, saved_size) < 0) + H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, saved_addr, saved_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to release free space sections") } /* end if */ @@ -982,7 +980,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) cache_udata.nclasses = 0; cache_udata.classes = NULL; cache_udata.cls_init_udata = NULL; - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fspace->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space section info") /* Unpin the free-space manager header */ @@ -990,7 +988,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") /* Unload and release ownership of the free-space header */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fspace->addr, fspace, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") } /* end if */ @@ -999,7 +997,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, hbool_t free_file_space) /* Free space for the free-space manager header */ if(free_file_space && - H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, dxpl_id, saved_addr, (hsize_t)H5FS_HEADER_SIZE(f)) < 0) + H5MF_xfree(f, H5FD_MEM_FSPACE_HDR, saved_addr, (hsize_t)H5FS_HEADER_SIZE(f)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space header") } /* end if */ @@ -1193,7 +1191,7 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) #ifdef H5FS_DEBUG_ASSERT /*------------------------------------------------------------------------- - * Function: H5FS_assert + * Function: H5FS__assert * * Purpose: Verify that the free space manager is mostly sane * @@ -1205,17 +1203,17 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) *------------------------------------------------------------------------- */ herr_t -H5FS_assert(const H5FS_t *fspace, hid_t dxpl_id) +H5FS__assert(const H5FS_t *fspace) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR #ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->tot_sect_count); +HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__assert", fspace->tot_sect_count); #endif /* QAK */ /* Checks for section info, if it's available */ if(fspace->sinfo) { /* Sanity check sections */ - H5FS_sect_assert(fspace, dxpl_id); + H5FS__sect_assert(fspace); /* General assumptions about the section size counts */ HDassert(fspace->sinfo->tot_size_count >= fspace->sinfo->serial_size_count); @@ -1231,6 +1229,6 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->t #endif /* QAK */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FS_assert() */ +} /* end H5FS__assert() */ #endif /* H5FS_DEBUG_ASSERT */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 628fba0..875a383 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -82,9 +82,8 @@ static htri_t H5FS__cache_hdr_verify_chksum(const void *image_ptr, size_t len, v static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); -static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *thing); @@ -95,9 +94,8 @@ static htri_t H5FS__cache_sinfo_verify_chksum(const void *image_ptr, size_t len, static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len); -static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *thing); @@ -404,12 +402,11 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, +H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -432,9 +429,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, if(H5AC_get_entry_ring(f, addr, &ring) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "unable to get property value"); - /* Set the ring type for the section info in the DXPL */ - if(H5AC_set_ring(dxpl_id, ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type for the section info in the API context */ + H5AC_set_ring(ring, &orig_ring); /* This implies that the header "owns" the section info. * @@ -524,7 +520,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* allocate file space for the section info, and insert it * into the metadata cache. */ - if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -532,10 +528,10 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Get the tag for this free space manager and use it to insert the entry */ if(H5AC_get_tag((const void *)fspace, &tag) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTTAG, FAIL, "can't get tag for metadata cache object") - H5_BEGIN_TAG(dxpl_id, tag, FAIL) - if(H5AC_insert_entry((H5F_t *)f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + H5_BEGIN_TAG(tag) + if(H5AC_insert_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR_TAG(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") - H5_END_TAG(FAIL) + H5_END_TAG HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); @@ -559,14 +555,14 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move section info") fspace->sect_addr = new_sect_addr; @@ -621,7 +617,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert((sect_status & H5AC_ES__IS_PINNED) == 0); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (new_sect_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -630,7 +626,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(!H5F_addr_eq(fspace->sect_addr, new_sect_addr)); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") /* Update the internal address for the section info */ @@ -651,9 +647,9 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, *flags = 0; done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FS__cache_hdr_pre_serialize() */ @@ -989,7 +985,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* initialize old_sect_size */ - H5_CHECKED_ASSIGN(old_sect_size, size_t, udata->fspace->sect_size, hsize_t); + H5_CHECKED_ASSIGN(old_sect_size, size_t, fspace->sect_size, hsize_t); /* Magic number */ if(HDmemcmp(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) @@ -1002,7 +998,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, /* Address of free space header for these sections */ H5F_addr_decode(udata->f, &image, &fs_addr); - if(H5F_addr_ne(fs_addr, udata->fspace->addr)) + if(H5F_addr_ne(fs_addr, fspace->addr)) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, NULL, "incorrect header address for free space sections") /* Check for any serialized sections */ @@ -1014,7 +1010,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ - sect_cnt_size = H5VM_limit_enc_size((uint64_t)udata->fspace->serial_sect_count); + sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); /* Reset the section count, the "add" routine will update it */ old_tot_sect_count = fspace->tot_sect_count; @@ -1055,16 +1051,16 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, /* Call 'deserialize' callback for this section */ des_flags = 0; - HDassert(udata->fspace->sect_cls[sect_type].deserialize); - if(NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize) (&fspace->sect_cls[sect_type], udata->dxpl_id, image, sect_addr, sect_size, &des_flags))) + HDassert(fspace->sect_cls[sect_type].deserialize); + if(NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize) (&fspace->sect_cls[sect_type], image, sect_addr, sect_size, &des_flags))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDECODE, NULL, "can't deserialize section") /* Update offset in serialization image */ - image += udata->fspace->sect_cls[sect_type].serial_size; + image += fspace->sect_cls[sect_type].serial_size; /* Insert section in free space manager, unless requested not to */ if(!(des_flags & H5FS_DESERIALIZE_NO_ADD)) - if(H5FS_sect_add(udata->f, udata->dxpl_id, udata->fspace, new_sect, H5FS_ADD_DESERIALIZING, udata) < 0) + if(H5FS_sect_add(udata->f, fspace, new_sect, H5FS_ADD_DESERIALIZING, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, NULL, "can't add section to free space manager") } /* end for */ } while(image < (((const uint8_t *)_image + old_sect_size) - H5FS_SIZEOF_CHKSUM)); @@ -1154,8 +1150,8 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, - haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) +H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ H5FS_t *fspace; /* Free space header */ @@ -1193,7 +1189,7 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(H5F_addr_eq(fspace->sect_addr, addr)); /* Allocate space for the section info in file */ - if(HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, dxpl_id, fspace->sect_size))) + if(HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; @@ -1202,7 +1198,7 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, HDassert(!H5F_addr_eq(sinfo->fspace->sect_addr, sinfo_addr)); /* Let the metadata cache know the section info moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMOVE, FAIL, "unable to move section info") /* Update the internal address for the section info */ diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 450216b..c615b68 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -89,7 +89,7 @@ *------------------------------------------------------------------------- */ herr_t -H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5FS_t *fspace = NULL; /* Free space header info */ H5FS_hdr_cache_ud_t cache_udata; /* User-data for cache callback */ @@ -116,7 +116,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Print opening message */ @@ -167,7 +167,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fspace->alloc_sect_size); done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) @@ -225,7 +225,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, +H5FS_sects_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent, int fwidth, haddr_t fs_addr, haddr_t client_addr) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -256,7 +256,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str /* * Load the free space header. */ - if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (fspace = (H5FS_t *)H5AC_protect(f, H5AC_FSPACE_HDR, fs_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "unable to load free space header") /* Retrieve the client id */ @@ -266,7 +266,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str /* (set the "deleted" flag for the unprotect, so the cache entry is removed * and reloaded later, with the correct client information -QAK) */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") fspace = NULL; @@ -278,12 +278,12 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str */ switch(client) { case H5FS_CLIENT_FHEAP_ID: - if(H5HF_sects_debug(f, dxpl_id, client_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5HF_sects_debug(f, client_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_SYSTEM, FAIL, "unable to dump fractal heap free space sections") break; case H5FS_CLIENT_FILE_ID: - if(H5MF_sects_debug(f, dxpl_id, fs_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5MF_sects_debug(f, fs_addr, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_SYSTEM, FAIL, "unable to dump file free space sections") break; @@ -294,7 +294,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t H5_ATTR_UNUSED addr, FILE *str } /* end switch */ done: - if(fspace && H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) + if(fspace && H5AC_unprotect(f, H5AC_FSPACE_HDR, fs_addr, fspace, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FSPACE, H5E_PROTECT, FAIL, "unable to release free space header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index df1d92f..23e1212 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -104,7 +104,6 @@ typedef struct H5FS_hdr_cache_ud_t { typedef struct H5FS_sinfo_cache_ud_t { H5F_t *f; /* File that free space section info is within */ H5FS_t *fspace; /* free space manager */ - hid_t dxpl_id; } H5FS_sinfo_cache_ud_t; /* Free space section bin info */ @@ -237,8 +236,8 @@ H5_DLL herr_t H5FS_sinfo_dest(H5FS_sinfo_t *sinfo); /* Sanity check routines */ #ifdef H5FS_DEBUG -H5_DLL herr_t H5FS_assert(const H5FS_t *fspace, hid_t dxpl_id); -H5_DLL herr_t H5FS_sect_assert(const H5FS_t *fspace, hid_t dxpl_id); +H5_DLL herr_t H5FS__assert(const H5FS_t *fspace); +H5_DLL herr_t H5FS__sect_assert(const H5FS_t *fspace); #endif /* H5FS_DEBUG */ /* Testing routines */ diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index 247d75c..de1b4c1 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -104,13 +104,13 @@ typedef struct H5FS_section_class_t { /* Object methods */ herr_t (*add)(H5FS_section_info_t **, unsigned *, void *); /* Routine called when section is about to be added to manager */ herr_t (*serialize)(const struct H5FS_section_class_t *, const H5FS_section_info_t *, uint8_t *); /* Routine to serialize a "live" section into a buffer */ - H5FS_section_info_t *(*deserialize)(const struct H5FS_section_class_t *, hid_t dxpl_id, const uint8_t *, haddr_t, hsize_t, unsigned *); /* Routine to deserialize a buffer into a "live" section */ + H5FS_section_info_t *(*deserialize)(const struct H5FS_section_class_t *, const uint8_t *, haddr_t, hsize_t, unsigned *); /* Routine to deserialize a buffer into a "live" section */ htri_t (*can_merge)(const H5FS_section_info_t *, const H5FS_section_info_t *, void *); /* Routine to determine if two nodes are mergable */ herr_t (*merge)(H5FS_section_info_t **, H5FS_section_info_t *, void *); /* Routine to merge two nodes */ htri_t (*can_shrink)(const H5FS_section_info_t *, void *); /* Routine to determine if node can shrink container */ herr_t (*shrink)(H5FS_section_info_t **, void *); /* Routine to shrink container */ herr_t (*free)(H5FS_section_info_t *); /* Routine to free node */ - herr_t (*valid)(const struct H5FS_section_class_t *, const H5FS_section_info_t *, hid_t dxpl_id); /* Routine to check if a section is valid */ + herr_t (*valid)(const struct H5FS_section_class_t *, const H5FS_section_info_t *); /* Routine to check if a section is valid */ H5FS_section_info_t *(*split)(H5FS_section_info_t *, hsize_t); /* Routine to create the split section */ herr_t (*debug)(const H5FS_section_info_t *, FILE *, int , int ); /* Routine to dump debugging information about a section */ } H5FS_section_class_t; @@ -179,36 +179,35 @@ H5FL_SEQ_EXTERN(H5FS_section_class_t); H5_DLL herr_t H5FS_init(void); /* Free space manager routines */ -H5_DLL H5FS_t *H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, - const H5FS_create_t *fs_create, uint16_t nclasses, - const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); -H5_DLL H5FS_t *H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, - uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); +H5_DLL H5FS_t *H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, + uint16_t nclasses, const H5FS_section_class_t *classes[], + void *cls_init_udata, hsize_t alignment, hsize_t threshold); +H5_DLL H5FS_t *H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, + const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, + hsize_t threshold); H5_DLL herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size); -H5_DLL herr_t H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr); -H5_DLL herr_t H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace); -H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id); -H5_DLL herr_t H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id); -H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id, - hbool_t free_file_space); +H5_DLL herr_t H5FS_delete(H5F_t *f, haddr_t fs_addr); +H5_DLL herr_t H5FS_close(H5F_t *f, H5FS_t *fspace); +H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr); +H5_DLL herr_t H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace); +H5_DLL herr_t H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space); /* Free space section routines */ -H5_DLL herr_t H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *node, unsigned flags, void *op_data); -H5_DLL htri_t H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL herr_t H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node, + unsigned flags, void *op_data); +H5_DLL htri_t H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data); -H5_DLL htri_t H5FS_sect_try_extend(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - haddr_t addr, hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data); -H5_DLL herr_t H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *node); -H5_DLL htri_t H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - hsize_t request, H5FS_section_info_t **node); -H5_DLL herr_t H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, void *op_data); +H5_DLL htri_t H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, + hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data); +H5_DLL herr_t H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *node); +H5_DLL htri_t H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, + H5FS_section_info_t **node); +H5_DLL herr_t H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data); H5_DLL herr_t H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects); -H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint16_t new_class); -H5_DLL htri_t H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, +H5_DLL htri_t H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data); /* Statistics routine */ @@ -216,16 +215,14 @@ H5_DLL herr_t H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *st H5_DLL herr_t H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count); /* free space manager settling routines */ -H5_DLL herr_t H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, - hid_t dxpl_id, - H5FS_t *fspace, - haddr_t *fs_addr_ptr); +H5_DLL herr_t H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, + haddr_t *fs_addr_ptr); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth, haddr_t fs_addr, haddr_t client_addr); +H5_DLL herr_t H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); +H5_DLL herr_t H5FS_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, haddr_t fs_addr, haddr_t client_addr); H5_DLL herr_t H5FS_sect_debug(const H5FS_t *fspace, const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 8f911a4..f0d9f47 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -204,7 +204,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, unsigned accmode) +H5FS_sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) { H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -236,14 +236,13 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" /* Check if we need to switch from read-only access to read-write */ if(0 == (accmode & (unsigned)(~H5AC__READ_ONLY_FLAG))) { /* Unprotect the read-only section info */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") /* Re-protect the section info with read-write access */ 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__NO_FLAGS_SET))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to load free space sections") /* Switch the access mode we have */ @@ -263,9 +262,8 @@ HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %a\n", #endif /* H5FS_SINFO_DEBUG */ /* Protect the free space sections */ 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))) + if(NULL == (fspace->sinfo = (H5FS_sinfo_t *)H5AC_protect(f, 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 */ @@ -317,7 +315,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" *------------------------------------------------------------------------- */ static herr_t -H5FS_sinfo_unlock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t modified) +H5FS_sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) { herr_t ret_value = SUCCEED; /* Return value */ @@ -386,7 +384,7 @@ HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n" #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Unprotecting section info, cache_flags = %u\n", FUNC, cache_flags); #endif /* H5FS_SINFO_DEBUG */ - if(H5AC_unprotect(f, dxpl_id, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, cache_flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTUNPROTECT, FAIL, "unable to release free space section info") /* Reset the protected flag on the section info */ @@ -451,10 +449,9 @@ HDfprintf(stderr, "%s: Relinquishing section info ownership\n", FUNC); HDfprintf(stderr, "%s: Freeing section info on disk, old_sect_addr = %a, old_alloc_sect_size = %Hu\n", FUNC, old_sect_addr, old_alloc_sect_size); #endif /* H5FS_SINFO_DEBUG */ /* Release space for section info in file */ - if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) { - if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, dxpl_id, old_sect_addr, old_alloc_sect_size) < 0) + if(!H5F_IS_TMP_ADDR(f, old_sect_addr)) + if(H5MF_xfree(f, H5FD_MEM_FSPACE_SINFO, old_sect_addr, old_alloc_sect_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to free free space sections") - } /* end if */ } /* end if */ } /* end if */ @@ -897,8 +894,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect) +H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ @@ -911,7 +907,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(sect); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -921,7 +917,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, TRUE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1362,8 +1358,8 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ herr_t -H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect, - unsigned flags, void *op_data) +H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, + void *op_data) { H5FS_section_class_t *cls; /* Section's class */ hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1383,16 +1379,15 @@ HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->siz HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; /* Call "add" section class callback, if there is one */ cls = &fspace->sect_cls[sect->type]; - if(cls->add) { + if(cls->add) if((*cls->add)(§, &flags, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "'add' section class callback failed") - } /* end if */ /* Check for merging returned space with existing section node */ if(flags & H5FS_ADD_RETURNED_SPACE) { @@ -1423,12 +1418,12 @@ HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT if(!(flags & (H5FS_ADD_DESERIALIZING | H5FS_ADD_SKIP_VALID))) - H5FS_assert(fspace, dxpl_id); + H5FS__assert(fspace); #endif /* H5FS_DEBUG_ASSERT */ #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); @@ -1450,7 +1445,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_extend(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, haddr_t addr, +H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize_t extra_requested, unsigned flags, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1480,7 +1475,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se H5FS_section_info_t *sect; /* Temporary free space section */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1566,7 +1561,7 @@ if(_section_) done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1588,7 +1583,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect, +H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1606,7 +1601,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t HDassert(sect->size); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; saved_fs_size = sect->size; @@ -1632,7 +1627,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -1802,8 +1797,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, - H5FS_section_info_t **node) +H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ @@ -1829,7 +1823,7 @@ HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_se #endif /* QAK */ if(fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1849,11 +1843,11 @@ HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, sinfo_modified) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, sinfo_modified) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") #ifdef H5FS_DEBUG_ASSERT - H5FS_assert(fspace, dxpl_id); + H5FS__assert(fspace); #endif /* H5FS_DEBUG_ASSERT */ FUNC_LEAVE_NOAPI(ret_value) } /* H5FS_sect_find() */ @@ -1945,7 +1939,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, void *op_data) +H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) { H5FS_iter_ud_t udata; /* User data for callbacks */ hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ @@ -1971,7 +1965,7 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_c unsigned bin; /* Current bin we are on */ /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__READ_ONLY_FLAG) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -1991,7 +1985,7 @@ HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, FALSE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, FALSE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2042,8 +2036,8 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) *------------------------------------------------------------------------- */ herr_t -H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect, uint16_t new_class) +H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, + uint16_t new_class) { const H5FS_section_class_t *old_cls; /* Old class of section */ const H5FS_section_class_t *new_cls; /* New class of section */ @@ -2060,7 +2054,7 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, HDassert(new_class < fspace->nclasses); /* Get a pointer to the section info */ - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2190,7 +2184,7 @@ HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, TRUE) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, TRUE) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2199,7 +2193,7 @@ done: #ifdef H5FS_DEBUG_ASSERT /*------------------------------------------------------------------------- - * Function: H5FS_sect_assert + * Function: H5FS__sect_assert * * Purpose: Verify that the sections managed are mostly sane * @@ -2211,13 +2205,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_sect_assert(const H5FS_t *fspace, hid_t dxpl_id) +H5FS__sect_assert(const H5FS_t *fspace) { hsize_t separate_obj; /* The number of separate objects managed */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR #ifdef QAK -HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count); +HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS__sect_assert", fspace->tot_sect_count); #endif /* QAK */ /* Initialize state */ @@ -2276,14 +2270,14 @@ HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspa sect = H5SL_item(curr_sect_node); cls = &fspace->sect_cls[sect->type]; #ifdef QAK -HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS_assert", sect->size, sect->addr, sect->type); +HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H5FS__sect_assert", sect->size, sect->addr, sect->type); #endif /* QAK */ /* Sanity check section */ HDassert(H5F_addr_defined(sect->addr)); HDassert(fspace_node->sect_size == sect->size); if(cls->valid) - (*cls->valid)(cls, sect, dxpl_id); + (*cls->valid)(cls, sect); /* Add to correct count */ if(cls->flags & H5FS_CLS_GHOST_OBJ) @@ -2344,7 +2338,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H HDassert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list))); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FS_sect_assert() */ +} /* end H5FS__sect_assert() */ #endif /* H5FS_DEBUG_ASSERT */ @@ -2362,7 +2356,7 @@ HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", "H *------------------------------------------------------------------------- */ htri_t -H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) +H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) { hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ hbool_t section_removed = FALSE; /* Whether a section was removed */ @@ -2373,7 +2367,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) /* Check arguments. */ HDassert(fspace); - if(H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC__NO_FLAGS_SET) < 0) + if(H5FS_sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") sinfo_valid = TRUE; @@ -2411,7 +2405,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, void *op_data) done: /* Release the section info */ - if(sinfo_valid && H5FS_sinfo_unlock(f, dxpl_id, fspace, section_removed) < 0) + if(sinfo_valid && H5FS_sinfo_unlock(f, fspace, section_removed) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't release section info") FUNC_LEAVE_NOAPI(ret_value) @@ -2509,8 +2503,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, - H5FS_t *fspace, haddr_t *fs_addr_ptr) +H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, + haddr_t *fs_addr_ptr) { hsize_t hdr_alloc_size; hsize_t sinfo_alloc_size; @@ -2578,11 +2572,8 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, } /* end if */ /* allocate space for the hdr */ - if(HADDR_UNDEF == (fspace->addr = H5FD_alloc(f->shared->lf, dxpl_id, - H5FD_MEM_FSPACE_HDR, f, - hdr_alloc_size, - &eoa_frag_addr, - &eoa_frag_size))) + if(HADDR_UNDEF == (fspace->addr = H5FD_alloc(f->shared->lf, H5FD_MEM_FSPACE_HDR, + f, hdr_alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate file space for hdr") /* if the file alignement is 1, there should be no @@ -2591,7 +2582,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, HDassert((eoa_frag_size == 0) || (f->shared->alignment != 1)); /* Cache the new free space header (pinned) */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space header to cache") *fs_addr_ptr = fspace->addr; @@ -2621,11 +2612,8 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, } /* end if */ /* allocate space for the section info */ - if(HADDR_UNDEF == (sect_addr = H5FD_alloc(f->shared->lf, dxpl_id, - H5FD_MEM_FSPACE_SINFO, f, - sinfo_alloc_size, - &eoa_frag_addr, - &eoa_frag_size))) + if(HADDR_UNDEF == (sect_addr = H5FD_alloc(f->shared->lf, H5FD_MEM_FSPACE_SINFO, + f, sinfo_alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, FAIL, "can't allocate file space") /* if the file alignement is 1, there should be no @@ -2662,7 +2650,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, hid_t dxpl_id, * * JRM -- 11/4/16 */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_SINFO, sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FSPACE_SINFO, sect_addr, fspace->sinfo, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sinfo to cache") /* We have changed the sinfo address -- Mark free space header dirty */ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index e84cfda..0b33f8e 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -110,31 +110,27 @@ H5FL_BLK_DEFINE_STATIC(meta_accum); *------------------------------------------------------------------------- */ herr_t -H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr, +H5F__accum_read(H5F_t *f, H5FD_mem_t map_type, haddr_t addr, size_t size, void *buf/*out*/) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_t *file; /* File driver pointer */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); HDassert(buf); /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Check if this information is in the metadata accumulator */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ @@ -183,7 +179,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add accum->dirty_off += amount_before; /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, addr, amount_before, accum->buf) < 0) + if(H5FD_read(file, map_type, addr, amount_before, accum->buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ else @@ -197,7 +193,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)), hsize_t); /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0) + if(H5FD_read(file, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ @@ -211,13 +207,13 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add /* Current read doesn't overlap with metadata accumulator, read it from file */ else { /* Dispatch to driver */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ } /* end if */ else { /* Read the data */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") /* Check for overlap w/dirty accumulator */ @@ -260,7 +256,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add } /* end if */ else { /* Read the data */ - if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_read(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ @@ -283,7 +279,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, +H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adjust, size_t size) { herr_t ret_value = SUCCEED; /* Return value */ @@ -291,7 +287,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, FUNC_ENTER_STATIC HDassert(accum); - HDassert(fdio_info); + HDassert(file); HDassert(H5F_ACCUM_APPEND == adjust || H5F_ACCUM_PREPEND == adjust); HDassert(size > 0); HDassert(size <= H5F_ACCUM_MAX_SIZE); @@ -349,7 +345,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, /* Check if the dirty region overlaps the region to eliminate from the accumulator */ if((accum->size - shrink_size) < (accum->dirty_off + accum->dirty_len)) { /* Write out the dirty region from the metadata accumulator, with dispatch to driver */ - if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -360,7 +356,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info, /* Check if the dirty region overlaps the region to eliminate from the accumulator */ if(shrink_size > accum->dirty_off) { /* Write out the dirty region from the metadata accumulator, with dispatch to driver */ - if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -422,32 +418,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr, +H5F__accum_write(H5F_t *f, H5FD_mem_t map_type, haddr_t addr, size_t size, const void *buf) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_t *file; /* File driver pointer */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(H5F_INTENT(fio_info->f) & H5F_ACC_RDWR); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); + HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); HDassert(buf); - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Check for accumulating metadata */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ @@ -458,7 +450,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad /* Check if the new metadata adjoins the beginning of the current accumulator */ if((addr + size) == accum->loc) { /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Move the existing metadata to the proper location */ @@ -483,7 +475,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad /* Check if the new metadata adjoins the end of the current accumulator */ else if(addr == (accum->loc + accum->size)) { /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Copy the new metadata to the end */ @@ -543,7 +535,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad H5_CHECKED_ASSIGN(add_size, size_t, (accum->loc - addr), hsize_t); /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, add_size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, add_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Calculate the proper offset of the existing metadata */ @@ -583,7 +575,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad H5_CHECKED_ASSIGN(add_size, size_t, (addr + size) - (accum->loc + accum->size), hsize_t); /* Check if we need to adjust accumulator size */ - if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, add_size) < 0) + if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, add_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator") /* Compute offset of dirty region (after adjusting accumulator) */ @@ -649,7 +641,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad else { /* Write out the existing metadata accumulator, with dispatch to driver */ if(accum->dirty) { - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Reset accumulator dirty flag */ @@ -739,13 +731,13 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Make certain that data in accumulator is visible before new write */ - if((H5F_INTENT(fio_info->f) & H5F_ACC_SWMR_WRITE) > 0) + if((H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) > 0) /* Flush if dirty and reset accumulator */ - if(H5F__accum_reset(fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") /* Write the data */ - if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_write(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Check for overlap w/accumulator */ @@ -790,7 +782,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Access covers whole accumulator */ /* Reset accumulator, but don't flush */ - if(H5F__accum_reset(fio_info, FALSE) < 0) + if(H5F__accum_reset(f, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") } /* end else */ } /* end if */ @@ -830,7 +822,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad } /* end if */ else { /* Write the data */ - if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0) + if(H5FD_write(file, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end else */ @@ -854,31 +846,26 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr, +H5F__accum_free(H5F_t *f, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr, hsize_t size) { H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + HDassert(f); /* Set up alias for file's metadata accumulator info */ - accum = &fio_info->f->shared->accum; + accum = &f->shared->accum; - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Adjust the metadata accumulator to remove the freed block, if it overlaps */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && H5F_addr_overlap(addr, size, accum->loc, accum->size)) { size_t overlap_size; /* Size of overlap with accumulator */ @@ -949,7 +936,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, /* Check if block to free is entirely before dirty region */ if(H5F_addr_le(tail_addr, dirty_start)) { /* Write out the entire dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ /* Block to free overlaps with some/all of dirty region */ @@ -964,7 +951,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, HDassert(write_size > 0); /* Write out the unfreed dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ @@ -984,7 +971,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, HDassert(write_size > 0); /* Write out the unfreed end of the dirty region of the accumulator */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ @@ -1025,32 +1012,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_flush(const H5F_io_info2_t *fio_info) +H5F__accum_flush(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + /* Sanity checks */ + HDassert(f); /* Check if we need to flush out the metadata accumulator */ - if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && fio_info->f->shared->accum.dirty) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f->shared->accum.dirty) { + H5FD_t *file; /* File driver pointer */ - /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + /* Translate to file driver pointer */ + file = f->shared->lf; /* Flush the metadata contents */ - if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, fio_info->f->shared->accum.loc + fio_info->f->shared->accum.dirty_off, fio_info->f->shared->accum.dirty_len, fio_info->f->shared->accum.buf + fio_info->f->shared->accum.dirty_off) < 0) + if(H5FD_write(file, H5FD_MEM_DEFAULT, f->shared->accum.loc + f->shared->accum.dirty_off, f->shared->accum.dirty_len, f->shared->accum.buf + f->shared->accum.dirty_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Reset the dirty flag */ - fio_info->f->shared->accum.dirty = FALSE; + f->shared->accum.dirty = FALSE; } /* end if */ done: @@ -1072,34 +1055,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__accum_reset(const H5F_io_info2_t *fio_info, hbool_t flush) +H5F__accum_reset(H5F_t *f, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE - HDassert(fio_info); - HDassert(fio_info->f); + /* Sanity checks */ + HDassert(f); /* Flush any dirty data in accumulator, if requested */ if(flush) - if(H5F__accum_flush(fio_info) < 0) + if(H5F__accum_flush(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "can't flush metadata accumulator") /* Check if we need to reset the metadata accumulator information */ - if(fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) { + if(f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) { /* Sanity check */ - HDassert(!fio_info->f->closing || FALSE == fio_info->f->shared->accum.dirty); + HDassert(!f->closing || FALSE == f->shared->accum.dirty); /* Free the buffer */ - if(fio_info->f->shared->accum.buf) - fio_info->f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, fio_info->f->shared->accum.buf); + if(f->shared->accum.buf) + f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, f->shared->accum.buf); /* Reset the buffer sizes & location */ - fio_info->f->shared->accum.alloc_size = fio_info->f->shared->accum.size = 0; - fio_info->f->shared->accum.loc = HADDR_UNDEF; - fio_info->f->shared->accum.dirty = FALSE; - fio_info->f->shared->accum.dirty_len = 0; + f->shared->accum.alloc_size = f->shared->accum.size = 0; + f->shared->accum.loc = HADDR_UNDEF; + f->shared->accum.dirty = FALSE; + f->shared->accum.dirty_len = 0; } /* end if */ done: diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 04b86d2..aa5f8ab 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -159,7 +159,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr) +H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) { unsigned cwfsno; /* Local index for iterating over collections */ hbool_t found = FALSE; /* Flag to indicate a heap with enough space was found */ @@ -210,11 +210,11 @@ H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr) if((H5HG_SIZE(f->shared->cwfs[cwfsno]) + new_need) <= H5HG_MAXSIZE) { htri_t was_extended; /* Whether the heap was extended */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_GHEAP, H5HG_ADDR(f->shared->cwfs[cwfsno]), (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); + was_extended = H5MF_try_extend(f, H5FD_MEM_GHEAP, H5HG_ADDR(f->shared->cwfs[cwfsno]), (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); if(was_extended < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap") else if(was_extended == TRUE) { - if(H5HG_extend(f, dxpl_id, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) + if(H5HG_extend(f, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection") *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); found = TRUE; diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 03f5df8..cbbd16f 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -36,6 +36,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Iprivate.h" /* IDs */ @@ -100,6 +101,8 @@ herr_t H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) { H5F_t *f; /* Top file in mount hierarchy */ + H5F_info2_t finfo2; /* Current file info struct */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -127,19 +130,23 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) } /* end else */ HDassert(f->shared); - /* Reset file info struct */ - HDmemset(finfo, 0, sizeof(*finfo)); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - /* Get the size of the superblock extension */ - if(H5F__super_size(f, H5AC_ind_read_dxpl_id, NULL, &finfo->super_ext_size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve superblock extension size") + /* Get the current file info */ + if(H5F__get_info(f, &finfo2) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve file info") - /* Check for SOHM info */ - if(H5F_addr_defined(f->shared->sohm_addr)) - if(H5SM_ih_size(f, H5AC_ind_read_dxpl_id, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "Unable to retrieve SOHM index & heap storage info") + /* Copy the compatible fields into the older struct */ + finfo->super_ext_size = finfo2.super.super_ext_size; + finfo->sohm.hdr_size = finfo2.sohm.hdr_size; + finfo->sohm.msgs_info = finfo2.sohm.msgs_info; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Fget_info1() */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 5652d15..45b1379 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -57,14 +57,15 @@ struct H5F_efc_t { unsigned nfiles; /* Size of the external file cache */ unsigned max_nfiles; /* Maximum size of the external file cache */ unsigned nrefs; /* Number of times this file appears in another file's EFC */ - int tag; /* Temporary variable used by H5F_efc_try_close() */ - H5F_file_t *tmp_next; /* Next file in temporary list used by H5F_efc_try_close() */ + int tag; /* Temporary variable used by H5F__efc_try_close() */ + H5F_file_t *tmp_next; /* Next file in temporary list used by H5F__efc_try_close() */ }; /* Private prototypes */ -static herr_t H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent); -static void H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail); -static void H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail); +static herr_t H5F__efc_release_real(H5F_efc_t *efc); +static herr_t H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent); +static void H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail); +static void H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail); /* Free lists */ H5FL_DEFINE_STATIC(H5F_efc_ent_t); @@ -76,7 +77,7 @@ H5FL_DEFINE_STATIC(H5F_efc_t); * * Purpose: Allocate and initialize a new external file cache object, * which can the be used to cache open external files. - * the object must be freed with H5F_efc_destroy. + * the object must be freed with H5F__efc_destroy. * * Return: Pointer to new external file cache object on success * NULL on failure @@ -139,7 +140,7 @@ done: */ H5F_t * H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id) + hid_t fapl_id) { H5F_efc_t *efc = NULL; /* External file cache for parent file */ H5F_efc_ent_t *ent = NULL; /* Entry for target file in efc */ @@ -160,7 +161,7 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, * support this so clients do not have to make 2 different calls depending * on the state of the efc. */ if(!efc) { - if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") /* Increment the number of open objects to prevent the file from being @@ -225,14 +226,14 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, /* Evict the file if found, otherwise just open the target file and * do not add it to cache */ if(ent) { - if(H5F_efc_remove_ent(efc, ent) < 0) + if(H5F__efc_remove_ent(efc, ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, NULL, "can't remove entry from external file cache") /* Do not free ent, we will recycle it below */ } /* end if */ else { /* Cannot cache file, just open file and return */ - if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ret_value = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") /* Increment the number of open objects to prevent the file from @@ -253,7 +254,7 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Open the file */ - if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id, dxpl_id))) + if(NULL == (ent->file = H5F_open(name, flags, fcpl_id, fapl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open file") open_file = TRUE; @@ -400,7 +401,7 @@ H5F_efc_max_nfiles(H5F_efc_t *efc) /*------------------------------------------------------------------------- - * Function: H5F_efc_release + * Function: H5F__efc_release_real * * Purpose: Releases the external file cache, potentially closing any * cached files unless they are held open from somewhere @@ -414,14 +415,14 @@ H5F_efc_max_nfiles(H5F_efc_t *efc) * *------------------------------------------------------------------------- */ -herr_t -H5F_efc_release(H5F_efc_t *efc) +static herr_t +H5F__efc_release_real(H5F_efc_t *efc) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_efc_ent_t *prev_ent = NULL; /* Previous EFC entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(efc); @@ -429,7 +430,7 @@ H5F_efc_release(H5F_efc_t *efc) /* Lock the EFC to prevent manipulation of the EFC wile we are releasing it. * The EFC should never be locked when we enter this function because that * would require a cycle, a cycle would necessarily invoke - * H5F_efc_try_close(), and that function checks the status of the lock + * H5F__efc_try_close(), and that function checks the status of the lock * before calling this one. */ HDassert((efc->tag == H5F_EFC_TAG_DEFAULT) || (efc->tag == H5F_EFC_TAG_CLOSE)); @@ -440,7 +441,7 @@ H5F_efc_release(H5F_efc_t *efc) ent = efc->LRU_head; while(ent) if(!ent->nopen) { - if(H5F_efc_remove_ent(efc, ent) < 0) + if(H5F__efc_remove_ent(efc, ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTREMOVE, FAIL, "can't remove entry from external file cache") /* Free the entry and move to next entry in LRU list */ @@ -458,11 +459,45 @@ H5F_efc_release(H5F_efc_t *efc) done: FUNC_LEAVE_NOAPI(ret_value); +} /* end H5F__efc_release_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__efc_release + * + * Purpose: Releases the external file cache, potentially closing any + * cached files unless they are held open from somewhere + * else (or are currently opened by a client). + * + * Return: Non-negative on success + * Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__efc_release(H5F_efc_t *efc) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity checks */ + HDassert(efc); + + /* Call 'real' routine */ + if(H5F__efc_release_real(efc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't remove entry from external file cache") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F_efc_release() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_destroy + * Function: H5F__efc_destroy * * Purpose: Frees an external file cache object, releasing it first * if necessary. If it cannot be fully released, for example @@ -477,18 +512,18 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_efc_destroy(H5F_efc_t *efc) +H5F__efc_destroy(H5F_efc_t *efc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(efc); if(efc->nfiles > 0) { /* Release (clear) the efc */ - if(H5F_efc_release(efc) < 0) + if(H5F__efc_release_real(efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* If there are still cached files, return an error */ @@ -510,11 +545,11 @@ H5F_efc_destroy(H5F_efc_t *efc) done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5F_efc_destroy() */ +} /* end H5F__efc_destroy() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_remove_ent + * Function: H5F__efc_remove_ent * * Purpose: Removes the specified entry from the specified EFC, * closing the file if requested. Does not free the entry. @@ -528,11 +563,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) +H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(efc); @@ -576,11 +611,11 @@ H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_efc_remove_ent() */ +} /* end H5F__efc_remove_ent() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close_tag1 + * Function: H5F__efc_try_close_tag1 * * Purpose: Recursively traverse the EFC tree, keeping a temporary * reference count on each file that assumes all reachable @@ -594,12 +629,12 @@ done: *------------------------------------------------------------------------- */ static void -H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) +H5F__efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(sf); @@ -644,17 +679,17 @@ H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) } /* end if */ /* Recurse into the entry */ - H5F_efc_try_close_tag1(ent->file->shared, tail); + H5F__efc_try_close_tag1(ent->file->shared, tail); } /* end if */ } /* end if */ } /* end for */ FUNC_LEAVE_NOAPI_VOID -} /* end H5F_efc_try_close_tag1() */ +} /* end H5F__efc_try_close_tag1() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close_tag2 + * Function: H5F__efc_try_close_tag2 * * Purpose: Recuresively mark all files reachable through this one as * uncloseable, and add newly uncloseable files to the tail @@ -668,12 +703,12 @@ H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) *------------------------------------------------------------------------- */ static void -H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) +H5F__efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) { H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(sf); @@ -715,17 +750,17 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) } /* end if */ /* Recurse into the entry */ - H5F_efc_try_close_tag2(esf, tail); + H5F__efc_try_close_tag2(esf, tail); } /* end if */ } /* end if */ } /* end for */ FUNC_LEAVE_NOAPI_VOID -} /* end H5F_efc_try_close_tag2() */ +} /* end H5F__efc_try_close_tag2() */ /*------------------------------------------------------------------------- - * Function: H5F_efc_try_close + * Function: H5F__efc_try_close * * Purpose: Attempts to close the provided (shared) file by checking * to see if the releasing the EFC would cause its reference @@ -741,7 +776,7 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) * "callback" for the final pass (the one where the files are * actually closed). The code for the callback case is at * the top of this function; luckily it only consists of a - * (possible) call to H5F_efc_release(). + * (possible) call to H5F__efc_release_real(). * * The algorithm basically consists of 3 passes over the EFC * tree. The first pass assumes that every reachable file is @@ -757,8 +792,8 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) * closeable only because the first pass assumed that an * uncloseable file would be closed. * - * The final pass exploits the H5F_efc_release()-> - * H5F_efc_remove_ent()->H5F_try_close()->H5F_efc_try_close() + * The final pass exploits the H5F__efc_release_real()-> + * H5F_efc_remove_ent()->H5F_try_close()->H5F__efc_try_close() * calling chain to recursively close the tree, but only the * files that are still marked as closeable. All files * marked as closeable have their EFCs released, and will @@ -775,7 +810,7 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) *------------------------------------------------------------------------- */ herr_t -H5F_efc_try_close(H5F_t *f) +H5F__efc_try_close(H5F_t *f) { H5F_file_t *tail; /* Tail of linked list of found files. Head will be f->shared. */ H5F_file_t *uncloseable_head = NULL; /* Head of linked list of files found to be uncloseable by the first pass */ @@ -798,8 +833,8 @@ H5F_efc_try_close(H5F_t *f) /* We must have reentered this function, and we should close this file. * In actuality, we just release the EFC, the recursion should * eventually reduce this file's reference count to 1 (though possibly - * not from this call to H5F_efc_release()). */ - if(H5F_efc_release(f->shared->efc) < 0) + * not from this call to H5F__efc_release_real()). */ + if(H5F__efc_release_real(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* If we marked the file as closeable, there must be no open files in @@ -816,7 +851,7 @@ H5F_efc_try_close(H5F_t *f) /* Conditions where we should not do anything and just return immediately */ /* If there are references that are not from an EFC or f, it will never * be possible to close the file. Just return. Note that this holds true - * for the case that this file is being closed through H5F_efc_release() + * for the case that this file is being closed through H5F__efc_release_real() * because that function (through H5F_efc_remove_ent()) decrements the EFC * reference count before it calls H5F_try_close(). This may occur if this * function is reentered. */ @@ -851,7 +886,7 @@ H5F_efc_try_close(H5F_t *f) * field to keep track of final reference count for each file (including * this one). Keep list of files with starting reference count > 1 (head is * f->shared). */ - H5F_efc_try_close_tag1(f->shared, &tail); + H5F__efc_try_close_tag1(f->shared, &tail); /* Check if f->shared->efc->tag dropped to 0. If it did not, * we cannot close anything. Just reset temporary values and return. */ @@ -909,7 +944,7 @@ H5F_efc_try_close(H5F_t *f) tail = uncloseable_tail; HDassert(tail); while(sf != tail->efc->tmp_next) { - H5F_efc_try_close_tag2(sf, &uncloseable_tail); + H5F__efc_try_close_tag2(sf, &uncloseable_tail); sf = sf->efc->tmp_next; } /* end while */ } /* end if */ @@ -918,7 +953,7 @@ H5F_efc_try_close(H5F_t *f) * should start the recursive release that should close all closeable files. * Also, see the top of this function. */ if(f->shared->efc->tag == H5F_EFC_TAG_CLOSE) { - if(H5F_efc_release(f->shared->efc) < 0) + if(H5F__efc_release_real(f->shared->efc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release external file cache") /* Make sure the file's reference count is now 1 and will be closed by @@ -941,5 +976,5 @@ H5F_efc_try_close(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_efc_try_close() */ +} /* end H5F__efc_try_close() */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0eb1ea9..203d720 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -74,8 +74,8 @@ typedef struct H5F_olist_t { static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *name, char ** /*out*/ actual_name);/* Declare a free list to manage the H5F_t struct */ -static herr_t H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id); -static herr_t H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); +static herr_t H5F__flush_phase1(H5F_t *f); +static herr_t H5F__flush_phase2(H5F_t *f, hbool_t closing); /*********************/ @@ -494,28 +494,20 @@ done: *------------------------------------------------------------------------- */ htri_t -H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F__is_hdf5(const char *name) { H5FD_t *file = NULL; /* Low-level file struct */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ haddr_t sig_addr; /* Addess of hdf5 file signature */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Open the file at the virtual file layer */ if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF))) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") - - /* Set up the file driver info */ - fdio_info.file = file; - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object") + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file") /* The file is an hdf5 file if the hdf5 file signature can be found */ - if(H5FD_locate_signature(&fdio_info, &sig_addr) < 0) + if(H5FD_locate_signature(file, &sig_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") ret_value = (HADDR_UNDEF != sig_addr); @@ -525,7 +517,7 @@ done: if(H5FD_close(file) < 0 && ret_value >= 0) HDONE_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F__is_hdf5() */ @@ -778,7 +770,7 @@ done: if(!shared) { /* Attempt to clean up some of the shared file structures */ if(f->shared->efc) - if(H5F_efc_destroy(f->shared->efc) < 0) + if(H5F__efc_destroy(f->shared->efc) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, NULL, "can't destroy external file cache") if(f->shared->fcpl_id > 0) if(H5I_dec_ref(f->shared->fcpl_id) < 0) @@ -805,7 +797,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) +H5F__dest(H5F_t *f, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ @@ -817,14 +809,13 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) if(1 == f->shared->nrefs) { int actype; /* metadata cache type (enum value) */ - H5F_io_info2_t fio_info; /* I/O info for operation */ /* Flush at this point since the file will be closed (phase 1). * Only try to flush the file if it was opened with write access, and if * the caller requested a flush. */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) - if(H5F__flush_phase1(f, meta_dxpl_id) < 0) + if(H5F__flush_phase1(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 1)") @@ -832,7 +823,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * This allows the cache to set up for creating a metadata cache * image if this has been requested. */ - if(H5AC_prep_for_file_close(f, meta_dxpl_id) < 0) + if(H5AC_prep_for_file_close(f) < 0) /* Push error, but keep going */ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "metadata cache prep for close failed") @@ -841,7 +832,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * the caller requested a flush. */ if((H5F_ACC_RDWR & H5F_INTENT(f)) && flush) - if(H5F__flush_phase2(f, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__flush_phase2(f, TRUE) < 0) /* Push error, but keep going */ HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cached data (phase 2)") @@ -855,7 +846,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) /* Release the external file cache */ if(f->shared->efc) { - if(H5F_efc_destroy(f->shared->efc) < 0) + if(H5F__efc_destroy(f->shared->efc) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't destroy external file cache") f->shared->efc = NULL; @@ -888,7 +879,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * -- JRM */ if(H5F_ACC_RDWR & H5F_INTENT(f)) { - if(H5MF_close(f, meta_dxpl_id) < 0) + if(H5MF_close(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") @@ -906,7 +897,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); /* Mark EOA info dirty in cache, so change will get encoded */ - if(H5F_eoa_dirty(f, meta_dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") @@ -917,12 +908,12 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) * At most, this should change the superblock or the * superblock extension messages. */ - if(H5MF_free_aggrs(f, meta_dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, meta_dxpl_id, TRUE) < 0) + if(H5FD_truncate(f->shared->lf, TRUE) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") @@ -961,19 +952,12 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") /* Shutdown the metadata cache */ - if(H5AC_dest(f, meta_dxpl_id)) + if(H5AC_dest(f)) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Shutdown the page buffer cache */ - if(H5PB_dest(&fio_info) < 0) + if(H5PB_dest(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing page buffer cache") @@ -994,7 +978,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) } /* end if */ /* Destroy other components of the file */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file") if(H5FO_dest(f) < 0) @@ -1049,7 +1033,79 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) f = H5FL_FREE(H5F_t, f); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_dest() */ +} /* end H5F__dest() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__create + * + * Purpose: Internal routine to create a file. + * + * Note: This routine is needed so that there's a non-API routine for + * creating files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new file object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5F__create(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) +{ + H5F_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(filename); + + /* Create a new file or truncate an existing file. */ + if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__create() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__open + * + * Purpose: Internal routine to open a file. + * + * Note: This routine is needed so that there's a non-API routine for + * opening files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new file object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5F__open(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) +{ + H5F_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(filename); + + /* Open the file */ + if(NULL == (ret_value = H5F_open(filename, flags, fcpl_id, fapl_id))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__open() */ /*------------------------------------------------------------------------- @@ -1126,8 +1182,7 @@ H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush) *------------------------------------------------------------------------- */ H5F_t * -H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, - hid_t meta_dxpl_id) +H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { H5F_t *file = NULL; /*the success return value */ H5F_file_t *shared = NULL; /*shared part of `file' */ @@ -1136,7 +1191,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_class_t *drvr; /*file driver class info */ H5P_genplist_t *a_plist; /*file access property list */ H5F_close_degree_t fc_degree; /*file close degree */ - hid_t raw_dxpl_id = H5AC_rawdata_dxpl_id; /* Raw data dxpl used by library */ size_t page_buf_size; unsigned page_buf_min_meta_perc; unsigned page_buf_min_raw_perc; @@ -1334,19 +1388,19 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* Initialize information about the superblock and allocate space for it */ /* (Writes superblock extension messages, if there are any) */ - if(H5F__super_init(file, meta_dxpl_id) < 0) + if(H5F__super_init(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to allocate file superblock") /* Create and open the root group */ /* (This must be after the space for the superblock is allocated in * the file, since the superblock must be at offset 0) */ - if(H5G_mkroot(file, meta_dxpl_id, TRUE) < 0) + if(H5G_mkroot(file, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group") } /* end if */ else if (1 == shared->nrefs) { /* Read the superblock if it hasn't been read before. */ - if(H5F__super_read(file, meta_dxpl_id, raw_dxpl_id, TRUE) < 0) + if(H5F__super_read(file, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") /* Create the page buffer before initializing the superblock */ @@ -1355,7 +1409,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create page buffer") /* Open the root group */ - if(H5G_mkroot(file, meta_dxpl_id, FALSE) < 0) + if(H5G_mkroot(file, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group") } /* end if */ @@ -1429,9 +1483,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, /* Flush the superblock & superblock extension */ if(H5F_super_dirty(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, NULL, "unable to mark superblock as dirty") - if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG, meta_dxpl_id) < 0) + if(H5F_flush_tagged_metadata(file, H5AC__SUPERBLOCK_TAG) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock") - if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr, meta_dxpl_id) < 0) + if(H5F_flush_tagged_metadata(file, file->shared->sblock->ext_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "unable to flush superblock extension") /* Remove the file lock for SWMR_WRITE */ @@ -1463,7 +1517,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, done: if((NULL == ret_value) && file) - if(H5F__dest(file, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) + if(H5F__dest(file, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file") FUNC_LEAVE_NOAPI(ret_value) @@ -1479,7 +1533,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) +H5F__flush_phase1(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1489,7 +1543,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) HDassert(f); /* Flush any cached dataset storage raw data */ - if(H5D_flush(f, meta_dxpl_id) < 0) + if(H5D_flush_all(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache") @@ -1499,7 +1553,7 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) /* (needs to happen before cache flush, with superblock write, since the * 'eoa' value is written in superblock -QAK) */ - if(H5MF_free_aggrs(f, meta_dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file space") @@ -1516,9 +1570,8 @@ H5F__flush_phase1(H5F_t *f, hid_t meta_dxpl_id) *------------------------------------------------------------------------- */ static herr_t -H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) +H5F__flush_phase2(H5F_t *f, hbool_t closing) { - H5F_io_info2_t fio_info; /* I/O info for operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1527,41 +1580,32 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi HDassert(f); /* Flush the entire metadata cache */ - if(H5AC_flush(f, meta_dxpl_id) < 0) + if(H5AC_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") /* Truncate the file to the current allocated size */ - if(H5FD_truncate(f->shared->lf, meta_dxpl_id, closing) < 0) + if(H5FD_truncate(f->shared->lf, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "low level truncate failed") /* Flush the entire metadata cache again since the EOA could have changed in the truncate call. */ - if(H5AC_flush(f, meta_dxpl_id) < 0) + if(H5AC_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush metadata cache") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - /* Push error, but keep going*/ - HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Flush out the metadata accumulator */ - if(H5F__accum_flush(&fio_info) < 0) + if(H5F__accum_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush metadata accumulator") /* Flush the page buffer */ - if(H5PB_flush(&fio_info) < 0) + if(H5PB_flush(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "page buffer flush failed") /* Flush file buffers to disk. */ - if(H5FD_flush(f->shared->lf, meta_dxpl_id, closing) < 0) + if(H5FD_flush(f->shared->lf, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "low level flush failed") @@ -1570,7 +1614,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi /*------------------------------------------------------------------------- - * Function: H5F__flush + * Function: H5F__flush_real * * Purpose: Flushes cached data. * @@ -1578,7 +1622,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi *------------------------------------------------------------------------- */ herr_t -H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) +H5F__flush_real(H5F_t *f, hbool_t closing) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1588,45 +1632,137 @@ H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing) HDassert(f); /* First phase of flushing data */ - if(H5F__flush_phase1(f, meta_dxpl_id) < 0) + if(H5F__flush_phase1(f) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data") /* Second phase of flushing data */ - if(H5F__flush_phase2(f, meta_dxpl_id, raw_dxpl_id, closing) < 0) + if(H5F__flush_phase2(f, closing) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush file data") FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F__flush_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__flush + * + * Purpose: Internal routine to flush a file. + * + * Note: This routine is needed so that there's a non-API routine for + * flushing files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * December 13, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__flush(H5F_t *f, H5F_scope_t scope) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Flush other files, depending on scope */ + if(H5F_SCOPE_GLOBAL == scope) { + /* Call the flush routine for mounted file hierarchies */ + if(H5F_flush_mounts(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") + } /* end if */ + else { + /* Call the flush routine, for this file */ + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") + } /* end else */ + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5F__flush() */ /*------------------------------------------------------------------------- - * Function: H5F_close + * Function: H5F__close + * + * Purpose: Internal routine to close a file. + * + * Note: This routine is needed so that there's a non-API routine for + * closing files that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * December 16, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__close(hid_t file_id) +{ + H5F_t *f; /* File pointer */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Flush file if this is the last reference to this id and we have write + * intent, unless it will be flushed by the "shared" file being closed. + * This is only necessary to replicate previous behaviour, and could be + * disabled by an option/property to improve performance. + */ + if(NULL == (f = (H5F_t *)H5I_object(file_id))) + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "invalid file identifier") + if((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { + int nref; /* Number of references to file ID */ + + if((nref = H5I_get_ref(file_id, FALSE)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get ID ref count") + if(nref == 1) + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush cache") + } /* end if */ + + /* Decrement reference count on file ID */ + /* (When it reaches zero the file will be closed) */ + if(H5I_dec_app_ref(file_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "decrementing file ID failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__close() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__close_cb * * Purpose: Closes a file or causes the close operation to be pended. - * This function is called two ways: from the API it gets called - * by H5Fclose->H5I_dec_ref->H5F_close when H5I_dec_ref() + * This function is called from the API and gets called + * by H5Fclose->H5I_dec_ref->H5F__close_cb when H5I_dec_ref() * decrements the file ID reference count to zero. The file ID * is removed from the H5I_FILE group by H5I_dec_ref() just - * before H5F_close() is called. If there are open object + * before H5F__close_cb() is called. If there are open object * headers then the close is pended by moving the file to the * H5I_FILE_CLOSING ID group (the f->closing contains the ID * assigned to file). * - * This function is also called directly from H5O_close() when - * the last object header is closed for the file and the file - * has a pending close. - * * Return: Non-negative on success/Negative on failure + * *------------------------------------------------------------------------- */ herr_t -H5F_close(H5F_t *f) +H5F__close_cb(H5F_t *f) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Sanity check */ HDassert(f); @@ -1658,8 +1794,8 @@ H5F_close(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_close() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__close_cb() */ /*------------------------------------------------------------------------- @@ -1671,6 +1807,7 @@ done: * - The file was unmounted * * Return: Non-negative on success/Negative on failure + * *------------------------------------------------------------------------- */ herr_t @@ -1805,14 +1942,14 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close parent file") /* Unmount and close each child before closing the current file. */ - if(H5F_close_mounts(f) < 0) + if(H5F__close_mounts(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't unmount child files") /* If there is more than one reference to the shared file struct and the * file has an external file cache, we should see if it can be closed. This * can happen if a cycle is formed with external file caches */ if(f->shared->efc && (f->shared->nrefs > 1)) - if(H5F_efc_try_close(f) < 0) + if(H5F__efc_try_close(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't attempt to close EFC") /* Delay flush until the shared file struct is closed, in H5F__dest. If the @@ -1824,7 +1961,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) * shared H5F_file_t struct. If the reference count for the H5F_file_t * struct reaches zero then destroy it also. */ - if(H5F__dest(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, TRUE) < 0) + if(H5F__dest(f, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") /* Since we closed the file, this should be set to TRUE */ @@ -2314,23 +2451,57 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) /*------------------------------------------------------------------------- - * Function: H5F_get_file_image + * Function: H5F__get_freespace + * + * Purpose: Private version of H5Fget_freespace + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_freespace(H5F_t *f, hsize_t *tot_space) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Go get the actual amount of free space in the file */ + if(H5MF_get_freespace(f, tot_space, NULL) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to check free space for file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_freespace() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__get_file_image * * Purpose: Private version of H5Fget_file_image * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * * Return: Success: Bytes copied / number of bytes needed. * Failure: negative value *------------------------------------------------------------------------- */ ssize_t -H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, - hid_t raw_dxpl_id) +H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) { H5FD_t *fd_ptr; /* file driver */ haddr_t eoa; /* End of file address */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ if(!file || !file->shared || !file->shared->lf) @@ -2391,7 +2562,6 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i /* test to see if a buffer was provided -- if not, we are done */ if(buf_ptr != NULL) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ size_t space_needed; /* size of file image */ hsize_t tmp; size_t tmp_size; @@ -2402,16 +2572,9 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i space_needed = (size_t)eoa; - /* Set up file driver I/O info object */ - fdio_info.file = fd_ptr; - if(NULL == (fdio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list object") - /* read in the file image */ /* (Note compensation for base address addition in internal routine) */ - if(H5FD_read(&fdio_info, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) + if(H5FD_read(fd_ptr, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "file image read request failed") /* Offset to "status_flags" in the superblock */ @@ -2425,8 +2588,58 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_i } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_get_file_image() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_file_image() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__get_info + * + * Purpose: Private version of H5Fget_info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_info(H5F_t *f, H5F_info2_t *finfo) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + HDassert(finfo); + + /* Reset file info struct */ + HDmemset(finfo, 0, sizeof(*finfo)); + + /* Get the size of the superblock and any superblock extensions */ + if(H5F__super_size(f, &finfo->super.super_size, &finfo->super.super_ext_size) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve superblock sizes") + + /* Get the size of any persistent free space */ + if(H5MF_get_freespace(f, &finfo->free.tot_space, &finfo->free.meta_size) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve free space information") + + /* Check for SOHM info */ + if(H5F_addr_defined(f->shared->sohm_addr)) + if(H5SM_ih_size(f, &finfo->sohm.hdr_size, &finfo->sohm.msgs_info) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve SOHM index & heap storage info") + + /* Set version # fields */ + finfo->super.version = f->shared->sblock->super_vers; + finfo->sohm.version = f->shared->sohm_vers; + finfo->free.version = HDF5_FREESPACE_VERSION; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_info() */ /*------------------------------------------------------------------------- @@ -2514,6 +2727,39 @@ H5F_set_retries(H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F__get_free_sections + * + * Purpose: Private version of H5Fget_free_sections + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: non-negative, the total # of free space sections + * Failure: negative + *------------------------------------------------------------------------- + */ +ssize_t +H5F__get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, + H5F_sect_info_t *sect_info) +{ + ssize_t ret_value = -1; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Go get the actual amount of free space in the file */ + if((ret_value = H5MF_get_free_sections(f, type, nsects, sect_info)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free space sections for file") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__get_free_sections() */ + + +/*------------------------------------------------------------------------- * Function: H5F_object_flush_cb * * Purpose: To invoke the callback function for object flush that is set @@ -2676,3 +2922,244 @@ H5F_set_latest_flags(H5F_t *f, unsigned flags) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_latest_flags() */ + +/*------------------------------------------------------------------------- + * Function: H5F__start_swmr_write + * + * Purpose: Private version of H5Fstart_swmr_write + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__start_swmr_write(H5F_t *f) +{ + size_t grp_dset_count = 0; /* # of open objects: groups & datasets */ + size_t nt_attr_count = 0; /* # of opened named datatypes + opened attributes */ + hid_t *obj_ids = NULL; /* List of ids */ + H5G_loc_t *obj_glocs = NULL;/* Group location of the object */ + H5O_loc_t *obj_olocs = NULL;/* Object location */ + H5G_name_t *obj_paths = NULL; /* Group hierarchy path */ + size_t u; /* Local index variable */ + hbool_t setup = FALSE; /* Boolean flag to indicate whether SWMR setting is enabled */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Flush the superblock extension */ + if(H5F_flush_tagged_metadata(f, f->shared->sblock->ext_addr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock extension") + + /* Flush data buffers */ + if(H5F__flush_real(f, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush f's cached information") + + /* Get the # of opened named datatypes and attributes */ + if(H5F_get_obj_count(f, H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, FALSE, &nt_attr_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + if(nt_attr_count) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "named datatypes and/or attributes opened in the file") + + /* Get the # of opened datasets and groups */ + if(H5F_get_obj_count(f, H5F_OBJ_GROUP|H5F_OBJ_DATASET, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + + if(grp_dset_count) { + /* Allocate space for group and object locations */ + if((obj_ids = (hid_t *) H5MM_malloc(grp_dset_count * sizeof(hid_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for hid_t") + if((obj_glocs = (H5G_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_loc_t") + if((obj_olocs = (H5O_loc_t *) H5MM_malloc(grp_dset_count * sizeof(H5O_loc_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5O_loc_t") + if((obj_paths = (H5G_name_t *) H5MM_malloc(grp_dset_count * sizeof(H5G_name_t))) == NULL) + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate buffer for H5G_name_t") + + /* Get the list of opened object ids (groups & datasets) */ + if(H5F_get_obj_ids(f, H5F_OBJ_GROUP|H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, &grp_dset_count) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "H5F_get_obj_ids failed") + + /* Refresh opened objects (groups, datasets) in the file */ + for(u = 0; u < grp_dset_count; u++) { + H5O_loc_t *oloc; /* object location */ + H5G_loc_t tmp_loc; + + /* Set up the id's group location */ + obj_glocs[u].oloc = &obj_olocs[u]; + obj_glocs[u].path = &obj_paths[u]; + H5G_loc_reset(&obj_glocs[u]); + + /* get the id's object location */ + if((oloc = H5O_get_loc(obj_ids[u])) == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Make deep local copy of object's location information */ + H5G_loc(obj_ids[u], &tmp_loc); + H5G_loc_copy(&obj_glocs[u], &tmp_loc, H5_COPY_DEEP); + + /* Close the object */ + if(H5I_dec_ref(obj_ids[u]) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEOBJ, FAIL, "decrementing object ID failed") + } /* end for */ + } /* end if */ + + /* Flush and reset the accumulator */ + if(H5F__accum_reset(f, TRUE) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") + + /* Turn on SWMR write in shared file open flags */ + f->shared->flags |= H5F_ACC_SWMR_WRITE; + + /* Mark the file in SWMR writing mode */ + f->shared->sblock->status_flags |= H5F_SUPER_SWMR_WRITE_ACCESS; + + /* Set up metadata read attempts */ + f->shared->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; + + /* Initialize "retries" and "retries_nbins" */ + if(H5F_set_retries(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Turn off usage of accumulator */ + f->shared->feature_flags &= ~(unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if(H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + setup = TRUE; + + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if(H5F_flush_tagged_metadata(f, H5AC__SUPERBLOCK_TAG) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + + /* Evict all flushed entries in the cache except the pinned superblock */ + if(H5F__evict_cache_entries(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict file's cached information") + + /* Refresh (reopen) the objects (groups & datasets) in the file */ + for(u = 0; u < grp_dset_count; u++) + if(H5O_refresh_metadata_reopen(obj_ids[u], &obj_glocs[u], TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't refresh-close object") + + /* Unlock the file */ + if(H5FD_unlock(f->shared->lf) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to unlock the file") + +done: + if(ret_value < 0 && setup) { + HDassert(f); + + /* Re-enable accumulator */ + f->shared->feature_flags |= (unsigned)H5FD_FEAT_ACCUMULATE_METADATA; + if(H5FD_set_feature_flags(f->shared->lf, f->shared->feature_flags) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set feature_flags in VFD") + + /* Reset the # of read attempts */ + f->shared->read_attempts = H5F_METADATA_READ_ATTEMPTS; + if(H5F_set_retries(f) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't set retries and retries_nbins") + + /* Un-set H5F_ACC_SWMR_WRITE in shared open flags */ + f->shared->flags &= ~H5F_ACC_SWMR_WRITE; + + /* Unmark the f: not in SWMR writing mode */ + f->shared->sblock->status_flags &= (uint8_t)(~H5F_SUPER_SWMR_WRITE_ACCESS); + + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + + /* Flush the superblock */ + if(H5F_flush_tagged_metadata(f, H5AC__SUPERBLOCK_TAG) < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush superblock") + } /* end if */ + + /* Free memory */ + if(obj_ids) + H5MM_xfree(obj_ids); + if(obj_glocs) + H5MM_xfree(obj_glocs); + if(obj_olocs) + H5MM_xfree(obj_olocs); + if(obj_paths) + H5MM_xfree(obj_paths); + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__start_swmr_write() */ + + +/*------------------------------------------------------------------------- + * Function: H5F__format_convert + * + * Purpose: Private version of H5Fformat_convert + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: SUCCEED + * Failure: FAIL + *------------------------------------------------------------------------- + */ +herr_t +H5F__format_convert(H5F_t *f) +{ + hbool_t mark_dirty = FALSE; /* Whether to mark the file's superblock dirty */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + /* Check if the superblock should be downgraded */ + if(f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { + f->shared->sblock->super_vers = HDF5_SUPERBLOCK_VERSION_V18_LATEST; + mark_dirty = TRUE; + } /* end if */ + + /* Check for persistent freespace manager, which needs to be downgraded */ + if(!(f->shared->fs_strategy == H5F_FILE_SPACE_STRATEGY_DEF && + f->shared->fs_persist == H5F_FREE_SPACE_PERSIST_DEF && + f->shared->fs_threshold == H5F_FREE_SPACE_THRESHOLD_DEF && + f->shared->fs_page_size == H5F_FILE_SPACE_PAGE_SIZE_DEF)) { + /* Check to remove free-space manager info message from superblock extension */ + if(H5F_addr_defined(f->shared->sblock->ext_addr)) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") + + /* Close freespace manager */ + if(H5MF_try_close(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to free free-space address") + + /* Set non-persistent freespace manager */ + f->shared->fs_strategy = H5F_FILE_SPACE_STRATEGY_DEF; + f->shared->fs_persist = H5F_FREE_SPACE_PERSIST_DEF; + f->shared->fs_threshold = H5F_FREE_SPACE_THRESHOLD_DEF; + f->shared->fs_page_size = H5F_FILE_SPACE_PAGE_SIZE_DEF; + + /* Indicate that the superblock should be marked dirty */ + mark_dirty = TRUE; + } /* end if */ + + /* Check if we should mark the superblock dirty */ + if(mark_dirty) + /* Mark superblock as dirty */ + if(H5F_super_dirty(f) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5F__format_convert() */ + diff --git a/src/H5Fio.c b/src/H5Fio.c index 81fa514..830b7ee 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -92,15 +92,15 @@ *------------------------------------------------------------------------- */ herr_t -H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, void *buf/*out*/) +H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(buf); @@ -113,23 +113,8 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; - /* Set up the I/O info object */ - fio_info.f = f; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - /* Pass through page buffer layer */ - if(H5PB_read(&fio_info, map_type, addr, size, buf) < 0) + if(H5PB_read(f, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "read through page buffer failed") done: @@ -153,15 +138,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, - hid_t dxpl_id, const void *buf) +H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) + /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); @@ -175,23 +160,8 @@ H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; - /* Set up the I/O info object */ - fio_info.f = f; - if(H5FD_MEM_DRAW == type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - /* Pass through page buffer layer */ - if(H5PB_write(&fio_info, map_type, addr, size, buf) < 0) + if(H5PB_write(f, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write through page buffer failed") done: @@ -213,30 +183,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) +H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag) { - H5F_io_info2_t fio_info; /* I/O info for operation */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Use tag to search for and flush associated metadata */ - if(H5AC_flush_tagged_metadata(f, tag, dxpl_id)<0) + if(H5AC_flush_tagged_metadata(f, tag) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - /* Flush and reset the accumulator */ - if(H5F__accum_reset(&fio_info, TRUE) < 0) + if(H5F__accum_reset(f, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") /* Flush file buffers to disk. */ - if(H5FD_flush(f->shared->lf, dxpl_id, FALSE) < 0) + if(H5FD_flush(f->shared->lf, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed") done: @@ -257,14 +219,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) +H5F_evict_tagged_metadata(H5F_t *f, haddr_t tag) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) /* Evict the object's metadata */ - if(H5AC_evict_tagged_metadata(f, tag, TRUE, dxpl_id) < 0) + if(H5AC_evict_tagged_metadata(f, tag, TRUE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict tagged metadata") done: @@ -285,7 +247,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) +H5F__evict_cache_entries(H5F_t *f) { herr_t ret_value = SUCCEED; @@ -295,7 +257,7 @@ H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); /* Evict all except pinned entries in the cache */ - if(H5AC_evict(f, dxpl_id) < 0) + if(H5AC_evict(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict all except pinned entries") #ifndef NDEBUG diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 3cd5c21..a7d42e4 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -17,6 +17,7 @@ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Gprivate.h" /* Groups */ @@ -25,14 +26,14 @@ #include "H5MMprivate.h" /* Memory management */ /* PRIVATE PROTOTYPES */ -static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t plist_id, hid_t dxpl_id); -static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); +static herr_t H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, + hid_t plist_id); +static herr_t H5F__unmount(H5G_loc_t *loc, const char *name); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); /*------------------------------------------------------------------------- - * Function: H5F_close_mounts + * Function: H5F__close_mounts * * Purpose: Close all mounts for a given file * @@ -44,7 +45,7 @@ static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigne *------------------------------------------------------------------------- */ herr_t -H5F_close_mounts(H5F_t *f) +H5F__close_mounts(H5F_t *f) { unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ @@ -64,7 +65,7 @@ H5F_close_mounts(H5F_t *f) /* Close the internal group maintaining the mount point */ if(H5G_close(f->shared->mtab.child[u].group) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group") + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group") /* Close the child file */ if(H5F_try_close(f->shared->mtab.child[u].file, NULL) < 0) @@ -82,11 +83,11 @@ H5F_close_mounts(H5F_t *f) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_close_mounts() */ +} /* end H5F__close_mounts() */ /*------------------------------------------------------------------------- - * Function: H5F_mount + * Function: H5F__mount * * Purpose: Mount file CHILD onto the group specified by LOC and NAME, * using mount properties in PLIST. CHILD must not already be @@ -100,8 +101,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) +H5F__mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id) { H5G_t *mount_point = NULL; /*mount point group */ H5F_t *ancestor = NULL; /*ancestor files */ @@ -114,7 +114,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, H5G_loc_t root_loc; /* Group location of root of file to mount */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL HDassert(loc); HDassert(name && *name); @@ -134,7 +134,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, */ if(child->parent) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "file is already mounted") - if(H5G_loc_find(loc, name, &mp_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &mp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") /* If the mount location is holding its file open, that file will close * and remove the mount as soon as we exit this function. Prevent the @@ -144,7 +144,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount path cannot contain links to external files") /* Open the mount point group */ - if(NULL == (mount_point = H5G_open(&mp_loc, dxpl_id))) + if(NULL == (mount_point = H5G_open(&mp_loc))) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found") /* Check if the proposed mount point group is already a mount point */ @@ -227,8 +227,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, /* Search the open IDs and replace names for mount operation */ /* We pass H5G_UNKNOWN as object type; search all IDs */ if(H5G_name_replace(NULL, H5G_NAME_MOUNT, mp_loc.oloc->file, - mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r, - dxpl_id) < 0) + mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to replace name") done: @@ -243,12 +242,12 @@ done: } /* end else */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_mount() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__mount() */ /*------------------------------------------------------------------------- - * Function: H5F_unmount + * Function: H5F__unmount * * Purpose: Unmount the child which is mounted at the group specified by * LOC and NAME or fail if nothing is mounted there. Neither @@ -266,7 +265,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) +H5F__unmount(H5G_loc_t *loc, const char *name) { H5G_t *child_group = NULL; /* Child's group in parent mtab */ H5F_t *child = NULL; /*mounted file */ @@ -280,7 +279,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL HDassert(loc); HDassert(name && *name); @@ -295,7 +294,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) * If we get the root group and the file has a parent in the mount tree, * then we must have found the mount point. */ - if(H5G_loc_find(loc, name, &mp_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &mp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") mp_loc_setup = TRUE; child = mp_loc.oloc->file; @@ -366,8 +365,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) /* Search the open IDs replace names to reflect unmount operation */ if(H5G_name_replace(NULL, H5G_NAME_UNMOUNT, mp_loc.oloc->file, - mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r, - dxpl_id) < 0) + mp_loc.path->full_path_r, root_loc.oloc->file, root_loc.path->full_path_r) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name") /* Eliminate the mount point from the table */ @@ -392,8 +390,8 @@ done: if(mp_loc_setup) H5G_loc_free(&mp_loc); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_unmount() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5F__unmount() */ /*------------------------------------------------------------------------- @@ -445,6 +443,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) { H5G_loc_t loc; H5F_t *child = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -463,11 +462,22 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) if(TRUE != H5P_isa_class(plist_id, H5P_FILE_MOUNT)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Do the mount */ - if(H5F_mount(&loc, name, child, plist_id, H5AC_ind_read_dxpl_id) < 0) + if(H5F__mount(&loc, name, child, plist_id) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to mount file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Fmount() */ @@ -495,6 +505,7 @@ herr_t H5Funmount(hid_t loc_id, const char *name) { H5G_loc_t loc; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -506,11 +517,22 @@ H5Funmount(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Unmount */ - if (H5F_unmount(&loc, name, H5AC_ind_read_dxpl_id) < 0) + if(H5F__unmount(&loc, name) < 0) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "unable to unmount file") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) } /* end H5Funmount() */ @@ -612,7 +634,7 @@ H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) *------------------------------------------------------------------------- */ static herr_t -H5F_flush_mounts_recurse(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F_flush_mounts_recurse(H5F_t *f) { unsigned nerrors = 0; /* Errors from recursive flushes */ unsigned u; /* Index variable */ @@ -625,11 +647,11 @@ H5F_flush_mounts_recurse(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) /* Flush all child files, not stopping for errors */ for(u = 0; u < f->shared->mtab.nmounts; u++) - if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file, meta_dxpl_id, raw_dxpl_id) < 0) + if(H5F_flush_mounts_recurse(f->shared->mtab.child[u].file) < 0) nerrors++; /* Call the "real" flush routine, for this file */ - if(H5F__flush(f, meta_dxpl_id, raw_dxpl_id, FALSE) < 0) + if(H5F__flush_real(f, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file's cached information") /* Check flush errors for children - errors are already on the stack */ @@ -654,7 +676,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) +H5F_flush_mounts(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -668,7 +690,7 @@ H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id) f = f->parent; /* Flush the mounted file hierarchy */ - if(H5F_flush_mounts_recurse(f, meta_dxpl_id, raw_dxpl_id) < 0) + if(H5F_flush_mounts_recurse(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush mounted file hierarchy") done: diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 2ce454a..f854d3b 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -310,50 +310,53 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) FUNC_ENTER_NOAPI(FAIL) + /* Sanity check */ HDassert(mpi_comm); + + /* Set value to return to invalid MPI comm */ *mpi_comm = MPI_COMM_NULL; /* if the loc_id is valid, then get the comm from the file attached to the loc_id */ if(H5I_INVALID_HID != loc_id) { H5G_loc_t loc; - H5F_t *f = NULL; + H5F_t *f; - /* retrieve the file structure */ + /* Retrieve the file structure */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a location") f = loc.oloc->file; HDassert(f); - /* check if MPIO driver is used */ + /* Check if MPIO driver is used */ if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { /* retrieve the file communicator */ if(MPI_COMM_NULL == (*mpi_comm = H5F_mpi_get_comm(f))) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator") - } - } - /* otherwise, this if from H5Fopen or H5Fcreate and has to be collective */ + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") + } /* end if */ + } /* end if */ + /* otherwise, this is from H5Fopen or H5Fcreate and has to be collective */ else { H5P_genplist_t *plist; /* Property list pointer */ - HDassert(H5P_isa_class(acspl_id, H5P_FILE_ACCESS)); - if(NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list") + HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file access list") if(H5FD_MPIO == H5P_peek_driver(plist)) { const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */ if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist))) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad VFL driver info") *mpi_comm = fa->comm; - } - } + } /* end if */ + } /* end else */ + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_retrieve_comm */ + /*------------------------------------------------------------------------- * Function: H5F_get_mpi_info * diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..2c52d00 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -395,43 +395,52 @@ H5FL_EXTERN(H5F_file_t); /* General routines */ H5F_t *H5F_new(H5F_file_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); -H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t flush); -H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); -H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL herr_t H5F__dest(H5F_t *f, hbool_t flush); +H5_DLL H5F_t *H5F__create(const char *filename, unsigned flags, hid_t fcpl_id, + hid_t fapl_id); +H5_DLL H5F_t * H5F__open(const char *filename, unsigned flags, hid_t fcpl_id, + hid_t fapl_id); +H5_DLL herr_t H5F__flush(H5F_t *f, H5F_scope_t scope); +H5_DLL herr_t H5F__flush_real(H5F_t *f, hbool_t closing); +H5_DLL htri_t H5F__is_hdf5(const char *name); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, - hid_t meta_dxpl_id, hid_t raw_dxpl_id); -H5_DLL herr_t H5F_close(H5F_t *f); +H5_DLL herr_t H5F__get_freespace(H5F_t *f, hsize_t *tot_space); +H5_DLL ssize_t H5F__get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len); +H5_DLL herr_t H5F__get_info(H5F_t *f, H5F_info2_t *finfo); +H5_DLL ssize_t H5F__get_free_sections(H5F_t *f, H5FD_mem_t type, + size_t nsects, H5F_sect_info_t *sect_info); +H5_DLL herr_t H5F__format_convert(H5F_t *f); +H5_DLL herr_t H5F__start_swmr_write(H5F_t *f); +H5_DLL herr_t H5F__close(hid_t file_id); +H5_DLL herr_t H5F__close_cb(H5F_t *f); /* File mount related routines */ -H5_DLL herr_t H5F_close_mounts(H5F_t *f); +H5_DLL herr_t H5F__close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); /* Superblock related routines */ -H5_DLL herr_t H5F__super_init(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, - hbool_t initial_read); -H5_DLL herr_t H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size); +H5_DLL herr_t H5F__super_init(H5F_t *f); +H5_DLL herr_t H5F__super_read(H5F_t *f, hbool_t initial_read); +H5_DLL herr_t H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size); H5_DLL herr_t H5F__super_free(H5F_super_t *sblock); /* Superblock extension related routines */ H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr); -H5_DLL herr_t H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, - void *mesg, hbool_t may_create, unsigned mesg_flags); -H5_DLL herr_t H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id); -H5_DLL herr_t H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, - hbool_t was_created); +H5_DLL herr_t H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, + hbool_t may_create, unsigned mesg_flags); +H5_DLL herr_t H5F__super_ext_remove_msg(H5F_t *f, unsigned id); +H5_DLL herr_t H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created); /* Metadata accumulator routines */ -H5_DLL herr_t H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf); -H5_DLL herr_t H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, const void *buf); -H5_DLL herr_t H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, hsize_t size); -H5_DLL herr_t H5F__accum_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5F__accum_reset(const H5F_io_info2_t *fio_info, hbool_t flush); +H5_DLL herr_t H5F__accum_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf); +H5_DLL herr_t H5F__accum_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); +H5_DLL herr_t H5F__accum_free(H5F_t *f, H5FD_mem_t type, haddr_t addr, + hsize_t size); +H5_DLL herr_t H5F__accum_flush(H5F_t *f); +H5_DLL herr_t H5F__accum_reset(H5F_t *f, hbool_t flush); /* Shared file list related routines */ H5_DLL herr_t H5F_sfile_add(H5F_file_t *shared); @@ -441,15 +450,15 @@ H5_DLL herr_t H5F_sfile_remove(H5F_file_t *shared); /* External file cache routines */ H5_DLL H5F_efc_t *H5F_efc_create(unsigned max_nfiles); H5_DLL unsigned H5F_efc_max_nfiles(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_release(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_destroy(H5F_efc_t *efc); -H5_DLL herr_t H5F_efc_try_close(H5F_t *f); +H5_DLL herr_t H5F__efc_release(H5F_efc_t *efc); +H5_DLL herr_t H5F__efc_destroy(H5F_efc_t *efc); +H5_DLL herr_t H5F__efc_try_close(H5F_t *f); /* Space allocation routines */ -H5_DLL haddr_t H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); -H5_DLL herr_t H5F_free(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, haddr_t addr, hsize_t size); -H5_DLL htri_t H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - haddr_t blk_end, hsize_t extra_requested); +H5_DLL haddr_t H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size); +H5_DLL herr_t H5F__free(H5F_t *f, H5F_mem_t type, haddr_t addr, hsize_t size); +H5_DLL htri_t H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, + hsize_t extra_requested); /* Functions that get/retrieve values from VFD layer */ H5_DLL herr_t H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr); @@ -457,7 +466,7 @@ H5_DLL herr_t H5F__set_base_addr(const H5F_t *f, haddr_t addr); H5_DLL herr_t H5F__set_paged_aggr(const H5F_t *f, hbool_t paged); /* Functions that flush or evict */ -H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5F__evict_cache_entries(H5F_t *f); /* Testing functions */ #ifdef H5F_TESTING diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..d067664 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -672,20 +672,6 @@ typedef struct H5F_object_flush_t { void *udata; /* User data */ } H5F_object_flush_t; -/* I/O Info for an operation (old) */ -typedef struct H5F_io_info_t { - const H5F_t *f; /* File object */ - const struct H5P_genplist_t *dxpl; /* DXPL object */ -} H5F_io_info_t; - -/* I/O Info for an operation */ -/* (Migrate toward this one, so that both raw data & metadata DXPLs are available) */ -typedef struct H5F_io_info2_t { - const H5F_t *f; /* File object */ - const struct H5P_genplist_t *meta_dxpl; /* Metadata DXPL object */ - const struct H5P_genplist_t *raw_dxpl; /* Raw data DXPL object */ -} H5F_io_info2_t; - /* Concise info about a block of bytes in a file */ typedef struct H5F_block_t { haddr_t offset; /* Offset of the block in the file */ @@ -733,7 +719,7 @@ typedef enum H5F_mem_page_t { /* Private functions */ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id); + hid_t fapl_id); H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); /* Functions than retrieve values from the file struct */ @@ -757,7 +743,7 @@ H5_DLL herr_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, h H5_DLL hsize_t H5F_get_pgend_meta_thres(const H5F_t *f); H5_DLL hbool_t H5F_get_point_of_no_return(const H5F_t *f); H5_DLL hbool_t H5F_get_first_alloc_dealloc(const H5F_t *f); -H5_DLL hbool_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f); +H5_DLL haddr_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f); /* Functions than retrieve values set/cached from the superblock/FCPL */ H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); @@ -809,17 +795,17 @@ H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_hand H5_DLL hbool_t H5F_is_mount(const H5F_t *file); H5_DLL hbool_t H5F_has_mount(const H5F_t *file); H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/); -H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL herr_t H5F_flush_mounts(H5F_t *f); /* Functions that operate on blocks of bytes wrt super block */ -H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, hid_t dxpl_id, void *buf/*out*/); -H5_DLL herr_t H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, hid_t dxpl_id, const void *buf); +H5_DLL herr_t H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, void *buf/*out*/); +H5_DLL herr_t H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, + size_t size, const void *buf); /* Functions that flush or evict */ -H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); -H5_DLL herr_t H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); +H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t *f, haddr_t tag); +H5_DLL herr_t H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag); /* Functions that verify a piece of metadata with checksum */ H5_DLL herr_t H5F_get_checksums(const uint8_t *buf, size_t chk_size, uint32_t *s_chksum, uint32_t *c_chksum); @@ -846,7 +832,7 @@ H5_DLL herr_t H5F_fake_free(H5F_t *f); /* Superblock related routines */ H5_DLL herr_t H5F_super_dirty(H5F_t *f); -H5_DLL herr_t H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5F_eoa_dirty(H5F_t *f); /* Parallel I/O (i.e. MPI) related routines */ #ifdef H5_HAVE_PARALLEL @@ -860,12 +846,12 @@ H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info); /* External file cache routines */ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, - hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); + hid_t fcpl_id, hid_t fapl_id); H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); /* Global heap CWFS routines */ H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); -H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr); +H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr); H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, hbool_t add_heap); H5_DLL herr_t H5F_cwfs_remove_heap(H5F_file_t *shared, struct H5HG_heap_t *heap); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index cc2399b..2495828 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -1171,7 +1171,7 @@ H5F_get_first_alloc_dealloc(const H5F_t *f) * Failure: (can't happen) *------------------------------------------------------------------------- */ -hbool_t +haddr_t H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 0962f69..6baf163 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -75,7 +75,7 @@ /*------------------------------------------------------------------------- - * Function: H5F_alloc + * Function: H5F__alloc * * Purpose: Wrapper for H5FD_alloc, to make certain EOA changes are * reflected in superblock. @@ -93,11 +93,11 @@ *------------------------------------------------------------------------- */ haddr_t -H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) +H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t *frag_size) { haddr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(HADDR_UNDEF) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -120,21 +120,21 @@ H5F_alloc(H5F_t *f, hid_t dxpl_id, H5F_mem_t type, hsize_t size, haddr_t *frag_a } /* end if */ /* Call the file driver 'alloc' routine */ - ret_value = H5FD_alloc(f->shared->lf, dxpl_id, type, f, size, frag_addr, frag_size); + ret_value = H5FD_alloc(f->shared->lf, type, f, size, frag_addr, frag_size); if(!H5F_addr_defined(ret_value)) HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, HADDR_UNDEF, "file driver 'alloc' request failed") /* Mark EOA dirty */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, HADDR_UNDEF, "unable to mark EOA as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_alloc() */ +} /* end H5F__alloc() */ /*------------------------------------------------------------------------- - * Function: H5F_free + * Function: H5F__free * * Purpose: Wrapper for H5FD_free, to make certain EOA changes are * reflected in superblock. @@ -152,11 +152,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) +H5F__free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -166,20 +166,20 @@ H5F_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize_t size) HDassert(size > 0); /* Call the file driver 'free' routine */ - if(H5FD_free(f->shared->lf, dxpl_id, type, f, addr, size) < 0) + if(H5FD_free(f->shared->lf, type, f, addr, size) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "file driver 'free' request failed") /* Mark EOA dirty */ - if(H5F_eoa_dirty(f, dxpl_id) < 0) + if(H5F_eoa_dirty(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark EOA as dirty") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_free() */ +} /* end H5F__free() */ /*------------------------------------------------------------------------- - * Function: H5F_try_extend + * Function: H5F__try_extend * * Purpose: Extend a block at the end of the file, if possible. * @@ -197,11 +197,11 @@ done: *------------------------------------------------------------------------- */ htri_t -H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) +H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -211,7 +211,7 @@ H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_ HDassert(extra_requested > 0); /* Extend the object by extending the underlying file */ - if((ret_value = H5FD_try_extend(f->shared->lf, type, f, dxpl_id, blk_end, extra_requested)) < 0) + if((ret_value = H5FD_try_extend(f->shared->lf, type, f, blk_end, extra_requested)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTEXTEND, FAIL, "driver try extend request failed") /* H5FD_try_extend() updates driver message and marks the superblock @@ -220,5 +220,5 @@ H5F_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t blk_end, hsize_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_try_extend() */ +} /* end H5F__try_extend() */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 0c6f9cd..5896e32 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -51,8 +51,8 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr); -static herr_t H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id); +static herr_t H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr); +static herr_t H5F__update_super_ext_driver_msg(H5F_t *f); /*********************/ @@ -75,7 +75,7 @@ H5FL_DEFINE(H5F_super_t); /*------------------------------------------------------------------------- - * Function: H5F_super_ext_create + * Function: H5F__super_ext_create * * Purpose: Create the superblock extension * @@ -87,11 +87,11 @@ H5FL_DEFINE(H5F_super_t); *------------------------------------------------------------------------- */ static herr_t -H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) +H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -115,7 +115,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) * extension. */ H5O_loc_reset(ext_ptr); - if(H5O_create(f, dxpl_id, (size_t)0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0) + if(H5O_create(f, (size_t)0, (size_t)1, H5P_GROUP_CREATE_DEFAULT, ext_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create superblock extension") /* Record the address of the superblock extension */ @@ -124,7 +124,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_create() */ +} /* H5F__super_ext_create() */ /*------------------------------------------------------------------------- @@ -166,7 +166,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_super_ext_close + * Function: H5F__super_ext_close * * Purpose: Close superblock extension * @@ -178,14 +178,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, - hbool_t was_created) +H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -193,16 +191,15 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, /* Check if extension was created */ if(was_created) { - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Increment link count on superblock extension's object header */ - if(H5O_link(ext_ptr, 1, dxpl_id) < 0) + if(H5O_link(ext_ptr, 1) < 0) HGOTO_ERROR(H5E_FILE, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") /* Decrement refcount on superblock extension's object header in memory */ - if(H5O_dec_rc_by_loc(ext_ptr, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(ext_ptr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement refcount on superblock extension"); } /* end if */ @@ -213,12 +210,12 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, f->nopen_objs--; done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_close() */ +} /* H5F__super_ext_close() */ /*------------------------------------------------------------------------- @@ -240,7 +237,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) +H5F__update_super_ext_driver_msg(H5F_t *f) { H5F_super_t *sblock; /* Pointer to the super block */ herr_t ret_value = SUCCEED; /* Return value */ @@ -289,7 +286,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f, hid_t dxpl_id) */ drvinfo.len = driver_size; drvinfo.buf = dbuf; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "unable to update driver info header message") } /* end if driver_size > 0 */ } /* end if !H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO) */ @@ -319,14 +316,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial_read) +H5F__super_read(H5F_t *f, hbool_t initial_read) { - H5P_genplist_t *dxpl = NULL; /* DXPL object */ - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; + H5AC_ring_t orig_ring = H5AC_RING_INV; H5F_super_t * sblock = NULL; /* Superblock structure */ H5F_superblock_cache_ud_t udata; /* User data for cache callbacks */ H5P_genplist_t *c_plist; /* File creation property list */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ unsigned sblock_flags = H5AC__NO_FLAGS_SET; /* flags used in superblock unprotect call */ haddr_t super_addr; /* Absolute address of superblock */ haddr_t eof; /* End of file address */ @@ -338,24 +334,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial int mpi_result; #endif /* H5_HAVE_PARALLEL */ - FUNC_ENTER_PACKAGE_TAG(meta_dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) /* initialize the drvinfo to NULL -- we will overwrite this if there * is a driver information block */ f->shared->drvinfo = NULL; - /* Get the DXPL plist object for DXPL ID */ - if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(meta_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if((H5P_get(dxpl, H5AC_RING_NAME, &orig_ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get property value"); - /* Set up file driver I/O info */ - fdio_info.file = f->shared->lf; - fdio_info.meta_dxpl = dxpl; - if(NULL == (fdio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(raw_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + file = f->shared->lf; /* Find the superblock */ #ifdef H5_HAVE_PARALLEL @@ -377,31 +364,29 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * fact that we have skipped actually calling MPI functions to determine * our MPI rank and size. */ - if ( mpi_size > 1 ) { + if(mpi_size > 1) { MPI_Comm this_comm = MPI_COMM_NULL; - if ( mpi_rank == 0 ) { - if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + if(0 == mpi_rank) + if(H5FD_locate_signature(file, &super_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") - } HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); - if ( MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f)) ) + if(MPI_COMM_NULL == (this_comm = H5F_mpi_get_comm(f))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") - if ( MPI_SUCCESS != - (mpi_result = MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm))) + if(MPI_SUCCESS != (mpi_result = MPI_Bcast(&super_addr,sizeof(super_addr), MPI_BYTE, 0, this_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - } + } /* end if */ else { /* Locate the signature as per per the serial library */ #endif /* H5_HAVE_PARALLEL */ - if (H5FD_locate_signature(&fdio_info, &super_addr) < 0) + if(H5FD_locate_signature(file, &super_addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature") #ifdef H5_HAVE_PARALLEL - } + } /* end else */ #endif /* H5_HAVE_PARALLEL */ if(HADDR_UNDEF == super_addr) HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found") @@ -443,13 +428,11 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial udata.stored_eof = HADDR_UNDEF; udata.drvrinfo_removed = FALSE; - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SB; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SB, &orig_ring); /* Look up the superblock */ - if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) + if(NULL == (sblock = (H5F_super_t *)H5AC_protect(f, H5AC_SUPERBLOCK, (haddr_t)0, &udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load superblock") if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) @@ -582,10 +565,8 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial * allocated so that it knows how to allocate additional memory. */ - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value"); + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Decode the optional driver information block */ if(H5F_addr_defined(sblock->driver_addr)) { @@ -609,7 +590,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "set end of space allocation request failed") /* Look up the driver info block */ - if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) + if(NULL == (drvinfo = (H5O_drvinfo_t *)H5AC_protect(f, H5AC_DRVRINFO, sblock->driver_addr, &drvrinfo_udata, rw_flags))) HGOTO_ERROR(H5E_FILE, H5E_CANTPROTECT, FAIL, "unable to load driver info block") /* Loading the driver info block is enough to set up the right info */ @@ -624,7 +605,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial drvinfo_flags |= H5AC__PIN_ENTRY_FLAG; /* Release the driver info block */ - if(H5AC_unprotect(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, drvinfo_flags) < 0) + if(H5AC_unprotect(f, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, drvinfo_flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to release driver info block") /* save a pointer to the driver information cache entry */ @@ -665,14 +646,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") /* Check for the extension having a 'driver info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_DRVINFO_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { /* Check for ignoring the driver info for this file */ if(!udata.ignore_drvrinfo) { /* Retrieve the 'driver info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_DRVINFO_ID, &drvinfo)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "driver info message not present") /* Validate and decode driver information */ @@ -690,15 +671,15 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Read in the shared OH message information if there is any */ - if(H5SM_get_info(&ext_loc, c_plist, meta_dxpl_id) < 0) + if(H5SM_get_info(&ext_loc, c_plist) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to read SOHM table information") /* Check for the extension having a 'v1 B-tree "K"' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_BTREEK_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { /* Retrieve the 'v1 B-tree "K"' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_BTREEK_ID, &btreek)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "v1 B-tree 'K' info message not present") /* Set non-default v1 B-tree 'K' value info from file */ @@ -714,21 +695,21 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Check for the extension having a 'free-space manager info' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_FSINFO_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { H5O_fsinfo_t fsinfo; /* File space info message from superblock extension */ uint8_t flags; /* Message flags */ /* Get message flags */ - if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, meta_dxpl_id, &flags) < 0) + if(H5O_msg_get_flags(&ext_loc, H5O_FSINFO_ID, &flags) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to message flags for free-space manager info message") /* If message is NOT marked "unknown"--set up file space info */ if(!(flags & H5O_MSG_FLAG_WAS_UNKNOWN)) { /* Retrieve the 'file space info' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_FSINFO_ID, &fsinfo)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get free-space manager info message") /* Update changed values */ @@ -790,7 +771,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ /* KLUGE ALERT!! * - * H5F_super_ext_write_msg() expects f->shared->sblock to + * H5F__super_ext_write_msg() expects f->shared->sblock to * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ @@ -798,10 +779,10 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_FSINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDELETE, FAIL, "error in removing message from superblock extension") - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ f->shared->sblock = NULL; @@ -812,7 +793,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Check for the extension having a 'metadata cache image' message */ - if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID, meta_dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, H5O_MDCI_MSG_ID)) < 0) HGOTO_ERROR(H5E_FILE, H5E_EXISTS, FAIL, "unable to read object header") if(status) { hbool_t rw = ((rw_flags & H5AC__READ_ONLY_FLAG) == 0); @@ -831,7 +812,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial */ /* Retrieve the 'metadata cache image message' structure */ - if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg, meta_dxpl_id)) + if(NULL == H5O_msg_read(&ext_loc, H5O_MDCI_MSG_ID, &mdci_msg)) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get metadata cache image message") /* Indicate to the cache that there's an image to load on first protect call */ @@ -840,7 +821,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial } /* end if */ /* Close superblock extension */ - if(H5F_super_ext_close(f, &ext_loc, meta_dxpl_id, FALSE) < 0) + if(H5F__super_ext_close(f, &ext_loc, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close file's superblock extension") } /* end if */ @@ -877,14 +858,14 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ /* KLUGE ALERT!! * - * H5F_super_ext_write_msg() expects f->shared->sblock to + * H5F__super_ext_write_msg() expects f->shared->sblock to * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ HDassert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ - if(H5F_super_ext_write_msg(f, meta_dxpl_id, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) + if(H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") #if 1 /* bug fix test code -- tidy this up if all goes well */ /* JRM */ @@ -896,7 +877,7 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial /* Check for eliminating the driver info block */ else if(H5F_HAS_FEATURE(f, H5FD_FEAT_IGNORE_DRVRINFO)) { /* Remove the driver info message from the superblock extension */ - if(H5F_super_ext_remove_msg(f, meta_dxpl_id, H5O_DRVINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_DRVINFO_ID) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") /* Check if the superblock extension was removed */ @@ -913,12 +894,12 @@ H5F__super_read(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t initial HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "failed to set paged_aggr status for file driver") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release the superblock */ - if(sblock && H5AC_unprotect(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) + if(sblock && H5AC_unprotect(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, sblock_flags) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTUNPROTECT, FAIL, "unable to close superblock") /* If we have failed, make sure no entries are left in the @@ -931,7 +912,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") /* Evict the driver info block from the cache */ - if(H5AC_expunge_entry(f, meta_dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") } /* end if */ @@ -942,12 +923,12 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") /* Evict the superblock from the cache */ - if(H5AC_expunge_entry(f, meta_dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge superblock") } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5F__super_read() */ @@ -968,15 +949,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F__super_init(H5F_t *f, hid_t dxpl_id) +H5F__super_init(H5F_t *f) { H5F_super_t *sblock = NULL; /* Superblock cache structure */ hbool_t sblock_in_cache = FALSE; /* Whether the superblock has been inserted into the metadata cache */ H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ hbool_t drvinfo_in_cache = FALSE; /* Whether the driver info block has been inserted into the metadata cache */ H5P_genplist_t *plist; /* File creation property list */ - H5P_genplist_t *dxpl = NULL; - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; + H5AC_ring_t orig_ring = H5AC_RING_INV; hsize_t userblock_size; /* Size of userblock, in bytes */ hsize_t superblock_size; /* Size of superblock, in bytes */ size_t driver_size; /* Size of driver info block (bytes) */ @@ -987,7 +967,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) hbool_t non_default_fs_settings = FALSE; /* Whether the file has non-default free-space settings */ herr_t ret_value = SUCCEED; /* Return Value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__SUPERBLOCK_TAG) /* Allocate space for the superblock */ if(NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -1128,12 +1108,11 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) if(super_vers < HDF5_SUPERBLOCK_VERSION_2) superblock_size += driver_size; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SB, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SB, &orig_ring); /* Insert superblock into cache, pinned */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, sblock, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "can't add superblock to cache") sblock_in_cache = TRUE; @@ -1141,7 +1120,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) f->shared->sblock = sblock; /* Allocate space for the superblock */ - if(HADDR_UNDEF == H5MF_alloc(f, H5FD_MEM_SUPER, dxpl_id, superblock_size)) + if(HADDR_UNDEF == H5MF_alloc(f, H5FD_MEM_SUPER, superblock_size)) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for superblock") /* set the drvinfo filed to NULL -- will overwrite this later if needed */ @@ -1180,10 +1159,8 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) else need_ext = FALSE; - /* Set the ring type in the DXPL */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set property value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Create the superblock extension for "extra" superblock data, if necessary. */ if(need_ext) { @@ -1195,18 +1172,17 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) * be tuned if more information is added to the superblock * extension. */ - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + if(H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create superblock extension") ext_created = TRUE; /* Create the Shared Object Header Message table and register it with * the metadata cache, if this file supports shared messages. */ - if(f->shared->sohm_nindexes > 0) { + if(f->shared->sohm_nindexes > 0) /* Initialize the shared message code & write the SOHM message to the extension */ - if(H5SM_init(f, plist, &ext_loc, dxpl_id) < 0) + if(H5SM_init(f, plist, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create SOHM table") - } /* end if */ /* Check for non-default v1 B-tree 'K' values to store */ if(sblock->btree_k[H5B_SNODE_ID] != HDF5_BTREE_SNODE_IK_DEF || @@ -1218,7 +1194,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) btreek.btree_k[H5B_CHUNK_ID] = sblock->btree_k[H5B_CHUNK_ID]; btreek.btree_k[H5B_SNODE_ID] = sblock->btree_k[H5B_SNODE_ID]; btreek.sym_leaf_k = sblock->sym_leaf_k; - if(H5O_msg_create(&ext_loc, H5O_BTREEK_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &btreek, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_BTREEK_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &btreek) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update v1 B-tree 'K' value header message") } /* end if */ @@ -1238,7 +1214,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) /* Write driver info information to the superblock extension */ info.len = driver_size; info.buf = dbuf; - if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update driver info header message") HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); @@ -1262,7 +1238,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) for(ptype = H5F_MEM_PAGE_SUPER; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) fsinfo.fs_addr[ptype - 1] = HADDR_UNDEF; - if(H5O_msg_create(&ext_loc, H5O_FSINFO_ID, H5O_MSG_FLAG_DONTSHARE | H5O_MSG_FLAG_MARK_IF_UNKNOWN, H5O_UPDATE_TIME, &fsinfo, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, H5O_FSINFO_ID, H5O_MSG_FLAG_DONTSHARE | H5O_MSG_FLAG_MARK_IF_UNKNOWN, H5O_UPDATE_TIME, &fsinfo) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update free-space info header message") } /* end if */ } /* end if */ @@ -1285,7 +1261,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) H5_CHECKED_ASSIGN(drvinfo->len, size_t, H5FD_sb_size(f->shared->lf), hsize_t); /* Insert driver info block into cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) + if(H5AC_insert_entry(f, H5AC_DRVRINFO, sblock->driver_addr, drvinfo, H5AC__PIN_ENTRY_FLAG | H5AC__FLUSH_LAST_FLAG | H5AC__FLUSH_COLLECTIVELY_FLAG) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINS, FAIL, "can't add driver info block to cache") drvinfo_in_cache = TRUE; f->shared->drvinfo = drvinfo; @@ -1295,12 +1271,12 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close superblock extension, if it was created */ - if(ext_created && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) + if(ext_created && H5F__super_ext_close(f, &ext_loc, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") /* Cleanup on failure */ @@ -1314,7 +1290,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin driver info") /* Evict the driver info block from the cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_DRVRINFO, sblock->driver_addr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge driver info block") } /* end if */ else @@ -1331,7 +1307,7 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") /* Evict the superblock from the cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_SUPERBLOCK, (haddr_t)0, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTEXPUNGE, FAIL, "unable to expunge superblock") } /* end if */ else @@ -1344,7 +1320,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5F__super_init() */ @@ -1362,7 +1338,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id) +H5F_eoa_dirty(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1387,7 +1363,7 @@ H5F_eoa_dirty(H5F_t *f, hid_t dxpl_id) } /* end if */ /* If the driver info is stored as a message, update that instead */ else if(f->shared->drvinfo_sb_msg_exists) { - if(H5F__update_super_ext_driver_msg(f, dxpl_id) < 0) + if(H5F__update_super_ext_driver_msg(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark drvinfo message as dirty") } /* end if */ @@ -1475,9 +1451,8 @@ H5F__super_free(H5F_super_t *sblock) *------------------------------------------------------------------------- */ herr_t -H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size) +H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1503,12 +1478,11 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext ext_loc.file = f; ext_loc.addr = f->shared->sblock->ext_addr; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Get object header info for superblock extension */ - if(H5O_get_hdr_info(&ext_loc, dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&ext_loc, &hdr_info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to retrieve superblock extension info") /* Set the superblock extension size */ @@ -1520,16 +1494,16 @@ H5F__super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* H5F__super_size() */ /*------------------------------------------------------------------------- - * Function: H5F_super_ext_write_msg() + * Function: H5F__super_ext_write_msg() * * Purpose: Write the message with ID to the superblock extension * @@ -1540,10 +1514,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, +H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, unsigned mesg_flags) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t ext_created = FALSE; /* Whether superblock extension was created */ hbool_t ext_opened = FALSE; /* Whether superblock extension was opened */ @@ -1551,16 +1524,15 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(f); HDassert(f->shared); HDassert(f->shared->sblock); - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Open/create the superblock extension object header */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) { @@ -1569,7 +1541,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, } /* end if */ else { HDassert(may_create); - if(H5F_super_ext_create(f, dxpl_id, &ext_loc) < 0) + if(H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") ext_created = TRUE; } /* end else */ @@ -1577,7 +1549,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, ext_opened = TRUE; /* Check if message with ID does not exist in the object header */ - if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message or message exists") /* Check for creating vs. writing */ @@ -1586,7 +1558,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should not exist") /* Create the message with ID in the superblock extension */ - if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_create(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to create the message in object header") } /* end if */ else { @@ -1594,17 +1566,17 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, unsigned id, void *mesg, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "Message should exist") /* Update the message with ID in the superblock extension */ - if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg, dxpl_id) < 0) + if(H5O_msg_write(&ext_loc, id, (mesg_flags | H5O_MSG_FLAG_DONTSHARE), H5O_UPDATE_TIME, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to write the message in object header") } /* end else */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close the superblock extension, if it was opened */ - if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, ext_created) < 0) + if(ext_opened && H5F__super_ext_close(f, &ext_loc, ext_created) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") /* Mark superblock dirty in cache, if superblock extension was created */ @@ -1612,11 +1584,11 @@ done: HDONE_ERROR(H5E_FILE, H5E_CANTMARKDIRTY, FAIL, "unable to mark superblock as dirty") FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_write_msg() */ +} /* H5F__super_ext_write_msg() */ /*------------------------------------------------------------------------- - * Function: H5F_super_ext_remove_msg + * Function: H5F__super_ext_remove_msg * * Purpose: Remove the message with ID from the superblock extension * @@ -1627,9 +1599,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) +H5F__super_ext_remove_msg(H5F_t *f, unsigned id) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ H5O_loc_t ext_loc; /* "Object location" for superblock extension */ hbool_t ext_opened = FALSE; /* Whether the superblock extension was opened */ @@ -1637,14 +1608,13 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Make sure that the superblock extension object header exists */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_SBE, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set ring value") + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_SBE, &orig_ring); /* Open superblock extension object header */ if(H5F_super_ext_open(f, f->shared->sblock->ext_addr, &ext_loc) < 0) @@ -1652,26 +1622,26 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) ext_opened = TRUE; /* Check if message with ID exists in the object header */ - if((status = H5O_msg_exists(&ext_loc, id, dxpl_id)) < 0) + if((status = H5O_msg_exists(&ext_loc, id)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check object header for message") else if(status) { /* message exists */ H5O_hdr_info_t hdr_info; /* Object header info for superblock extension */ /* Remove the message */ - if(H5O_msg_remove(&ext_loc, id, H5O_ALL, TRUE, dxpl_id) < 0) + if(H5O_msg_remove(&ext_loc, id, H5O_ALL, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete free-space manager info message") /* Get info for the superblock extension's object header */ - if(H5O_get_hdr_info(&ext_loc, dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&ext_loc, &hdr_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve superblock extension info") /* If the object header is an empty base chunk, remove superblock extension */ if(hdr_info.nchunks == 1) { - if((null_count = H5O_msg_count(&ext_loc, H5O_NULL_ID, dxpl_id)) < 0) + if((null_count = H5O_msg_count(&ext_loc, H5O_NULL_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") else if((unsigned)null_count == hdr_info.nmesgs) { HDassert(H5F_addr_defined(ext_loc.addr)); - if(H5O_delete(f, dxpl_id, ext_loc.addr) < 0) + if(H5O_delete(f, ext_loc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") f->shared->sblock->ext_addr = HADDR_UNDEF; } /* end if */ @@ -1679,14 +1649,14 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) } /* end if */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Close superblock extension object header, if opened */ - if(ext_opened && H5F_super_ext_close(f, &ext_loc, dxpl_id, FALSE) < 0) + if(ext_opened && H5F__super_ext_close(f, &ext_loc, FALSE) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close file's superblock extension") FUNC_LEAVE_NOAPI(ret_value) -} /* H5F_super_ext_remove_msg() */ +} /* H5F__super_ext_remove_msg() */ diff --git a/src/H5Ftest.c b/src/H5Ftest.c index dd69b1e..df062ff 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -38,6 +38,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Gpkg.h" /* Groups */ @@ -98,6 +99,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, size_t *mesg_count) { H5F_t *file; /* File info */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -105,12 +107,17 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Retrieve count for message type */ - if(H5SM_get_mesg_count_test(file, H5AC_ind_read_dxpl_id, type_id, mesg_count) < 0) + if(H5SM__get_mesg_count_test(file, type_id, mesg_count) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve shared message count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_sohm_mesg_count_test() */ @@ -135,6 +142,7 @@ herr_t H5F_check_cached_stab_test(hid_t file_id) { H5F_t *file; /* File info */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -142,12 +150,17 @@ H5F_check_cached_stab_test(hid_t file_id) /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Verify the cached stab info */ if(H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_check_cached_stab_test() */ diff --git a/src/H5G.c b/src/H5G.c index 10eb5ed..4ba43c0 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -85,6 +85,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -133,7 +134,7 @@ static const H5I_class_t H5I_GROUP_CLS[1] = {{ H5I_GROUP, /* ID class value */ 0, /* Class flags */ 0, /* # of reserved IDs for class */ - (H5I_free_t)H5G_close /* Callback routine for closing objects of this class */ + (H5I_free_t)H5G__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -275,7 +276,7 @@ H5G_term_package(void) * writing. Call H5Gclose() when finished with * the group. * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * April 5, 2007 @@ -288,47 +289,53 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, { H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE5("i", "i*siii", loc_id, name, lcpl_id, gcpl_id, gapl_id); /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") /* Get correct property list */ if(H5P_DEFAULT == lcpl_id) lcpl_id = H5P_LINK_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not link creation property list") /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id, gapl_id, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") + if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate2() */ @@ -361,7 +368,7 @@ done: * writing. Call H5Gclose() when finished with * the group. * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Peter Cao * May 08, 2005 @@ -374,26 +381,30 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) H5G_loc_t loc; H5G_t *grp = NULL; H5G_obj_create_t gcrt_info; /* Information for group creation */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iii", loc_id, gcpl_id, gapl_id); /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; else if(TRUE != H5P_isa_class(gcpl_id, H5P_GROUP_CREATE)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group create property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not group create property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -401,10 +412,10 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") + if(NULL == (grp = H5G__create_anon(loc.oloc->file, &gcrt_info))) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: /* Release the group's object header, if it was created */ @@ -413,18 +424,20 @@ done: /* Get the new group's object location */ if(NULL == (oloc = H5G_oloc(grp))) - HDONE_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object location of group") + HDONE_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to get object location of group") /* Decrement refcount on group's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") + if(H5O_dec_rc_by_loc(oloc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "unable to decrement refcount on newly created object") } /* end if */ /* Cleanup on failure */ if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate_anon() */ @@ -439,7 +452,7 @@ done: * Property List, which H5Gopen1() does not. * * Return: Success: Object ID of the group. - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: James Laird * Thursday, July 27, 2006 @@ -451,36 +464,41 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "i*si", loc_id, name, gapl_id); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&gapl_id, H5P_CLS_GACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&gapl_id, H5P_CLS_GACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the group */ - if((grp = H5G__open_name(&loc, name, gapl_id, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G__open_name(&loc, name))) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open group") /* Register an ID for the group */ if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register group") done: - if(ret_value < 0) { + if(ret_value < 0) if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - } /* end if */ + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen2() */ @@ -494,7 +512,7 @@ done: * property list. The property list ID should be * released by calling H5Pclose(). * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -504,20 +522,28 @@ done: hid_t H5Gget_create_plist(hid_t group_id) { - H5G_t *group = NULL; - hid_t ret_value = FAIL; + H5G_t *group = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", group_id); /* Check args */ if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a group") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; - if((ret_value = H5G_get_create_plist(group)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + if((ret_value = H5G__get_create_plist(group)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_create_plist() */ @@ -540,6 +566,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) { H5I_type_t id_type; /* Type of ID */ H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -556,11 +583,18 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) if(H5G_loc(grp_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the group's information */ - if(H5G__obj_info(loc.oloc, grp_info/*out*/, H5AC_ind_read_dxpl_id) < 0) + if(H5G__get_info(&loc, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info() */ @@ -583,11 +617,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t grp_loc; /* Location used to open group */ - H5G_name_t grp_path; /* Opened object group hier. path */ - H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -601,28 +631,21 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - grp_loc.oloc = &grp_oloc; - grp_loc.path = &grp_path; - H5G_loc_reset(&grp_loc); - - /* Find the group object */ - if(H5G_loc_find(&loc, name, &grp_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ - if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, dxpl_id) < 0) + if(H5G__get_info_by_name(&loc, name, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: - if(loc_found && H5G_loc_free(&grp_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_name() */ @@ -646,11 +669,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t grp_loc; /* Location used to open group */ - H5G_name_t grp_path; /* Opened object group hier. path */ - H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -669,30 +688,21 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - grp_loc.oloc = &grp_oloc; - grp_loc.path = &grp_path; - H5G_loc_reset(&grp_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &grp_loc/*out*/, - lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the group's information */ - if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, dxpl_id) < 0) + if(H5G__get_info_by_idx(&loc, group_name, idx_type, order, n, grp_info/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: - /* Release the object location */ - if(loc_found && H5G_loc_free(&grp_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_info_by_idx() */ @@ -713,6 +723,7 @@ done: herr_t H5Gclose(hid_t group_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -721,6 +732,10 @@ H5Gclose(hid_t group_id) /* Check args */ if(NULL == H5I_object_verify(group_id,H5I_GROUP)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* * Decrement the counter on the group atom. It will be freed if the count @@ -730,6 +745,8 @@ H5Gclose(hid_t group_id) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gclose() */ @@ -749,8 +766,9 @@ done: herr_t H5Gflush(hid_t group_id) { - H5G_t *grp; /* Dataset for this operation */ - herr_t ret_value = SUCCEED; /* return value */ + H5G_t *grp; /* Group for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); @@ -759,11 +777,21 @@ H5Gflush(hid_t group_id) if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - /* Flush object's metadata to file */ - if(H5O_flush_common(&grp->oloc, group_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group and object flush callback") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Flush group's metadata to file */ + if(H5G__flush(grp, group_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Gflush */ @@ -771,7 +799,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Grefresh * - * Purpose: Refreshes all buffers associated with a dataset. + * Purpose: Refreshes all buffers associated with a group. * * Return: Non-negative on success, negative on failure * @@ -783,8 +811,9 @@ done: herr_t H5Grefresh(hid_t group_id) { - H5G_t * grp = NULL; - herr_t ret_value = SUCCEED; /* return value */ + H5G_t *grp; /* Group for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); @@ -793,11 +822,21 @@ H5Grefresh(hid_t group_id) if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(group_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call private function to refresh group object */ - if ((H5O_refresh_metadata(group_id, grp->oloc, H5AC_ind_read_dxpl_id)) < 0) + if((H5G__refresh(grp, group_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Grefresh */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 71d15e5..9ac31a2 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -53,7 +53,6 @@ typedef struct H5G_fh_ud_cmp_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of link to compare */ H5B2_found_t found_op; /* Callback when correct link is found */ void *found_op_data; /* Callback data when correct link is found */ @@ -164,7 +163,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_uda FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Compare the string values */ @@ -264,7 +263,6 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.found_op = bt2_udata->found_op; fh_udata.found_op_data = bt2_udata->found_op_data; @@ -273,8 +271,7 @@ for(u = 0; u < H5G_DENSE_FHEAP_ID_LEN; u++) fh_udata.cmp = 0; /* Check if the user's link and the B-tree's link have the same name */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, bt2_rec->id, - H5G_dense_fh_name_cmp, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, bt2_rec->id, H5G_dense_fh_name_cmp, &fh_udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") /* Callback will set comparison value */ diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index d5698a8..aae5496 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -42,7 +42,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *file; /* File that object header is located within */ - hid_t dxpl_id; /* DXPL during insertion */ H5RS_str_t *grp_full_path_r;/* Full path for group of link */ const char *name; /* Link name to search for */ } H5G_iter_rm_t; @@ -61,7 +60,7 @@ typedef struct { /* PRIVATE PROTOTYPES */ static herr_t H5G_compact_build_table_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, +static herr_t H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); @@ -107,7 +106,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_build_table + * Function: H5G__compact_build_table * * Purpose: Builds a table containing a sorted (alphabetically) list of * links for a group @@ -121,12 +120,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc); @@ -153,7 +152,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t /* Iterate through the link messages, adding them to the table */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_compact_build_table_cb; - if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages") /* Sort link table in correct iteration order */ @@ -165,7 +164,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_build_table() */ +} /* end H5G__compact_build_table() */ /*------------------------------------------------------------------------- @@ -184,8 +183,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, - hid_t dxpl_id) +H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk) { herr_t ret_value = SUCCEED; /* Return value */ @@ -196,7 +194,7 @@ H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, HDassert(obj_lnk); /* Insert link message into group */ - if(H5O_msg_create(grp_oloc, H5O_LINK_ID, 0, H5O_UPDATE_TIME, obj_lnk, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_LINK_ID, 0, H5O_UPDATE_TIME, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") done: @@ -218,9 +216,9 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t idx, char* name, size_t size) +H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char* name, + size_t size) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ ssize_t ret_value = -1; /* Return value */ @@ -231,7 +229,7 @@ H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, HDassert(oloc); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -287,7 +285,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi /* If we've found the right link, get the object type */ if(HDstrcmp(lnk->name, udata->name) == 0) { /* Replace path names for link being removed */ - if(H5G__link_name_replace(udata->file, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->file, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object type") /* Stop the iteration, we found the correct link */ @@ -312,7 +310,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name) { H5G_iter_rm_t udata; /* Data to pass through OH iteration */ @@ -325,12 +323,11 @@ H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_p /* Initialize data to pass through object header iteration */ udata.file = oloc->file; - udata.dxpl_id = dxpl_id; udata.grp_full_path_r = grp_full_path_r; udata.name = name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE, dxpl_id) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -351,9 +348,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n) +H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, + H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, + hsize_t n) { H5G_link_table_t ltable = {0, NULL};/* Link table */ H5G_iter_rm_t udata; /* Data to pass through OH iteration */ @@ -365,7 +362,7 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, HDassert(linfo); /* Build table of all link messages, sorted according to desired order */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -374,12 +371,11 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, /* Initialize data to pass through object header iteration */ udata.file = oloc->file; - udata.dxpl_id = dxpl_id; udata.grp_full_path_r = grp_full_path_r; udata.name = ltable.lnks[n].name; /* Iterate over the link messages to delete the right one */ - if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE, dxpl_id) < 0) + if(H5O_msg_remove_op(oloc, H5O_LINK_ID, H5O_FIRST, H5G_compact_remove_common_cb, &udata, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link message") done: @@ -404,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { @@ -419,7 +415,7 @@ H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *li HDassert(op); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Iterate over links in table */ @@ -496,8 +492,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk) { H5G_iter_lkp_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Message operator */ @@ -517,7 +512,7 @@ H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, /* Iterate through the link messages, adding them to the table */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_compact_lookup_cb; - if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages") /* Determine if we found the link we were looking for */ @@ -543,7 +538,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5G_link_table_t ltable = {0, NULL};/* Link table */ @@ -557,7 +552,7 @@ H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo HDassert(lnk); /* Build table of all link messages, sorted according to desired order */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Check for going out of bounds */ @@ -592,7 +587,7 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_get_type_by_idx(H5O_loc_t *oloc, const H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ @@ -604,7 +599,7 @@ H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t * HDassert(oloc); /* Build table of all link messages */ - if(H5G_compact_build_table(oloc, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + if(H5G__compact_build_table(oloc, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5G_UNKNOWN, "can't create link message table") /* Check for going out of bounds */ @@ -625,7 +620,7 @@ H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t * tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") /* Map to group object type */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 4ae6800..181a399 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -83,7 +83,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ hsize_t count; /* # of links examined */ @@ -103,7 +102,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Copy of link */ @@ -129,7 +127,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ haddr_t corder_bt2_addr; /* Address of v2 B-tree indexing creation order */ H5RS_str_t *grp_full_path_r; /* Full path of group where link is removed */ hbool_t replace_names; /* Whether to replace the names of open objects */ @@ -142,7 +139,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ H5_index_t idx_type; /* Primary index for removing link */ haddr_t other_bt2_addr; /* Address of "other" v2 B-tree indexing link */ @@ -156,7 +152,6 @@ typedef struct { typedef struct { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Pointer to link to remove */ @@ -169,7 +164,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ /* downward (from application) */ @@ -187,7 +181,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* downward (from application) */ char *name; /* Name buffer to fill */ @@ -204,7 +197,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ /* upward */ @@ -218,7 +210,6 @@ typedef struct { typedef struct { /* downward (internal) */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5O_link_t *lnk; /* Pointer to link */ @@ -265,8 +256,7 @@ typedef struct { *------------------------------------------------------------------------- */ herr_t -H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - const H5O_pline_t *pline) +H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ @@ -298,7 +288,7 @@ H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, fheap_cparam.pline = *pline; /* Create fractal heap for storing links */ - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create fractal heap") /* Retrieve the heap's address in the file */ @@ -325,7 +315,7 @@ HDfprintf(stderr, "%s: fheap_id_len = %Zu\n", FUNC, fheap_id_len); (uint32_t)fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_NAME_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_NAME_BT2_MERGE_PERC; - if(NULL == (bt2_name = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_name = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for name index") /* Retrieve the v2 B-tree's address in the file */ @@ -346,7 +336,7 @@ HDfprintf(stderr, "%s: linfo->name_bt2_addr = %a\n", FUNC, linfo->name_bt2_addr) (uint32_t)fheap_id_len; /* Fractal heap ID */ bt2_cparam.split_percent = H5G_CORDER_BT2_SPLIT_PERC; bt2_cparam.merge_percent = H5G_CORDER_BT2_MERGE_PERC; - if(NULL == (bt2_corder = H5B2_create(f, dxpl_id, &bt2_cparam, NULL))) + if(NULL == (bt2_corder = H5B2_create(f, &bt2_cparam, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create v2 B-tree for creation order index") /* Retrieve the v2 B-tree's address in the file */ @@ -359,11 +349,11 @@ HDfprintf(stderr, "%s: linfo->corder_bt2_addr = %a\n", FUNC, linfo->corder_bt2_a done: /* Close the open objects */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) @@ -384,8 +374,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - const H5O_link_t *lnk) +H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) { H5G_bt2_ud_ins_t udata; /* User data for v2 B-tree insertion */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -430,20 +419,19 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't encode link") /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Insert the serialized link into the fractal heap */ - if(H5HF_insert(fheap, dxpl_id, link_size, link_ptr, udata.id) < 0) + if(H5HF_insert(fheap, link_size, link_ptr, udata.id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Create the callback information for v2 B-tree record insertion */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = lnk->name; udata.common.name_hash = H5_checksum_lookup3(lnk->name, HDstrlen(lnk->name), 0); @@ -453,28 +441,28 @@ HDfprintf(stderr, "%s: HDstrlen(lnk->name) = %Zu, link_size = %Zu\n", FUNC, HDst /* udata.id already set in H5HF_insert() call */ /* Insert link into 'name' tracking v2 B-tree */ - if(H5B2_insert(bt2_name, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_name, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") /* Check if we should create a creation order index v2 B-tree record */ if(linfo->index_corder) { /* Open the creation order index v2 B-tree */ HDassert(H5F_addr_defined(linfo->corder_bt2_addr)); - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, linfo->corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, linfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Insert the record into the creation order index v2 B-tree */ - if(H5B2_insert(bt2_corder, dxpl_id, &udata) < 0) + if(H5B2_insert(bt2_corder, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert record into v2 B-tree") } /* end if */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") @@ -534,8 +522,8 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - const char *name, H5O_link_t *lnk) +H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, + H5O_link_t *lnk) { H5G_bt2_ud_common_t udata; /* User data for v2 B-tree link lookup */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -553,16 +541,15 @@ H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(lnk); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Construct the user data for v2 B-tree callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.name = name; udata.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); @@ -570,14 +557,14 @@ H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.found_op_data = lnk; /* Find & copy the named link in the 'name' index */ - if((ret_value = H5B2_find(bt2_name, dxpl_id, &udata, NULL, NULL)) < 0) + if((ret_value = H5B2_find(bt2_name, &udata, NULL, NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in name index") done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) @@ -608,7 +595,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ - if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Copy link information */ @@ -650,12 +637,10 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.lnk = bt2_udata->lnk; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_lookup_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "link found callback failed") done: @@ -678,7 +663,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -729,26 +714,25 @@ H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_bt2_ud_lbi_t udata; /* User data for v2 B-tree link lookup */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.lnk = lnk; /* Find & copy the link in the appropriate index */ - if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G_dense_lookup_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to locate link in index") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -762,9 +746,9 @@ H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -830,8 +814,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable) +H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, H5G_link_table_t *ltable) { herr_t ret_value = SUCCEED; /* Return value */ @@ -859,7 +843,7 @@ H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.curr_lnk = 0; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) + if(H5G__dense_iterate(f, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ @@ -903,7 +887,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_u * HDF5 routine, it could attempt to re-protect that direct block for the * heap, causing the HDF5 routine called to fail - QAK) */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") done: @@ -942,11 +926,9 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; /* Call fractal heap 'op' routine, to copy the link information */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_iterate_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_iterate_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, H5_ITER_ERROR, "heap op callback failed") /* Make the callback */ @@ -983,9 +965,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data) +H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1038,16 +1020,15 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(H5F_addr_defined(bt2_addr)); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Construct the user data for v2 B-tree iterator callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.skip = skip; udata.count = 0; @@ -1056,7 +1037,7 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, /* Iterate over the records in the v2 B-tree's "native" order */ /* (by hash of name) */ - if((ret_value = H5B2_iterate(bt2, dxpl_id, H5G_dense_iterate_bt2_cb, &udata)) < 0) + if((ret_value = H5B2_iterate(bt2, H5G_dense_iterate_bt2_cb, &udata)) < 0) HERROR(H5E_SYM, H5E_BADITER, "link iteration failed"); /* Update the last link examined, if requested */ @@ -1065,7 +1046,7 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, } /* end if */ else { /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Iterate over links in table */ @@ -1075,9 +1056,9 @@ H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1110,7 +1091,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Get the length of the name */ @@ -1157,13 +1138,11 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Prepare user data for callback */ /* down */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.name = bt2_udata->name; fh_udata.name_size = bt2_udata->name_size; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, record->id, - H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, record->id, H5G_dense_get_name_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link found callback failed") /* Set the name's full length to return */ @@ -1189,9 +1168,8 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, - size_t size) +H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, char *name, size_t size) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1240,22 +1218,21 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, H5G_bt2_ud_gnbi_t udata; /* User data for v2 B-tree callback */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.name = name; udata.name_size = size; /* Retrieve the name according to the v2 B-tree's index order */ - if(H5B2_index(bt2, dxpl_id, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) + if(H5B2_index(bt2, order, n, H5G_dense_get_name_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLIST, FAIL, "can't locate object in v2 B-tree") /* Set return value */ @@ -1263,7 +1240,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1283,9 +1260,9 @@ H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1318,7 +1295,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, FAIL, "can't decode link") /* Check for removing the link from the creation order index */ @@ -1326,7 +1303,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud H5G_bt2_ud_common_t bt2_udata; /* Info for B-tree callbacks */ /* Open the creation order index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(udata->f, udata->dxpl_id, udata->corder_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(udata->f, udata->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Set up the user data for the v2 B-tree 'record remove' callback */ @@ -1334,23 +1311,23 @@ H5G_dense_remove_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, void *_ud bt2_udata.corder = lnk->corder; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, udata->dxpl_id, &bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from creation order index v2 B-tree") } /* end if */ /* Replace open objects' names, if requested */ if(udata->replace_names) - if(H5G__link_name_replace(udata->f, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->f, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link, if requested */ /* (call message "delete" callback directly: *ick* - QAK) */ - if(H5O_link_delete(udata->f, udata->dxpl_id, NULL, lnk) < 0) + if(H5O_link_delete(udata->f, NULL, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") done: /* Release resources */ - if(bt2 && H5B2_close(bt2, udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") if(lnk) H5O_msg_free(H5O_LINK_ID, lnk); @@ -1384,19 +1361,17 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; - fh_udata.dxpl_id = bt2_udata->common.dxpl_id; fh_udata.corder_bt2_addr = bt2_udata->corder_bt2_addr; fh_udata.grp_full_path_r = bt2_udata->grp_full_path_r; fh_udata.replace_names = bt2_udata->replace_names; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->common.fheap, bt2_udata->common.dxpl_id, record->id, - H5G_dense_remove_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->common.fheap, record->id, H5G_dense_remove_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") /* Remove record from fractal heap, if requested */ if(bt2_udata->rem_from_fheap) - if(H5HF_remove(bt2_udata->common.fheap, bt2_udata->common.dxpl_id, record->id) < 0) + if(H5HF_remove(bt2_udata->common.fheap, record->id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from fractal heap") done: @@ -1418,8 +1393,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5RS_str_t *grp_full_path_r, const char *name) +H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, + const char *name) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ @@ -1436,16 +1411,15 @@ H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HDassert(name && *name); /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the name index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = name; udata.common.name_hash = H5_checksum_lookup3(name, HDstrlen(name), 0); @@ -1457,14 +1431,14 @@ H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.replace_names = TRUE; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, dxpl_id, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_remove(bt2, &udata, H5G_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from name index v2 B-tree") done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) @@ -1493,7 +1467,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t H5_ATTR_UNUSED obj_len, vo FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ - if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) + if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, NULL, H5O_LINK_ID, (const unsigned char *)obj))) HGOTO_ERROR(H5E_SYM, H5E_CANTDECODE, H5_ITER_ERROR, "can't decode link") /* Can't operate on link here because the fractal heap block is locked */ @@ -1545,12 +1519,10 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->f; - fh_udata.dxpl_id = bt2_udata->dxpl_id; fh_udata.lnk = NULL; /* Call fractal heap 'op' routine, to perform user callback */ - if(H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, heap_id, - H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) + if(H5HF_op(bt2_udata->fheap, heap_id, H5G_dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") HDassert(fh_udata.lnk); @@ -1568,7 +1540,6 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; - other_bt2_udata.dxpl_id = bt2_udata->dxpl_id; other_bt2_udata.fheap = bt2_udata->fheap; other_bt2_udata.name = fh_udata.lnk->name; other_bt2_udata.name_hash = H5_checksum_lookup3(fh_udata.lnk->name, HDstrlen(fh_udata.lnk->name), 0); @@ -1577,35 +1548,35 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) } /* end else */ /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->other_bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(bt2_udata->f, bt2_udata->other_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for 'other' index") /* Set the common information for the v2 B-tree remove operation */ /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove(bt2, bt2_udata->dxpl_id, &other_bt2_udata, NULL, NULL) < 0) + if(H5B2_remove(bt2, &other_bt2_udata, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, H5_ITER_ERROR, "unable to remove link from 'other' index v2 B-tree") } /* end if */ /* Replace open objects' names */ - if(H5G__link_name_replace(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) + if(H5G__link_name_replace(bt2_udata->f, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link */ /* (call link message "delete" callback directly: *ick* - QAK) */ - if(H5O_link_delete(bt2_udata->f, bt2_udata->dxpl_id, NULL, fh_udata.lnk) < 0) + if(H5O_link_delete(bt2_udata->f, NULL, fh_udata.lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link") /* Release the space allocated for the link */ H5O_msg_free(H5O_LINK_ID, fh_udata.lnk); /* Remove record from fractal heap */ - if(H5HF_remove(bt2_udata->fheap, bt2_udata->dxpl_id, heap_id) < 0) + if(H5HF_remove(bt2_udata->fheap, heap_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from fractal heap") done: /* Release resources */ - if(bt2 && H5B2_close(bt2, bt2_udata->dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for 'other' index") FUNC_LEAVE_NOAPI(ret_value) @@ -1627,9 +1598,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, - H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n) +H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5G_link_table_t ltable = {0, NULL}; /* Table of links */ @@ -1678,28 +1648,27 @@ H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5G_bt2_ud_rmbi_t udata; /* User data for v2 B-tree record removal */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, bt2_addr, NULL))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for index") /* Set up the user data for the v2 B-tree 'remove by index' callback */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.fheap = fheap; udata.idx_type = idx_type; udata.other_bt2_addr = idx_type == H5_INDEX_NAME ? linfo->corder_bt2_addr : linfo->name_bt2_addr; udata.grp_full_path_r = grp_full_path_r; /* Remove the record from the name index v2 B-tree */ - if(H5B2_remove_by_idx(bt2, dxpl_id, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) + if(H5B2_remove_by_idx(bt2, order, n, H5G_dense_remove_by_idx_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from indexed v2 B-tree") } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1707,15 +1676,15 @@ H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound") /* Remove the appropriate link from the dense storage */ - if(H5G__dense_remove(f, dxpl_id, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) + if(H5G__dense_remove(f, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from dense storage") } /* end else */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") @@ -1738,7 +1707,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) +H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1759,12 +1728,11 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) H5G_bt2_ud_rm_t udata; /* User data for v2 B-tree record removal */ /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, linfo->fheap_addr))) + if(NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up the user data for the v2 B-tree 'record remove' callback */ udata.common.f = f; - udata.common.dxpl_id = dxpl_id; udata.common.fheap = fheap; udata.common.name = NULL; udata.common.name_hash = 0; @@ -1776,16 +1744,16 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) udata.replace_names = FALSE; /* Delete the name index, adjusting the ref. count on links removed */ - if(H5B2_delete(f, dxpl_id, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, H5G_dense_remove_bt2_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") /* Close the fractal heap */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") } /* end if */ else { /* Delete the name index, without adjusting the ref. count on the links */ - if(H5B2_delete(f, dxpl_id, linfo->name_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, linfo->name_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for name index") } /* end else */ linfo->name_bt2_addr = HADDR_UNDEF; @@ -1794,7 +1762,7 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) if(linfo->index_corder) { /* Delete the creation order index, without adjusting the ref. count on the links */ HDassert(H5F_addr_defined(linfo->corder_bt2_addr)); - if(H5B2_delete(f, dxpl_id, linfo->corder_bt2_addr, NULL, NULL, NULL) < 0) + if(H5B2_delete(f, linfo->corder_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for creation order index") linfo->corder_bt2_addr = HADDR_UNDEF; } /* end if */ @@ -1802,7 +1770,7 @@ H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) HDassert(!H5F_addr_defined(linfo->corder_bt2_addr)); /* Delete the fractal heap */ - if(H5HF_delete(f, dxpl_id, linfo->fheap_addr) < 0) + if(H5HF_delete(f, linfo->fheap_addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") linfo->fheap_addr = HADDR_UNDEF; @@ -1833,8 +1801,7 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - hsize_t idx) +H5G__dense_get_type_by_idx(H5F_t *f, H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Table of links */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ @@ -1848,7 +1815,7 @@ H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, HDassert(linfo); /* Build the table of links for this group */ - if(H5G__dense_build_table(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + if(H5G__dense_build_table(f, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "error building table of links") /* Check for going out of bounds */ @@ -1869,7 +1836,7 @@ H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, tmp_oloc.addr = ltable.lnks[idx].u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") /* Map to group object type */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 1cc7e15..5835e06 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -37,6 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -59,7 +60,6 @@ typedef struct { H5G_stat_t *statbuf; /* Stat buffer about object */ hbool_t follow_link; /* Whether we are following a link or not */ H5F_t *loc_file; /* Pointer to the file the location is in */ - hid_t dxpl_id; /* Dataset transfer property list */ } H5G_trav_goi_t; @@ -72,17 +72,29 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5G_link_hard(hid_t cur_loc_id, const char *cur_name, - hid_t new_loc_id, const char *new_name); -static herr_t H5G_move(hid_t src_loc_id, const char *src_name, - hid_t dst_loc_id, const char *dst_name); -static herr_t H5G_get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5G__link(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, + hid_t new_loc_id, const char *new_name, hid_t lcpl_id); +static herr_t H5G__move(hid_t src_loc_id, const char *src_name, + hid_t dst_loc_id, const char *dst_name, hid_t lcpl_id); +static herr_t H5G__unlink(H5G_loc_t *loc, const char *name); +static herr_t H5G__get_linkval(const H5G_loc_t *loc, const char *name, size_t size, + char *buf/*out*/); +static herr_t H5G__set_comment(const H5G_loc_t *loc, const char *name, + const char *comment); +static int H5G__get_comment(const H5G_loc_t *loc, const char *name, char *buf, + size_t bufsize); +static herr_t H5G__iterate(hid_t loc_id, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data); +static herr_t H5G__get_num_objs(const H5O_loc_t *oloc, H5G_info_t *grp_info); +static herr_t H5G__get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5G_get_objinfo(const H5G_loc_t *loc, const char *name, - hbool_t follow_link, H5G_stat_t *statbuf/*out*/, hid_t dxpl_id); -static H5G_obj_t H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, - hid_t dxpl_id); +static herr_t H5G__get_objinfo(const H5G_loc_t *loc, const char *name, + hbool_t follow_link, H5G_stat_t *statbuf/*out*/); +static ssize_t H5G__get_objname_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, char *name, size_t size); +static H5G_obj_t H5G__obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -178,6 +190,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) H5G_loc_t loc; /* Location to create group */ H5G_t *grp = NULL; /* New group created */ hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -218,12 +231,19 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) else tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Create the new group & get its ID */ - if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, - tmp_gcpl, H5P_GROUP_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id))) + if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group") done: if(tmp_gcpl > 0 && tmp_gcpl != H5P_GROUP_CREATE_DEFAULT) @@ -233,6 +253,8 @@ done: if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gcreate1() */ @@ -260,6 +282,7 @@ H5Gopen1(hid_t loc_id, const char *name) { H5G_t *grp = NULL; /* Group opened */ H5G_loc_t loc; /* Location of parent for group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -271,8 +294,13 @@ H5Gopen1(hid_t loc_id, const char *name) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + /* Open the group */ - if((grp = H5G__open_name(&loc, name, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) == NULL) + if(NULL == (grp = H5G__open_name(&loc, name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an atom for the group */ @@ -280,10 +308,11 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") done: - if(ret_value < 0) { + if(ret_value < 0) if(grp && H5G_close(grp) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - } /* end if */ +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gopen1() */ @@ -300,6 +329,7 @@ done: herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -311,25 +341,21 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") - if(type == H5L_TYPE_HARD) { - if((ret_value = H5G_link_hard(cur_loc_id, cur_name, H5L_SAME_LOC, new_name)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't create link") - } /* end if */ - else if(type == H5L_TYPE_SOFT) { - H5G_loc_t cur_loc; /* Group location for new link */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Finish checking arguments */ - if(H5G_loc(cur_loc_id, &cur_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Create the link */ - if(H5L_create_soft(cur_name, &cur_loc, new_name, H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") - } /* end else if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid link type") + /* Call internal routine to create link */ + if(H5G__link(cur_loc_id, cur_name, type, H5L_SAME_LOC, new_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink() */ @@ -346,6 +372,7 @@ herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -357,86 +384,94 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, if(!new_name || !*new_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new name specified") - if(type == H5L_TYPE_HARD) { - if((ret_value = H5G_link_hard(cur_loc_id, cur_name, new_loc_id, new_name)) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't create link") - } /* end if */ - else if(type == H5L_TYPE_SOFT) { - H5G_loc_t new_loc; /* Group location for new link */ - - /* Soft links only need one location, the new_loc_id, but it's possible that - * new_loc_id is H5L_SAME_LOC */ - if(new_loc_id == H5L_SAME_LOC) - new_loc_id = cur_loc_id; - - /* Finish checking arguments */ - if(H5G_loc(new_loc_id, &new_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") - /* Create the link */ - if(H5L_create_soft(cur_name, &new_loc, new_name, H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") - } /* end else if */ - else - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid link type") + /* Call internal routine to create link */ + if(H5G__link(cur_loc_id, cur_name, type, new_loc_id, new_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "couldn't create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Glink2() */ /*------------------------------------------------------------------------- - * Function: H5G_link_hard + * Function: H5G__link * - * Purpose: Creates a hard link from NEW_NAME to CUR_NAME. - * - * CUR_NAME must name an existing object. CUR_NAME and - * NEW_NAME are interpreted relative to CUR_LOC_ID and - * NEW_LOC_ID, which are either file IDs or group IDs. + * Purpose: Internal routine to create a new link. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * Monday, November 6, 2006 + * Monday, December 18, 2017 * *------------------------------------------------------------------------- */ static herr_t -H5G_link_hard(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, - const char *new_name) +H5G__link(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, + hid_t new_loc_id, const char *new_name, hid_t lcpl_id) { - H5G_loc_t cur_loc, *cur_loc_p; /* Information about current link's group */ - H5G_loc_t new_loc, *new_loc_p; /* Information about new link's group */ - herr_t ret_value = SUCCEED; /* Return value */ + H5G_loc_t new_loc; /* Information about new link's group */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL - /* Finish checking arguments */ - if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC") - if(cur_loc_id != H5L_SAME_LOC && H5G_loc(cur_loc_id, &cur_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(new_loc_id != H5L_SAME_LOC && H5G_loc(new_loc_id, &new_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + /* Create the appropriate kind of link */ + if(type == H5L_TYPE_HARD) { + H5G_loc_t cur_loc, *cur_loc_p; /* Information about current link's group */ + H5G_loc_t *new_loc_p; /* Information about new link's group */ + + /* Finish checking arguments */ + if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not be both H5L_SAME_LOC") + if(cur_loc_id != H5L_SAME_LOC && H5G_loc(cur_loc_id, &cur_loc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") + if(new_loc_id != H5L_SAME_LOC && H5G_loc(new_loc_id, &new_loc) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") + + /* Set up current & new location pointers */ + cur_loc_p = &cur_loc; + new_loc_p = &new_loc; + if(cur_loc_id == H5L_SAME_LOC) + cur_loc_p = new_loc_p; + else if(new_loc_id == H5L_SAME_LOC) + new_loc_p = cur_loc_p; + else if(cur_loc_p->oloc->file != new_loc_p->oloc->file) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") + + /* Create the link */ + if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") + } /* end if */ + else if(type == H5L_TYPE_SOFT) { + /* Soft links only need one location, the new_loc_id, but it's possible + * that new_loc_id is H5L_SAME_LOC + */ + if(new_loc_id == H5L_SAME_LOC) + new_loc_id = cur_loc_id; + + /* Finish checking arguments */ + if(H5G_loc(new_loc_id, &new_loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - /* Set up current & new location pointers */ - cur_loc_p = &cur_loc; - new_loc_p = &new_loc; - if(cur_loc_id == H5L_SAME_LOC) - cur_loc_p = new_loc_p; - else if(new_loc_id == H5L_SAME_LOC) - new_loc_p = cur_loc_p; - else if(cur_loc_p->oloc->file != new_loc_p->oloc->file) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") - - /* Create the link */ - if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, - H5P_DEFAULT, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + /* Create the link */ + if(H5L_create_soft(cur_name, &new_loc, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create link") + } /* end else if */ + else + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "Not a valid link type") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_hard() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__link() */ /*------------------------------------------------------------------------- @@ -449,16 +484,27 @@ done: herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call common routine to move the link */ - if(H5G_move(src_loc_id, src_name, H5L_SAME_LOC, dst_name) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't move link") + if(H5G__move(src_loc_id, src_name, H5L_SAME_LOC, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove() */ @@ -474,22 +520,37 @@ herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*si*s", src_loc_id, src_name, dst_loc_id, dst_name); + /* Check arguments */ + if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(dst_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* Call common routine to move the link */ - if(H5G_move(src_loc_id, src_name, dst_loc_id, dst_name) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "couldn't move link") + if(H5G__move(src_loc_id, src_name, dst_loc_id, dst_name, H5P_LINK_CREATE_DEFAULT) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "couldn't move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gmove2() */ /*------------------------------------------------------------------------- - * Function: H5G_move + * Function: H5G__move * * Purpose: Renames an object within an HDF5 file and moves it to a new * group. The original name SRC is unlinked from the group graph @@ -506,26 +567,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, - const char *dst_name) +H5G__move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, + const char *dst_name, hid_t lcpl_id) { H5G_loc_t src_loc, *src_loc_p; /* Group info for source location */ H5G_loc_t dst_loc, *dst_loc_p; /* Group info for destination location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL /* Check arguments */ - if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should not both be H5L_SAME_LOC") if(src_loc_id != H5L_SAME_LOC && H5G_loc(src_loc_id, &src_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(dst_loc_id != H5L_SAME_LOC && H5G_loc(dst_loc_id, &dst_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!src_name || !*src_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no current name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no current name specified") if(!dst_name || !*dst_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no destination name specified") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -536,13 +595,12 @@ H5G_move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, H5P_DEFAULT, - H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") + if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTMOVE, FAIL, "unable to move link") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_move() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__move() */ /*------------------------------------------------------------------------- @@ -556,6 +614,7 @@ herr_t H5Gunlink(hid_t loc_id, const char *name) { H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -563,20 +622,61 @@ H5Gunlink(hid_t loc_id, const char *name) /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name") - /* Call H5L routine... */ - if(H5L_delete(&loc, name, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "couldn't delete link") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__unlink(&loc, name) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gunlink() */ /*------------------------------------------------------------------------- + * Function: H5G__unlink + * + * Purpose: Internal version of H5Gunlink. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__unlink(H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call H5L routine... */ + if(H5L_delete(loc, name) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__unlink() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_linkval * * Purpose: Retrieve's a soft link's data. The new API is @@ -588,6 +688,7 @@ herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -599,16 +700,58 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Call the new link routine which provides this capability */ - if(H5L_get_val(&loc, name, buf, size, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__get_linkval(&loc, name, size, buf) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "couldn't delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_linkval() */ /*------------------------------------------------------------------------- + * Function: H5G__get_linkval + * + * Purpose: Internal version of H5Gget_linkval. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__get_linkval(const H5G_loc_t *loc, const char *name, size_t size, + char *buf/*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the link routine which provides this capability */ + if(H5L_get_val(loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "couldn't get link info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_linkval() */ + + +/*------------------------------------------------------------------------- * Function: H5Gset_comment * * Purpose: Gives the specified object a comment. The COMMENT string @@ -628,7 +771,8 @@ done: herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { - H5G_loc_t loc; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -639,15 +783,57 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(H5G_loc_set_comment(&loc, name, comment, H5P_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to set comment value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if(H5G__set_comment(&loc, name, comment) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gset_comment() */ /*------------------------------------------------------------------------- + * Function: H5G__set_comment + * + * Purpose: Internal version of H5Gset_comment. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__set_comment(const H5G_loc_t *loc, const char *name, const char *comment) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if(H5G_loc_set_comment(loc, name, comment) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "unable to set comment value") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__set_comment() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_comment * * Purpose: Return at most BUFSIZE characters of the comment for the @@ -673,8 +859,9 @@ done: int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { - H5G_loc_t loc; - int ret_value; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); @@ -686,15 +873,58 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) if(bufsize > 0 && !buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no buffer specified") - if((ret_value = (int)H5G_loc_get_comment(&loc, name, buf, bufsize, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to get comment value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine */ + if((ret_value = H5G__get_comment(&loc, name, buf, bufsize)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_comment() */ /*------------------------------------------------------------------------- + * Function: H5G__get_comment + * + * Purpose: Internal version of H5Gget_comment. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static int +H5G__get_comment(const H5G_loc_t *loc, const char *name, char *buf, + size_t bufsize) +{ + int ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if((ret_value = (int)H5G_loc_get_comment(loc, name, buf, bufsize)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get comment value") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_comment() */ + + +/*------------------------------------------------------------------------- * Function: H5Giterate * * Purpose: Iterates over the entries of a group. The LOC_ID and NAME @@ -724,19 +954,20 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, { H5G_link_iterate_t lnk_op; /* Link operator */ hsize_t last_obj; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ + hsize_t idx; /* Internal location to hold index */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); /* Check args */ - if (!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if (idx_p && *idx_p < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") - if (!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if(!name || !*name) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") + if(idx_p && *idx_p < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "invalid index specified") + if(!op) + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no operator specified") /* Set number of objects looked at to zero */ last_obj = 0; @@ -746,20 +977,60 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, lnk_op.op_type = H5G_LINK_OP_OLD; lnk_op.op_func.op_old = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call private function. */ - if ((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G__iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") /* Set the index we stopped at */ - if (idx_p) + if(idx_p) *idx_p = (int)last_obj; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Giterate() */ /*------------------------------------------------------------------------- + * Function: H5G__iterate + * + * Purpose: Internal version of H5Giterate. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__iterate(hid_t loc_id, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data) +{ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Call the common routine which provides this capability */ + if((ret_value = H5G_iterate(loc_id, name, idx_type, order, idx, last_lnk, lnk_op, op_data)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__iterate() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_num_objs * * Purpose: Returns the number of objects in the group. It iterates @@ -778,37 +1049,78 @@ done: herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { - H5G_loc_t loc; /* Location of object */ - H5G_info_t grp_info; /* Group information */ - H5O_type_t obj_type; /* Type of object at location */ - herr_t ret_value = SUCCEED; + H5G_loc_t loc; /* Location of object */ + H5G_info_t grp_info; /* Group information */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", loc_id, num_objs); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") if(!num_objs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "bad pointer to # of objects") - /* Retrieve information about the group */ - if(H5G__obj_info(loc.oloc, &grp_info, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call the internal routine */ + if(H5G__get_num_objs(loc.oloc, &grp_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") /* Set the number of objects [sic: links] in the group */ *num_objs = grp_info.nlinks; done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_num_objs() */ /*------------------------------------------------------------------------- + * Function: H5G__get_num_objs + * + * Purpose: Internal version of H5Gget_num_objs. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G__get_num_objs(const H5O_loc_t *oloc, H5G_info_t *grp_info) +{ + H5O_type_t obj_type; /* Type of object at location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group") + + /* Retrieve information about the group */ + if(H5G__obj_info(oloc, grp_info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine # of objects") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_num_objs() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_objinfo * * Purpose: Returns information about an object. If FOLLOW_LINK is @@ -829,7 +1141,8 @@ herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf/*out*/) { - H5G_loc_t loc; + H5G_loc_t loc; /* Group's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -837,21 +1150,28 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, /* Check arguments */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no name specified") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get info */ - if(H5G_get_objinfo(&loc, name, follow_link, statbuf, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "cannot stat object") + if(H5G__get_objinfo(&loc, name, follow_link, statbuf) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "cannot stat object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objinfo() */ /*------------------------------------------------------------------------- - * Function: H5G_get_objinfo_cb + * Function: H5G__get_objinfo_cb * * Purpose: Callback for retrieving info about an object. This routine * gets the info @@ -864,13 +1184,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL && obj_loc == NULL) @@ -893,7 +1213,7 @@ H5G_get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, co /* Go retrieve the object information */ /* (don't need index & heap info) */ HDassert(obj_loc); - if(H5O_get_info(obj_loc->oloc, udata->dxpl_id, FALSE, &oinfo) < 0) + if(H5O_get_info(obj_loc->oloc, FALSE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") /* Get mapped object type */ @@ -926,11 +1246,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_objinfo_cb() */ +} /* end H5G__get_objinfo_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_get_objinfo + * Function: H5G__get_objinfo * * Purpose: Returns information about an object. * @@ -946,14 +1266,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, - H5G_stat_t *statbuf/*out*/, hid_t dxpl_id) +H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, + H5G_stat_t *statbuf/*out*/) { H5G_trav_goi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_VOL + /* Sanity checks */ HDassert(loc); HDassert(name && *name); @@ -965,11 +1286,10 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, udata.statbuf = statbuf; udata.follow_link = follow_link; udata.loc_file = loc->oloc->file; - udata.dxpl_id = dxpl_id; /* Traverse the group hierarchy to locate the object to get info about */ if(H5G_traverse(loc, name, (unsigned)(follow_link ? H5G_TARGET_NORMAL : H5G_TARGET_SLINK|H5G_TARGET_UDLINK), - H5G_get_objinfo_cb, &udata, H5P_DEFAULT, dxpl_id) < 0) + H5G__get_objinfo_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") /* If we're pointing at a soft or UD link, get the real link length and type */ @@ -980,7 +1300,7 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, /* Get information about link to the object. If this fails, e.g. * because the object is ".", just treat the object as a hard link. */ H5E_BEGIN_TRY { - ret = H5L_get_info(loc, name, &linfo, H5P_DEFAULT, dxpl_id); + ret = H5L_get_info(loc, name, &linfo); } H5E_END_TRY if(ret >= 0 && linfo.type != H5L_TYPE_HARD) { @@ -995,8 +1315,8 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_objinfo() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_objinfo() */ /*------------------------------------------------------------------------- @@ -1025,31 +1345,73 @@ done: ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) { - H5G_loc_t loc; /* Object location */ - H5O_type_t obj_type; /* Type of object at location */ - ssize_t ret_value; + H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + ssize_t ret_value; FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a group") + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a location ID") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Call internal function */ - if((ret_value = H5G_obj_get_name_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G__get_objname_by_idx(loc.oloc, H5_INDEX_NAME, H5_ITER_INC, idx, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objname_by_idx() */ /*------------------------------------------------------------------------- + * Function: H5G__get_objname_by_idx + * + * Purpose: Internal version of H5Gget_objname_by_idx. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * Saturday, December 23, 2017 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5G__get_objname_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t idx, char *name, size_t size) +{ + H5O_type_t obj_type; /* Type of object at location */ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group") + + /* Call common routine */ + if((ret_value = H5G_obj_get_name_by_idx(oloc, idx_type, order, idx, name, size)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object name") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_objname_by_idx() */ + + +/*------------------------------------------------------------------------- * Function: H5Gget_objtype_by_idx * * Purpose: Returns the type of objects in the group by giving index. @@ -1067,9 +1429,9 @@ done: H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { - H5G_loc_t loc; /* Object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_obj_t ret_value; + H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + H5G_obj_t ret_value; FUNC_ENTER_API(H5G_UNKNOWN) H5TRACE2("Go", "ih", loc_id, idx); @@ -1077,22 +1439,25 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) /* Check args */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID") - if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "not a group") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") +api_ctx_pushed = TRUE; /* Call internal function*/ - if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_ind_read_dxpl_id)) == H5G_UNKNOWN) + if(H5G_UNKNOWN == (ret_value = H5G__obj_get_type_by_idx(loc.oloc, idx))) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "can't get object type") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Gget_objtype_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_get_type_by_idx + * Function: H5G__obj_get_type_by_idx * * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. @@ -1107,40 +1472,47 @@ done: *------------------------------------------------------------------------- */ static H5G_obj_t -H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) +H5G__obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ + H5O_type_t obj_type; /* Type of object at location */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_STATIC_VOL_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); + /* Check args */ + if(H5O_obj_type(oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, H5G_UNKNOWN, "not a group") + /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't check for link info message") if(linfo_exists) { if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G__dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__dense_get_type_by_idx(oloc->file, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end if */ else { /* Get the object's type from the link messages */ - if((ret_value = H5G__compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__compact_get_type_by_idx(oloc, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ } /* end if */ else { /* Get the object's type from the symbol table */ - if((ret_value = H5G__stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_type_by_idx(oloc, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5G_UNKNOWN) -} /* end H5G_obj_get_type_by_idx() */ + FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) +} /* end H5G__obj_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gent.c b/src/H5Gent.c index 7987850..4b8b38c 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -387,9 +387,8 @@ H5G__ent_reset(H5G_entry_t *ent) *------------------------------------------------------------------------- */ herr_t -H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, - const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, - H5G_entry_t *ent) +H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk, + H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent) { size_t name_offset; /* Offset of name in heap */ herr_t ret_value = SUCCEED; /* Return value */ @@ -408,7 +407,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, /* * Add the new name to the heap. */ - name_offset = H5HL_insert(f, dxpl_id, heap, HDstrlen(name) + 1, name); + name_offset = H5HL_insert(f, heap, HDstrlen(name) + 1, name); if(0 == name_offset || UFAIL == name_offset) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert symbol name into heap") ent->name_off = name_offset; @@ -436,8 +435,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, targ_oloc.addr = lnk->u.hard.addr; /* Check if a symbol table message exists */ - if((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID, - dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") HDassert(!stab_exists); @@ -458,23 +456,20 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, targ_oloc.addr = lnk->u.hard.addr; /* Get the object header */ - if(NULL == (oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, FAIL, "unable to protect target object header") /* Check if a symbol table message exists */ if((stab_exists = H5O_msg_exists_oh(oh, H5O_STAB_ID)) < 0) { - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) - < 0) + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") } /* end if */ if(stab_exists) { /* Read symbol table message */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_STAB_ID, - &stab)) { - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, - H5AC__NO_FLAGS_SET) < 0) + if(NULL == H5O_msg_read_oh(f, oh, H5O_STAB_ID, &stab)) { + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HERROR(H5E_SYM, H5E_CANTUNPROTECT, "unable to release object header"); HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read STAB message") } /* end if */ @@ -488,8 +483,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, /* No symbol table message, don't cache anything */ ent->type = H5G_NOTHING_CACHED; - if(H5O_unprotect(&targ_oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) - < 0) + if(H5O_unprotect(&targ_oloc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") } /* end else */ else @@ -503,7 +497,7 @@ H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, size_t lnk_offset; /* Offset to sym-link value */ /* Insert link value into local heap */ - if(UFAIL == (lnk_offset = H5HL_insert(f, dxpl_id, heap, + if(UFAIL == (lnk_offset = H5HL_insert(f, heap, HDstrlen(lnk->u.soft.name) + 1, lnk->u.soft.name))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write link value to local heap") diff --git a/src/H5Gint.c b/src/H5Gint.c index 6d33716..3b5de44 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -66,8 +66,6 @@ typedef struct { typedef struct { hid_t gid; /* The group ID for the starting group */ H5G_loc_t *curr_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Iteration order within index */ H5SL_t *visited; /* Skip list for tracking visited nodes */ @@ -88,7 +86,7 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5G_open_oid(H5G_t *grp, hid_t dxpl_id); +static herr_t H5G__open_oid(H5G_t *grp); /*********************/ @@ -130,21 +128,19 @@ H5FL_DEFINE(H5_obj_t); */ H5G_t * H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, - hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id) + hid_t gcpl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5G_obj_create_t gcrt_info; /* Information for group creation */ H5G_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check arguments */ HDassert(loc); HDassert(name && *name); HDassert(lcpl_id != H5P_DEFAULT); HDassert(gcpl_id != H5P_DEFAULT); - HDassert(gapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -157,7 +153,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, ocrt_info.new_obj = NULL; /* Create the new group and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, gapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create and link to group") HDassert(ocrt_info.new_obj); @@ -165,11 +161,48 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, ret_value = (H5G_t *)ocrt_info.new_obj; done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5G__create_named() */ /*------------------------------------------------------------------------- + * Function: H5G__create_anon + * + * Purpose: Internal routine to create a new anonymous group. + * + * Note: This routine is needed so that there's a non-API routine for + * creating groups that can set up VOL / SWMR info + * (which need a DXPL). + * + * Return: Success: Non-NULL, pointer to new group object. + * Failure: NULL + * + * Programmer: Quincey Koziol + * December 17, 2017 + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G__create_anon(H5F_t *file, H5G_obj_create_t *gcrt_info) +{ + H5G_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(file); + HDassert(gcrt_info); + + /* Create the new group & get its ID */ + if(NULL == (ret_value = H5G__create(file, gcrt_info))) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, NULL, "unable to create group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__create_anon() */ + + +/*------------------------------------------------------------------------- * Function: H5G__create * * Purpose: Creates a new empty group with the specified name. The name @@ -188,7 +221,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) +H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info) { H5G_t *grp = NULL; /*new group */ unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ @@ -199,7 +232,6 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) /* check args */ HDassert(file); HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* create an open group */ if(NULL == (grp = H5FL_CALLOC(H5G_t))) @@ -208,7 +240,7 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Create the group object header */ - if(H5G__obj_create(file, dxpl_id, gcrt_info, &(grp->oloc)/*out*/) < 0) + if(H5G__obj_create(file, gcrt_info, &(grp->oloc)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group object header") oloc_init = 1; /* Indicate that the object location information is valid */ @@ -228,11 +260,11 @@ done: if(ret_value == NULL) { /* Check if we need to release the file-oriented symbol table info */ if(oloc_init) { - if(H5O_dec_rc_by_loc(&(grp->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(grp->oloc)) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") if(H5O_close(&(grp->oloc), NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release object header") - if(H5O_delete(file, dxpl_id, grp->oloc.addr) < 0) + if(H5O_delete(file, grp->oloc.addr) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, NULL, "unable to delete object header") } /* end if */ if(grp != NULL) { @@ -260,8 +292,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, - hid_t dxpl_id) +H5G__open_name(const H5G_loc_t *loc, const char *name) { H5G_t *grp = NULL; /* Group to open */ H5G_loc_t grp_loc; /* Location used to open group */ @@ -271,7 +302,7 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, H5O_type_t obj_type; /* Type of object at location */ H5G_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(loc); @@ -282,31 +313,30 @@ H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, grp_loc.path = &grp_path; H5G_loc_reset(&grp_loc); - /* Find the group object using the gapl passed in */ - if(H5G_loc_find(loc, name, &grp_loc/*out*/, gapl_id, dxpl_id) < 0) + /* Find the group object */ + if(H5G_loc_find(loc, name, &grp_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found") loc_found = TRUE; /* Check that the object found is the correct type */ - if(H5O_obj_type(&grp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&grp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't get object type") if(obj_type != H5O_TYPE_GROUP) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, NULL, "not a group") /* Open the group */ - if((grp = H5G_open(&grp_loc, dxpl_id)) == NULL) + if(NULL == (grp = H5G_open(&grp_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group") /* Set return value */ ret_value = grp; done: - if(!ret_value) { + if(!ret_value) if(loc_found && H5G_loc_free(&grp_loc) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, NULL, "can't free location") - } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5G__open_name() */ @@ -326,7 +356,7 @@ done: *------------------------------------------------------------------------- */ H5G_t * -H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) +H5G_open(const H5G_loc_t *loc) { H5G_t *grp = NULL; /* Group opened */ H5G_shared_t *shared_fo; /* Shared group object */ @@ -354,7 +384,7 @@ H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the group object */ - if(H5G_open_oid(grp, dxpl_id) < 0) + if(H5G__open_oid(grp) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "not found") /* Add group to list of open objects in file */ @@ -404,7 +434,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_open_oid + * Function: H5G__open_oid * * Purpose: Opens an existing group. The group should eventually be * closed by calling H5G_close(). @@ -419,12 +449,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_open_oid(H5G_t *grp, hid_t dxpl_id) +H5G__open_oid(H5G_t *grp) { hbool_t obj_opened = FALSE; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(grp); @@ -439,8 +469,8 @@ H5G_open_oid(H5G_t *grp, hid_t dxpl_id) obj_opened = TRUE; /* Check if this object has the right message(s) to be treated as a group */ - if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id) <= 0) - && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id) <= 0)) + if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID) <= 0) + && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID) <= 0)) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "not a group") done: @@ -452,7 +482,39 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_open_oid() */ +} /* end H5G__open_oid() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__close_cb + * + * Purpose: Closes the specified group. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Sunday, February 18, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__close_cb(H5G_t *grp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check args */ + HDassert(grp && grp->shared); + HDassert(grp->shared->fo_count > 0); + + /* Call actual group close routine */ + if(H5G_close(grp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "problem closing group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__close_cb() */ /*------------------------------------------------------------------------- @@ -495,16 +557,16 @@ H5G_close(H5G_t *grp) /* Remove the group from the list of opened objects in the file */ if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(grp->oloc.file, H5AC_ind_read_dxpl_id, grp->oloc.addr) < 0) + if(H5FO_delete(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") if(H5O_close(&(grp->oloc), &file_closed) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") /* Evict group metadata if evicting on close */ if(!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { - if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") - if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata") } /* end if */ @@ -526,7 +588,8 @@ H5G_close(H5G_t *grp) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "problem attempting to free location") /* If this group is a mount point and the mount point is the last open - * reference to the group, then attempt to close down the file hierarchy + * reference to the group (i.e. fo_count == 1 now), then attempt to + * close down the file hierarchy */ if(grp->shared->mounted && grp->shared->fo_count == 1) { /* Attempt to close down the file hierarchy */ @@ -794,7 +857,7 @@ done: herr_t H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id) + const H5G_link_iterate_t *lnk_op, void *op_data) { H5G_loc_t loc; /* Location of parent for group */ hid_t gid = -1; /* ID of group to iterate over */ @@ -815,7 +878,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, */ if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(NULL == (grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id))) + if(NULL == (grp = H5G__open_name(&loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -826,7 +889,7 @@ H5G_iterate(hid_t loc_id, const char *group_name, udata.op_data = op_data; /* Call the real group iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata, dxpl_id)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") done: @@ -935,7 +998,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) /* Find the object using the LAPL passed in */ /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -949,7 +1012,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) unsigned rc; /* Reference count of object */ /* Get the object's reference count and type */ - if(H5O_get_rc_and_type(&obj_oloc, udata->dxpl_id, &rc, &otype) < 0) + if(H5O_get_rc_and_type(&obj_oloc, &rc, &otype) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") /* If its ref count is > 1, we add it to the list of visited objects */ @@ -982,7 +1045,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_path_len++; /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(&obj_oloc, &linfo, udata->dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&obj_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1006,7 +1069,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) udata->curr_loc = &obj_loc; /* Iterate over links in group */ - ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata, udata->dxpl_id); + ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata); /* Restore location */ udata->curr_loc = old_loc; @@ -1059,8 +1122,7 @@ done: */ herr_t H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) + H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5G_iter_visit_ud_t udata; /* User data for callback */ H5O_linfo_t linfo; /* Link info message */ @@ -1082,7 +1144,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Open the group to begin visiting within */ - if((grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id)) == NULL) + if(NULL == (grp = H5G__open_name(&loc, group_name))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the starting group */ @@ -1096,8 +1158,6 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, /* Set up user data */ udata.gid = gid; udata.curr_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.idx_type = idx_type; udata.order = order; udata.op = op; @@ -1114,7 +1174,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") /* Get the group's reference count */ - if(H5O_get_rc_and_type(&grp->oloc, dxpl_id, &rc, NULL) < 0) + if(H5O_get_rc_and_type(&grp->oloc, &rc, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object info") /* If its ref count is > 1, we add it to the list of visited objects */ @@ -1136,7 +1196,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, } /* end if */ /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1157,7 +1217,7 @@ H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, } /* end if */ /* Call the link iteration routine */ - if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata, dxpl_id)) < 0) + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") done: @@ -1179,6 +1239,44 @@ done: /*------------------------------------------------------------------------- + * Function: H5G__get_create_plist + * + * Purpose: Internal routine to retrieve a group's creation property list. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: ID for a copy of the group creation property + * list. The property list ID should be released + * by calling H5Pclose(). + * + * Failure: H5I_INVALID_HID + * + * Programmer: Quincey Koziol + * December 17, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5G__get_create_plist(const H5G_t *grp) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(grp); + + /* Retrieve the GCPL */ + if((ret_value = H5G_get_create_plist(grp)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get group's creation property list") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_create_plist() */ + + +/*------------------------------------------------------------------------- * Function: H5G_get_create_plist * * Purpose: Private function for H5Gget_create_plist @@ -1187,7 +1285,7 @@ done: * property list. The property list ID should be * released by calling H5Pclose(). * - * Failure: FAIL + * Failure: H5I_INVALID_HID * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1195,7 +1293,7 @@ done: *------------------------------------------------------------------------- */ hid_t -H5G_get_create_plist(H5G_t *grp) +H5G_get_create_plist(const H5G_t *grp) { H5O_linfo_t linfo; /* Link info message */ htri_t ginfo_exists; @@ -1203,60 +1301,60 @@ H5G_get_create_plist(H5G_t *grp) htri_t pline_exists; H5P_genplist_t *gcpl_plist; H5P_genplist_t *new_plist; - hid_t new_gcpl_id = FAIL; - hid_t ret_value = FAIL; + hid_t new_gcpl_id = H5I_INVALID_HID; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Copy the default group creation property list */ if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get default group creation property list") if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to copy the creation property list") if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "can't get property list") /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&grp->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object creation info") + if(H5O_get_create_plist(&grp->oloc, new_plist) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "can't get object creation info") /* Check for the group having a group info message */ - if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header") if(ginfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ /* Read the group info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_ind_read_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") + if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, H5I_INVALID_HID, "can't get group info") /* Set the group info for the property list */ if(H5P_set(new_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set group info") } /* end if */ /* Check for the group having a link info message */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5I_INVALID_HID, "unable to read object header") if(linfo_exists) { /* Set the link info for the property list */ if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link info") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set link info") } /* end if */ /* Check for the group having a pipeline message */ - if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") + if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5I_INVALID_HID, "unable to read object header") if(pline_exists) { H5O_pline_t pline; /* Pipeline message */ /* Read the pipeline */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_ind_read_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") + if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, H5I_INVALID_HID, "can't get link pipeline") /* Set the pipeline for the property list */ if(H5P_poke(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link pipeline") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set link pipeline") } /* end if */ /* Set the return value */ @@ -1266,8 +1364,224 @@ done: if(ret_value < 0) { if(new_gcpl_id > 0) if(H5I_dec_app_ref(new_gcpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't free") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_get_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info + * + * Purpose: Internal routine to retrieve the info for a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info(const H5G_loc_t *loc, H5G_info_t *grp_info) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Retrieve the group's information */ + if(H5G__obj_info(loc->oloc, grp_info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info_by_name + * + * Purpose: Internal routine to retrieve the info for a group, by name. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, H5G_info_t *grp_info) +{ + H5G_loc_t grp_loc; /* Location used to open group */ + H5G_name_t grp_path; /* Opened object group hier. path */ + H5O_loc_t grp_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Set up opened group location to fill in */ + grp_loc.oloc = &grp_oloc; + grp_loc.path = &grp_path; + H5G_loc_reset(&grp_loc); + + /* Find the group object */ + if(H5G_loc_find(loc, name, &grp_loc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + loc_found = TRUE; + + /* Retrieve the group's information */ + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + /* Clean up */ + if(loc_found && H5G_loc_free(&grp_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__get_info_by_idx + * + * Purpose: Internal routine to retrieve the info for a group, by index. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info) +{ + H5G_loc_t grp_loc; /* Location used to open group */ + H5G_name_t grp_path; /* Opened object group hier. path */ + H5O_loc_t grp_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(grp_info); + + /* Set up opened group location to fill in */ + grp_loc.oloc = &grp_oloc; + grp_loc.path = &grp_path; + H5G_loc_reset(&grp_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &grp_loc/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found") + loc_found = TRUE; + + /* Retrieve the group's information */ + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") + +done: + /* Clean up */ + if(loc_found && H5G_loc_free(&grp_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5G__get_info_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__flush + * + * Purpose: Internal routine to flushes a group to disk. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__flush(H5G_t *grp, hid_t group_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(grp); + + /* Flush metadata to file */ + if(H5O_flush_common(&grp->oloc, group_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFLUSH, FAIL, "unable to flush group and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5G__flush */ + + +/*------------------------------------------------------------------------- + * Function: H5G__refresh + * + * Purpose: Internal routine to refresh a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__refresh(H5G_t *grp, hid_t group_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(grp); + + /* Call private function to refresh group object */ + if((H5O_refresh_metadata(group_id, grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to refresh group") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5G__refresh */ + diff --git a/src/H5Glink.c b/src/H5Glink.c index e199f89..509e511 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -553,8 +553,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, - const H5O_link_t *lnk) +H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk) { H5RS_str_t *obj_path_r = NULL; /* Full path for link being removed */ herr_t ret_value = SUCCEED; /* Return value */ @@ -567,7 +566,7 @@ H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, /* Search the open IDs and replace names for unlinked object */ if(grp_full_path_r) { obj_path_r = H5G_build_fullpath_refstr_str(grp_full_path_r, lnk->name); - if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL, dxpl_id) < 0) + if(H5G_name_replace(lnk, H5G_NAME_DELETE, file, obj_path_r, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to replace name") } /* end if */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index c011cdf..7273a89 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -65,8 +65,6 @@ typedef struct { /* User data for looking up an object in a group by index */ typedef struct { /* downward */ - hid_t lapl_id; /* LAPL to use for operation */ - hid_t dxpl_id; /* DXPL to use for operation */ H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Iteration order within index */ hsize_t n; /* Offset within index */ @@ -78,7 +76,6 @@ typedef struct { /* User data for getting an object's info in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ hbool_t want_ih_info; /* Whether to retrieve the index & heap info */ /* upward */ @@ -88,7 +85,6 @@ typedef struct { /* User data for setting an object's comment in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ const char *comment; /* Object comment buffer */ /* upward */ @@ -97,7 +93,6 @@ typedef struct { /* User data for getting an object's comment in a group */ typedef struct { /* downward */ - hid_t dxpl_id; /* DXPL to use for operation */ char *comment; /* Object comment buffer */ size_t bufsize; /* Size of object comment buffer */ @@ -111,16 +106,16 @@ typedef struct { /********************/ /* Group traversal callbacks */ -static herr_t H5G_loc_find_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_find_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_find_by_idx_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_find_by_idx_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_set_comment_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_set_comment_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); -static herr_t H5G_loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__loc_get_comment_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata, H5G_own_loc_t *own_loc); @@ -357,7 +352,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_find_cb + * Function: H5G__loc_find_cb * * Purpose: Callback for retrieving object location for an object in a group * @@ -369,14 +364,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, +H5G__loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fnd_t *udata = (H5G_loc_fnd_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -391,7 +386,7 @@ H5G_loc_find_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_find_cb() */ +} /* end H5G__loc_find_cb() */ /*------------------------------------------------------------------------- @@ -407,8 +402,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/) { H5G_loc_fnd_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -424,7 +418,7 @@ H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, udata.loc = obj_loc; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_find_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_find_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -433,7 +427,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_find_by_idx_cb + * Function: H5G__loc_find_by_idx_cb * * Purpose: Callback for retrieving object location for an object in a group * according to the order within an index @@ -446,27 +440,25 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5G__loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_fbi_t *udata = (H5G_loc_fbi_t *)_udata; /* User data passed in */ H5O_link_t fnd_lnk; /* Link within group */ hbool_t lnk_copied = FALSE; /* Whether the link was copied */ - size_t links_left = H5L_NUM_LINKS; /* # of links left to traverse */ hbool_t obj_loc_valid = FALSE; /* Flag to indicate that the object location is valid */ hbool_t obj_exists = FALSE; /* Whether the object exists (unused) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; @@ -478,7 +470,7 @@ H5G_loc_find_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ /* (may modify the object location) */ - if(H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, &links_left, TRUE, udata->loc, &obj_exists, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, TRUE, udata->loc, &obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") done: @@ -496,7 +488,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_find_by_idx_cb() */ +} /* end H5G__loc_find_by_idx_cb() */ /*------------------------------------------------------------------------- @@ -512,9 +504,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, - hid_t dxpl_id) +H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5G_loc_t *obj_loc/*out*/) { H5G_loc_fbi_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -527,15 +518,13 @@ H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, HDassert(obj_loc); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; - udata.lapl_id = lapl_id; udata.idx_type = idx_type; udata.order = order; udata.n = n; udata.loc = obj_loc; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, group_name, H5G_TARGET_NORMAL, H5G_loc_find_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, group_name, H5G_TARGET_NORMAL, H5G__loc_find_by_idx_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -557,7 +546,7 @@ done: */ herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, - H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) + H5O_type_t obj_type, const void *crt_info) { H5O_link_t lnk; /* Link for object to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -579,8 +568,7 @@ H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, lnk.u.hard.addr = obj_loc->oloc->addr; /* Insert new group into current group's symbol table */ - if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info, - dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, &lnk, TRUE, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert object") /* Set the name of the object location */ @@ -644,7 +632,7 @@ H5G_loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UN *------------------------------------------------------------------------- */ htri_t -H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5G_loc_exists(const H5G_loc_t *loc, const char *name) { H5G_loc_exists_t udata; /* User data for traversal callback */ htri_t ret_value = FAIL; /* Return value */ @@ -659,7 +647,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl udata.exists = FALSE; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G_loc_exists_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't check if object exists") /* Set return value */ @@ -696,7 +684,7 @@ H5G_loc_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUS HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Query object information */ - if(H5O_get_info(obj_loc->oloc, udata->dxpl_id, udata->want_ih_info, udata->oinfo) < 0) + if(H5O_get_info(obj_loc->oloc, udata->want_ih_info, udata->oinfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object info") done: @@ -722,8 +710,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_info(H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t *oinfo/*out*/, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_info(const H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t *oinfo/*out*/) { H5G_loc_info_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -736,12 +723,11 @@ H5G_loc_info(H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t HDassert(oinfo); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.want_ih_info = want_ih_info; udata.oinfo = oinfo; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_info_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_info_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -750,7 +736,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_set_comment_cb + * Function: H5G__loc_set_comment_cb * * Purpose: Callback for (re)setting object comment for an object in a group * @@ -762,7 +748,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_sc_t *udata = (H5G_loc_sc_t *)_udata; /* User data passed in */ @@ -770,26 +756,26 @@ H5G_loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT htri_t exists; /* Whether a "comment" message already exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for existing comment message */ - if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID, udata->dxpl_id)) < 0) + if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header") /* Remove the previous comment message if any */ if(exists) - if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0) + if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete existing comment object header message") /* Add the new message */ if(udata->comment && *udata->comment) { /* Casting away const OK -QAK */ comment.s = (char *)udata->comment; - if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment, udata->dxpl_id) < 0) + if(H5O_msg_create(obj_loc->oloc, H5O_NAME_ID, 0, H5O_UPDATE_TIME, &comment) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to set comment object header message") } /* end if */ @@ -799,7 +785,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_set_comment_cb() */ +} /* end H5G__loc_set_comment_cb() */ /*------------------------------------------------------------------------- @@ -816,8 +802,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_set_comment(H5G_loc_t *loc, const char *name, const char *comment, - hid_t lapl_id, hid_t dxpl_id) +H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, const char *comment) { H5G_loc_sc_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -829,11 +814,10 @@ H5G_loc_set_comment(H5G_loc_t *loc, const char *name, const char *comment, HDassert(name && *name); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.comment = comment; /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_set_comment_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_set_comment_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") done: @@ -842,7 +826,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_get_comment_cb + * Function: H5G__loc_get_comment_cb * * Purpose: Callback for retrieving object comment for an object in a group * @@ -854,14 +838,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5G__loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_loc_gc_t *udata = (H5G_loc_gc_t *)_udata; /* User data passed in */ H5O_name_t comment; /* Object header "comment" message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -869,11 +853,12 @@ H5G_loc_get_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT /* Query object comment */ comment.s = NULL; - if(NULL == H5O_msg_read(obj_loc->oloc, H5O_NAME_ID, &comment, udata->dxpl_id)) { + if(NULL == H5O_msg_read(obj_loc->oloc, H5O_NAME_ID, &comment)) { if(udata->comment && udata->bufsize > 0) udata->comment[0] = '\0'; udata->comment_size = 0; - } else { + } /* end if */ + else { if(udata->comment && udata->bufsize) HDstrncpy(udata->comment, comment.s, udata->bufsize); udata->comment_size = (ssize_t)HDstrlen(comment.s); @@ -886,7 +871,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_get_comment_cb() */ +} /* end H5G__loc_get_comment_cb() */ /*------------------------------------------------------------------------- @@ -907,8 +892,8 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, - size_t bufsize, hid_t lapl_id, hid_t dxpl_id) +H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment/*out*/, + size_t bufsize) { H5G_loc_gc_t udata; /* User data for traversal callback */ ssize_t ret_value = -1; /* Return value */ @@ -920,13 +905,12 @@ H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, HDassert(name && *name); /* Set up user data for locating object */ - udata.dxpl_id = dxpl_id; udata.comment = comment; udata.bufsize = bufsize; udata.comment_size = (-1); /* Traverse group hierarchy to locate object */ - if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G_loc_get_comment_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_get_comment_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't find object") /* Set the return value */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 7b53668..1ca06b9 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -65,8 +65,6 @@ typedef struct H5G_names_t { typedef struct H5G_gnba_iter_t { /* In */ const H5O_loc_t *loc; /* The location of the object we're looking for */ - hid_t lapl_id; /* LAPL for operations */ - hid_t dxpl_id; /* DXPL for operations */ /* Out */ char *path; /* Name of the object */ @@ -560,7 +558,7 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) */ ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, - hbool_t *cached, hid_t lapl_id, hid_t dxpl_id) + hbool_t *cached) { ssize_t len = 0; /* Length of object's name */ ssize_t ret_value = -1; /* Return value */ @@ -593,7 +591,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get file ID") /* Search for name of object */ - if((len = H5G_get_name_by_addr(file, lapl_id, dxpl_id, loc->oloc, name, size)) < 0) { + if((len = H5G_get_name_by_addr(file, loc->oloc, name, size)) < 0) { H5I_dec_ref(file); HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine name") } /* end if */ @@ -1076,8 +1074,7 @@ done: */ herr_t H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, - H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r, - hid_t dxpl_id) + H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r) { herr_t ret_value = SUCCEED; @@ -1106,7 +1103,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, tmp_oloc.addr = lnk->u.hard.addr; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") /* Determine which type of objects to operate on */ @@ -1244,7 +1241,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info_t *linfo, H5G_loc_reset(&obj_loc); /* Find the object */ - if(H5G_loc_find(&grp_loc, path, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(&grp_loc, path, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -1283,7 +1280,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t *loc, +H5G_get_name_by_addr(hid_t file, const H5O_loc_t *loc, char *name, size_t size) { H5G_gnba_iter_t udata; /* User data for iteration */ @@ -1310,12 +1307,10 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * else { /* Set up user data for iterator */ udata.loc = loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.path = NULL; /* Visit all the links in the file */ - if((status = H5G_visit(file, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata, lapl_id, dxpl_id)) < 0) + if((status = H5G_visit(file, "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5G_get_name_by_addr_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group traversal failed while looking for object name") else if(status > 0) found_obj = TRUE; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index b335624..2ae3d538 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -76,16 +76,16 @@ typedef struct H5G_node_key_t { /* B-tree callbacks */ static H5UC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); -static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key, +static herr_t H5G__node_create(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/); static int H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key); static int H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key, +static htri_t H5G_node_found(H5F_t *f, haddr_t addr, const void *_lt_key, void *_udata); -static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, +static H5B_ins_t H5G__node_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p/*out*/); -static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key, +static H5B_ins_t H5G_node_remove(H5F_t *f, haddr_t addr, void *lt_key, hbool_t *lt_key_changed, void *udata, void *rt_key, hbool_t *rt_key_changed); static herr_t H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); @@ -102,11 +102,11 @@ H5B_class_t H5B_SNODE[1] = {{ H5B_SNODE_ID, /*id */ sizeof(H5G_node_key_t), /*sizeof_nkey */ H5G_node_get_shared, /*get_shared */ - H5G_node_create, /*new */ + H5G__node_create, /*new */ H5G_node_cmp2, /*cmp2 */ H5G_node_cmp3, /*cmp3 */ H5G_node_found, /*found */ - H5G_node_insert, /*insert */ + H5G__node_insert, /*insert */ TRUE, /*follow min branch? */ TRUE, /*follow max branch? */ H5B_RIGHT, /*critical key */ @@ -297,7 +297,7 @@ H5G__node_free(H5G_node_t *sym) /*------------------------------------------------------------------------- - * Function: H5G_node_create + * Function: H5G__node_create * * Purpose: Creates a new empty symbol table node. This function is * called by the B-tree insert function for an empty tree. It @@ -316,7 +316,7 @@ H5G__node_free(H5G_node_t *sym) *------------------------------------------------------------------------- */ static herr_t -H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, +H5G__node_create(H5F_t *f, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, void H5_ATTR_UNUSED *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; @@ -324,7 +324,7 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ H5G_node_t *sym = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -335,12 +335,12 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_ if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") sym->node_size = H5G_NODE_SIZE(f); - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)sym->node_size))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(f, H5FD_MEM_BTREE, (hsize_t)sym->node_size))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space") if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "memory allocation failed") - if(H5AC_insert_entry(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node") /* * The left and right symbols in an empty tree are both the @@ -363,7 +363,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_create() */ +} /* end H5G__node_create() */ /*------------------------------------------------------------------------- @@ -507,7 +507,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, +H5G_node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, void *_udata) { H5G_bt_lkp_t *udata = (H5G_bt_lkp_t *)_udata; @@ -529,7 +529,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED /* * Load the symbol table node for exclusive access. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node") /* @@ -557,7 +557,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void H5_ATTR_UNUSED HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "iterator callback failed") done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -565,7 +565,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_insert + * Function: H5G__node_insert * * Purpose: The B-tree insertion engine has found the symbol table node * which should receive the new symbol/address pair. This @@ -597,11 +597,9 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void H5_ATTR_UNUSED *_lt_key, hbool_t H5_ATTR_UNUSED *lt_key_changed, - void *_md_key, void *_udata, - void *_rt_key, hbool_t *rt_key_changed, - haddr_t *new_node_p) +H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, + hbool_t H5_ATTR_UNUSED *lt_key_changed, void *_md_key, void *_udata, + void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node_p) { H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; @@ -615,7 +613,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5G_entry_t ent; /* Entry to insert in node */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -630,7 +628,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, /* * Load the symbol node. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* @@ -654,7 +652,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ - if(H5G__ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, + if(H5G__ent_convert(f, udata->common.heap, udata->common.name, udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") @@ -668,10 +666,10 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, ret_value = H5B_INS_RIGHT; /* The right node */ - if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) + if(H5G__node_create(f, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0) HGOTO_ERROR (H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node") - if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, f, H5AC__NO_FLAGS_SET))) + if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, *new_node_p, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node") HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), @@ -726,13 +724,13 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, insert_into->nsyms += 1; done: - if(snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) + if(snrt && H5AC_unprotect(f, H5AC_SNODE, *new_node_p, snrt, snrt_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_insert() */ +} /* end H5G__node_insert() */ /*------------------------------------------------------------------------- @@ -764,7 +762,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, +H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, void *_udata/*in,out*/, void *_rt_key/*in,out*/, hbool_t *rt_key_changed/*out*/) @@ -788,7 +786,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDassert(udata && udata->common.heap); /* Load the symbol table */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node") /* "Normal" removal of a single entry from the symbol table node */ @@ -835,7 +833,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ /* Replace any object names */ - if(H5G__link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0) + if(H5G__link_name_replace(f, udata->grp_full_path_r, &lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get object type") /* Decrement the ref. count for hard links */ @@ -846,7 +844,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, tmp_oloc.file = f; tmp_oloc.addr = lnk.u.hard.addr; - if(H5O_link(&tmp_oloc, -1, dxpl_id) < 0) + if(H5O_link(&tmp_oloc, -1) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count") } /* end if */ else { @@ -855,13 +853,13 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, size_t soft_link_len; /* Length of string in local heap */ soft_link_len = HDstrlen(lnk.u.soft.name) + 1; - if(H5HL_remove(f, dxpl_id, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, soft_link_len) < 0) + if(H5HL_remove(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset, soft_link_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to remove soft link from local heap") } /* end if */ } /* end else */ /* Remove the link's name from the local heap */ - if(H5HL_remove(f, dxpl_id, udata->common.heap, sn->entry[idx].name_off, link_name_len) < 0) + if(H5HL_remove(f, udata->common.heap, sn->entry[idx].name_off, link_name_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to remove link name from local heap") /* Remove the entry from the symbol table node */ @@ -923,7 +921,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDassert(H5F_addr_defined(sn->entry[idx].header)); tmp_oloc.addr = sn->entry[idx].header; - if(H5O_link(&tmp_oloc, -1, dxpl_id) < 0) + if(H5O_link(&tmp_oloc, -1) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, H5B_INS_ERROR, "unable to decrement object link count") } /* end if */ } /* end for */ @@ -939,7 +937,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, sn_flags) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, sn_flags) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5B_INS_ERROR, "unable to release symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -960,7 +958,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_iterate(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; @@ -979,7 +977,7 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h HDassert(udata && udata->heap); /* Protect the symbol table node & local heap while we iterate over entries */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* @@ -1018,11 +1016,12 @@ H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, h done: /* Release resources */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) } /* end H5G__node_iterate() */ + /*------------------------------------------------------------------------- * Function: H5G__node_sumup @@ -1038,7 +1037,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_sumup(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; @@ -1055,13 +1054,13 @@ H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, had HDassert(num_objs); /* Find the object node and add the number of symbol entries. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") *num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1083,7 +1082,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_by_idx(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; @@ -1100,7 +1099,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha HDassert(udata); /* Get a pointer to the symbol table node */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node"); /* Find the node, locate the object symbol table entry and retrieve the name */ @@ -1122,7 +1121,7 @@ H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, ha udata->num_objs += sn->nsyms; done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1219,7 +1218,7 @@ H5G_node_close(const H5F_t *f) *------------------------------------------------------------------------- */ int -H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; @@ -1238,11 +1237,11 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HDassert(udata); /* load the symbol table into memory from the source file */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* get the base address of the heap */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, udata->src_heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, udata->src_heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "unable to protect symbol name") /* copy object in this node one by one */ @@ -1275,7 +1274,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") /* Check if the object pointed by the soft link exists in the source file */ - if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo, H5P_DEFAULT, dxpl_id) >= 0) { + if(H5G_loc_info(&grp_loc, link_name, FALSE, &oinfo) >= 0) { tmp_src_ent.header = oinfo.addr; src_ent = &tmp_src_ent; } /* end if */ @@ -1298,8 +1297,7 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd tmp_src_oloc.addr = src_ent->header; /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, - cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, &obj_type, (void **)&cpy_udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy object") /* Set up object creation info for symbol table insertion. Only @@ -1339,17 +1337,16 @@ H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, hadd HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get source object name") /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, H5_ITER_ERROR); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ if(H5G__stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, - obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL), - dxpl_id) < 0) + obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL)) < 0) HGOTO_ERROR_TAG(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") /* Reset metadata tag */ - H5_END_TAG(H5_ITER_ERROR); + H5_END_TAG } /* end of for (i=0; insyms; i++) */ @@ -1357,7 +1354,7 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to unprotect symbol name") - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1378,7 +1375,7 @@ done: *------------------------------------------------------------------------- */ int -H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, +H5G__node_build_table(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; @@ -1399,7 +1396,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke * Save information about the symbol table node since we can't lock it * because we're about to call an application function. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check if the link table needs to be extended */ @@ -1432,7 +1429,7 @@ H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void H5_ATTR_UNUSED *_lt_ke done: /* Release the locked items */ - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1453,7 +1450,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATTR_UNUSED *_lt_key, +H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ATTR_UNUSED addr, const void H5_ATTR_UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ @@ -1485,8 +1482,8 @@ H5G__node_iterate_size(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const void H5_ATT *------------------------------------------------------------------------- */ herr_t -H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, - int fwidth, haddr_t heap_addr) +H5G_node_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth, + haddr_t heap_addr) { H5G_node_t *sn = NULL; H5HL_t *heap = NULL; @@ -1506,19 +1503,19 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, /* Pin the heap down in memory */ if(heap_addr > 0 && H5F_addr_defined(heap_addr)) - if(NULL == (heap = H5HL_protect(f, dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table heap") /* * If we couldn't load the symbol table node, then try loading the * B-tree node. */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) { + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) { H5G_bt_common_t udata; /*data to pass through B-tree */ H5E_clear_stack(NULL); /* discard that error */ udata.heap = heap; - if(H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) + if(H5B_debug(f, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); } /* end if */ else { @@ -1551,7 +1548,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, } /* end if */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node") if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") diff --git a/src/H5Gobj.c b/src/H5Gobj.c index d2dc83b..e38d97c 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -58,7 +58,6 @@ typedef struct { H5F_t *f; /* Pointer to file for insertion */ haddr_t oh_addr; /* Address of the object header */ - hid_t dxpl_id; /* DXPL during insertion */ H5O_linfo_t *linfo; /* Pointer to link info */ } H5G_obj_oh_it_ud1_t; @@ -76,7 +75,6 @@ typedef struct { */ typedef struct { const H5O_loc_t *grp_oloc; /* Pointer to group for insertion */ - hid_t dxpl_id; /* DXPL during insertion */ } H5G_obj_stab_it_ud1_t; @@ -90,8 +88,7 @@ typedef struct { /********************/ static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, - hid_t dxpl_id); +static herr_t H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo); /*********************/ @@ -124,8 +121,7 @@ static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *li *------------------------------------------------------------------------- */ herr_t -H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, - H5O_loc_t *oloc/*out*/) +H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { H5P_genplist_t *gc_plist; /* Group creation property list */ H5O_ginfo_t ginfo; /* Group info */ @@ -158,7 +154,7 @@ H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get group info") /* Call the "real" group creation routine now */ - if(H5G__obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) + if(H5G__obj_create_real(f, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create group") done: @@ -180,7 +176,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, +H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { @@ -261,32 +257,32 @@ H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, * since nothing refers to it yet. The link count will be * incremented if the object is added to the group directed graph. */ - if(H5O_create(f, dxpl_id, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) + if(H5O_create(f, hdr_size, (size_t)1, gcpl_id, oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create header") /* Check for format of group to create */ if(use_latest_format) { /* Insert link info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert pipeline message */ if(pline && pline->nused) /* (Casting away const OK - QAK) */ - if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline, dxpl_id) < 0) + if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") } /* end if */ else { H5O_stab_t stab; /* Symbol table message */ /* The group doesn't currently have a 'stab' message, go create one */ - if(H5G__stab_create(oloc, dxpl_id, ginfo, &stab) < 0) + if(H5G__stab_create(oloc, ginfo, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create symbol table") /* Cache the symbol table information */ @@ -316,23 +312,23 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc); HDassert(linfo); /* Check for the group having a link info message */ - if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID, dxpl_id)) < 0) + if((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(ret_value) { /* Retrieve the "link info" structure */ - if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "link info message not present") /* Check if we don't know how many links there are */ @@ -340,7 +336,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Check if we are using "dense" link storage */ if(H5F_addr_defined(linfo->fheap_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(grp_oloc->file, dxpl_id, linfo->name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(grp_oloc->file, linfo->name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in "name" B-tree */ @@ -350,7 +346,7 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) } /* end if */ else { /* Retrieve # of links from object header */ - if(H5O_get_nlinks(grp_oloc, dxpl_id, &linfo->nlinks) < 0) + if(H5O_get_nlinks(grp_oloc, &linfo->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve # of links for object") } /* end if */ } /* end if */ @@ -358,10 +354,10 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_get_linfo() */ @@ -386,18 +382,18 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, udata->oh_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(udata->oh_addr) /* check arguments */ HDassert(lnk); HDassert(udata); /* Insert link into dense link storage */ - if(H5G__dense_insert(udata->f, udata->dxpl_id, udata->linfo, lnk) < 0) + if(H5G__dense_insert(udata->f, udata->linfo, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_compact_to_dense_cb() */ @@ -429,8 +425,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) /* Insert link into group */ /* (Casting away const OK - QAK) */ - if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, - H5O_TYPE_UNKNOWN, NULL, udata->dxpl_id) < 0) + if(H5G_obj_insert(udata->grp_oloc, lnk->name, (H5O_link_t *)lnk, FALSE, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert link into group") done: @@ -457,7 +452,7 @@ done: */ herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, - hbool_t adj_link, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) + hbool_t adj_link, H5O_type_t obj_type, const void *crt_info) { H5O_pline_t tmp_pline; /* Pipeline message */ H5O_pline_t *pline = NULL; /* Pointer to pipeline message */ @@ -467,7 +462,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, hbool_t use_new_dense = FALSE; /* Whether to use "dense" form of 'new format' group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -476,7 +471,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Check if we have information about the number of objects in this group */ /* (by attempting to get the link info message for this group) */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ @@ -500,7 +495,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get link size") /* Get the group info */ - if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* If there's still a small enough number of links, use the 'link' message */ @@ -517,32 +512,31 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_mesg_operator_t op; /* Message operator */ /* Get the pipeline message, if it exists */ - if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID, dxpl_id)) < 0) + if((pline_exists = H5O_msg_exists(grp_oloc, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(pline_exists) { - if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_PLINE_ID, &tmp_pline)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") pline = &tmp_pline; } /* end if */ /* The group doesn't currently have "dense" storage for links */ - if(H5G__dense_create(grp_oloc->file, dxpl_id, &linfo, pline) < 0) + if(H5G__dense_create(grp_oloc->file, &linfo, pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create 'dense' form of new format group") /* Set up user data for object header message iteration */ udata.f = grp_oloc->file; udata.oh_addr = grp_oloc->addr; - udata.dxpl_id = dxpl_id; udata.linfo = &linfo; /* Iterate over the 'link' messages, inserting them into the dense link storage */ op.op_type = H5O_MESG_OP_APP; op.u.app_op = H5G_obj_compact_to_dense_cb; - if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata, dxpl_id) < 0) + if(H5O_msg_iterate(grp_oloc, H5O_LINK_ID, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") /* Remove all the 'link' messages */ - if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_LINK_ID, H5O_ALL, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete link messages") use_new_dense = TRUE; @@ -558,31 +552,29 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Convert group to "new format" group, in order to hold the information */ /* Insert link info message */ - if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_LINFO_ID, 0, 0, &new_linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ - if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, H5O_UPDATE_TIME, &new_ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Set up user data for iteration */ udata.grp_oloc = grp_oloc; - udata.dxpl_id = dxpl_id; /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G__stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ - if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE, dxpl_id) < 0) + if(H5O_msg_remove(grp_oloc, H5O_STAB_ID, 0, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete old format link storage") /* Recursively call this routine to insert the new link, since the * group is in the "new format" now and the link info should be * set up, etc. */ - if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, - crt_info, dxpl_id) < 0) + if(H5G_obj_insert(grp_oloc, name, obj_lnk, adj_link, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into group") /* Done with insertion now */ @@ -595,19 +587,18 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Insert into symbol table or "dense" storage */ if(use_old_format) { /* Insert into symbol table */ - if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) - < 0) + if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry into symbol table") } /* end if */ else { if(use_new_dense) { /* Insert into dense link storage */ - if(H5G__dense_insert(grp_oloc->file, dxpl_id, &linfo, obj_lnk) < 0) + if(H5G__dense_insert(grp_oloc->file, &linfo, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") } /* end if */ else { /* Insert with link message */ - if(H5G__compact_insert(grp_oloc, obj_lnk, dxpl_id) < 0) + if(H5G__compact_insert(grp_oloc, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link as link message") } /* end else */ } /* end else */ @@ -615,7 +606,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Increment the number of objects in this group */ if(!use_old_format) { linfo.nlinks++; - if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo, dxpl_id) < 0) + if(H5O_msg_write(grp_oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, &linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") } /* end if */ @@ -629,7 +620,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, obj_oloc.addr = obj_lnk->u.hard.addr; /* Increment reference count for object */ - if(H5O_link(&obj_oloc, 1, dxpl_id) < 0) + if(H5O_link(&obj_oloc, 1) < 0) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "unable to increment hard link count") } /* end if */ @@ -638,7 +629,7 @@ done: if(pline && H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "can't release pipeline") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_insert() */ @@ -658,22 +649,22 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_iterate(const H5O_loc_t *grp_oloc, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id) +H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, + void *op_data) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Sanity check */ HDassert(grp_oloc); HDassert(op); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for going out of bounds */ @@ -689,12 +680,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, if(H5F_addr_defined(linfo.fheap_addr)) { /* Iterate over the links in the group, building a table of the link messages */ - if((ret_value = H5G__dense_iterate(grp_oloc->file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__dense_iterate(grp_oloc->file, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over dense links") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G__compact_iterate(grp_oloc, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__compact_iterate(grp_oloc, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over compact links") } /* end else */ } /* end if */ @@ -704,12 +695,12 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Iterate over symbol table */ - if((ret_value = H5G__stab_iterate(grp_oloc, dxpl_id, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__stab_iterate(grp_oloc, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_iterate() */ @@ -727,7 +718,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) +H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info) { H5G_t *grp = NULL; /* Group to query */ H5G_loc_t grp_loc; /* Entry of group to be queried */ @@ -749,18 +740,18 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) H5G_loc_reset(&grp_loc); /* Deep copy (duplicate) of the group location object */ - if(H5O_loc_copy(&grp_oloc, oloc, H5_COPY_DEEP) < 0) + if(H5O_loc_copy(&grp_oloc, (H5O_loc_t *)oloc, H5_COPY_DEEP) < 0) /* (Casting away const OK - QAK) */ HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "can't copy object location") /* Open the group */ - if(NULL == (grp = H5G_open(&grp_loc, dxpl_id))) + if(NULL == (grp = H5G_open(&grp_loc))) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found") /* Get information from the group */ grp_info->mounted = H5G_MOUNTED(grp); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Retrieve the information about the links */ @@ -775,7 +766,7 @@ H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) } /* end if */ else { /* Get the number of objects in this group by iterating over symbol table */ - if(H5G__stab_count(oloc, &grp_info->nlinks, dxpl_id) < 0) + if(H5G__stab_count(oloc, &grp_info->nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't count objects") /* Set the other information about the group */ @@ -807,19 +798,19 @@ done: */ ssize_t H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, char* name, size_t size) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc && oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -832,12 +823,12 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G__dense_get_name_by_idx(oloc->file, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__dense_get_name_by_idx(oloc->file, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G__compact_get_name_by_idx(oloc, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__compact_get_name_by_idx(oloc, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ } /* end if */ @@ -847,17 +838,17 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's name from the symbol table */ - if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_get_name_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_remove_update_linfo + * Function: H5G__obj_remove_update_linfo * * Purpose: Update the link info after removing a link from a group * @@ -870,11 +861,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc); @@ -892,7 +883,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp /* Check if there's no more links */ if(linfo->nlinks == 0) { /* Delete the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ /* Check for switching back to compact storage */ @@ -900,7 +891,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp H5O_ginfo_t ginfo; /* Group info message */ /* Get the group info */ - if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_GINFO_ID, &ginfo)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") /* Check if we should switch from dense storage back to link messages */ @@ -911,11 +902,11 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp size_t u; /* Local index */ /* Build the table of links for this group */ - if(H5G__dense_build_table(oloc->file, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) + if(H5G__dense_build_table(oloc->file, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Pin the object header */ - if(NULL == (oh = H5O_pin(oloc, dxpl_id))) + if(NULL == (oh = H5O_pin(oloc))) HGOTO_ERROR(H5E_SYM, H5E_CANTPIN, FAIL, "unable to pin group object header") /* Inspect links in table for ones that can't be converted back @@ -932,7 +923,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp if(can_convert) { /* Insert link messages into group */ for(u = 0; u < linfo->nlinks; u++) - if(H5O_msg_append_oh(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { + if(H5O_msg_append_oh(oloc->file, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ if(H5O_unpin(oh) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") @@ -941,7 +932,7 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Remove the dense storage */ - if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ @@ -957,12 +948,12 @@ H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxp } /* end if */ /* Update link info in the object header */ - if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo, dxpl_id) < 0) + if(H5O_msg_write(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update link info message") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_remove_update_linfo() */ +} /* end H5G__obj_remove_update_linfo() */ /*------------------------------------------------------------------------- @@ -979,21 +970,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, hid_t dxpl_id) +H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); HDassert(name && *name); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Using the new format for groups */ @@ -1002,31 +993,30 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove(oloc->file, dxpl_id, &linfo, grp_full_path_r, name) < 0) + if(H5G__dense_remove(oloc->file, &linfo, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ - else { + else /* Remove object from the link messages */ - if(H5G__compact_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__compact_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") - } /* end else */ } /* end if */ else { /* Using the old format for groups */ use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__stab_remove(oloc, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ if(!use_old_format) - if(H5G_obj_remove_update_linfo(oloc, &linfo, dxpl_id) < 0) + if(H5G__obj_remove_update_linfo(oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1045,20 +1035,20 @@ done: */ herr_t H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id) + H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1074,12 +1064,12 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G__dense_remove_by_idx(grp_oloc->file, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__dense_remove_by_idx(grp_oloc->file, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ else { /* Remove object from compact link storage */ - if(H5G__compact_remove_by_idx(grp_oloc, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__compact_remove_by_idx(grp_oloc, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ } /* end if */ @@ -1092,18 +1082,17 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G__stab_remove_by_idx(grp_oloc, dxpl_id, grp_full_path_r, order, n) < 0) + if(H5G__stab_remove_by_idx(grp_oloc, grp_full_path_r, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ /* Update link info for a new-style group */ - if(!use_old_format) { - if(H5G_obj_remove_update_linfo(grp_oloc, &linfo, dxpl_id) < 0) + if(!use_old_format) + if(H5G__obj_remove_update_linfo(grp_oloc, &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUPDATE, FAIL, "unable to update link info") - } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_remove() */ @@ -1121,43 +1110,41 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); HDassert(name && *name); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's info from the dense link storage */ - if((ret_value = H5G__dense_lookup(grp_oloc->file, dxpl_id, &linfo, name, lnk)) < 0) + if((ret_value = H5G__dense_lookup(grp_oloc->file, &linfo, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the object's info from the link messages */ - if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ - else { + else /* Get the object's info from the symbol table */ - if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") - } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__obj_lookup() */ @@ -1177,19 +1164,19 @@ done: */ herr_t H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) + H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1202,12 +1189,12 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the link from the dense storage */ - if(H5G__dense_lookup_by_idx(grp_oloc->file, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__dense_lookup_by_idx(grp_oloc->file, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the link from the link messages */ - if(H5G__compact_lookup_by_idx(grp_oloc, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__compact_lookup_by_idx(grp_oloc, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ @@ -1217,11 +1204,11 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's info from the symbol table */ - if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G_obj_lookup_by_idx() */ diff --git a/src/H5Goh.c b/src/H5Goh.c index 977fc2d..38570f9 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -43,15 +43,13 @@ /* Local Prototypes */ /********************/ -static void *H5O_group_get_copy_file_udata(void); -static void H5O_group_free_copy_file_udata(void *udata); -static htri_t H5O_group_isa(H5O_t *loc); -static hid_t H5O_group_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); -static H5O_loc_t *H5O_group_get_oloc(hid_t obj_id); -static herr_t H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, +static void *H5O__group_get_copy_file_udata(void); +static void H5O__group_free_copy_file_udata(void *udata); +static htri_t H5O__group_isa(const H5O_t *loc); +static hid_t H5O__group_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); +static H5O_loc_t *H5O__group_get_oloc(hid_t obj_id); +static herr_t H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); @@ -73,13 +71,13 @@ static herr_t H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{ H5O_TYPE_GROUP, /* object type */ "group", /* object name, for debugging */ - H5O_group_get_copy_file_udata, /* get 'copy file' user data */ - H5O_group_free_copy_file_udata, /* free 'copy file' user data */ - H5O_group_isa, /* "isa" message */ - H5O_group_open, /* open an object of this class */ - H5O_group_create, /* create an object of this class */ - H5O_group_get_oloc, /* get an object header location for an object */ - H5O_group_bh_info, /* get the index & heap info for an object */ + H5O__group_get_copy_file_udata, /* get 'copy file' user data */ + H5O__group_free_copy_file_udata, /* free 'copy file' user data */ + H5O__group_isa, /* "isa" message */ + H5O__group_open, /* open an object of this class */ + H5O__group_create, /* create an object of this class */ + H5O__group_get_oloc, /* get an object header location for an object */ + H5O__group_bh_info, /* get the index & heap info for an object */ NULL /* flush an opened object of this class */ }}; @@ -88,7 +86,7 @@ H5FL_DEFINE(H5G_copy_file_ud_t); /*------------------------------------------------------------------------- - * Function: H5O_group_get_copy_file_udata + * Function: H5O__group_get_copy_file_udata * * Purpose: Allocates the user data needed for copying a group's * object header from file to file. @@ -103,11 +101,11 @@ H5FL_DEFINE(H5G_copy_file_ud_t); *------------------------------------------------------------------------- */ static void * -H5O_group_get_copy_file_udata(void) +H5O__group_get_copy_file_udata(void) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate space for the 'copy file' user data for copying groups. * Currently this is only a ginfo, so there is no specific struct type for @@ -117,11 +115,11 @@ H5O_group_get_copy_file_udata(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_get_copy_file_udata() */ +} /* end H5O__group_get_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_group_free_copy_file_udata + * Function: H5O__group_free_copy_file_udata * * Purpose: Release the user data needed for copying a group's * object header from file to file. @@ -134,11 +132,11 @@ done: *------------------------------------------------------------------------- */ static void -H5O_group_free_copy_file_udata(void *_udata) +H5O__group_free_copy_file_udata(void *_udata) { H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(udata); @@ -150,11 +148,11 @@ H5O_group_free_copy_file_udata(void *_udata) udata = H5FL_FREE(H5G_copy_file_ud_t, udata); FUNC_LEAVE_NOAPI_VOID -} /* end H5O_group_free_copy_file_udata() */ +} /* end H5O__group_free_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_group_isa + * Function: H5O__group_isa * * Purpose: Determines if an object has the requisite messages for being * a group. @@ -171,13 +169,13 @@ H5O_group_free_copy_file_udata(void *_udata) *------------------------------------------------------------------------- */ static htri_t -H5O_group_isa(struct H5O_t *oh) +H5O__group_isa(const H5O_t *oh) { htri_t stab_exists; /* Whether the 'stab' message is in the object header */ htri_t linfo_exists; /* Whether the 'linfo' message is in the object header */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oh); @@ -191,11 +189,11 @@ H5O_group_isa(struct H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_isa() */ +} /* end H5O__group_isa() */ /*------------------------------------------------------------------------- - * Function: H5O_group_open + * Function: H5O__group_open * * Purpose: Open a group at a particular location * @@ -208,17 +206,17 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_group_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__group_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5G_t *grp = NULL; /* Group opened */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); /* Open the group */ - if(NULL == (grp = H5G_open(obj_loc, dxpl_id))) + if(NULL == (grp = H5G_open(obj_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the group */ @@ -231,11 +229,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_open() */ +} /* end H5O__group_open() */ /*------------------------------------------------------------------------- - * Function: H5O_group_create + * Function: H5O__group_create * * Purpose: Create a group in a file * @@ -248,13 +246,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5G_obj_create_t *crt_info = (H5G_obj_create_t *)_crt_info; /* Group creation parameters */ H5G_t *grp = NULL; /* New group created */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -262,7 +260,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the group */ - if(NULL == (grp = H5G__create(f, crt_info, dxpl_id))) + if(NULL == (grp = H5G__create(f, crt_info))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") /* Set up the new group's location */ @@ -280,11 +278,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release group") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_create() */ +} /* end H5O__group_create() */ /*------------------------------------------------------------------------- - * Function: H5O_group_get_oloc + * Function: H5O__group_get_oloc * * Purpose: Retrieve the object header location for an open object * @@ -297,12 +295,12 @@ done: *------------------------------------------------------------------------- */ static H5O_loc_t * -H5O_group_get_oloc(hid_t obj_id) +H5O__group_get_oloc(hid_t obj_id) { H5G_t *grp; /* Group opened */ H5O_loc_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the group */ if(NULL == (grp = (H5G_t *)H5I_object(obj_id))) @@ -314,11 +312,11 @@ H5O_group_get_oloc(hid_t obj_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_group_get_oloc() */ +} /* end H5O__group_get_oloc() */ /*------------------------------------------------------------------------- - * Function: H5O_group_bh_info + * Function: H5O__group_bh_info * * Purpose: Retrieve storage for 1.8 btree and heap * Retrieve storage for 1.6 btree and heap via H5G_stab_bh_info() @@ -331,7 +329,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) { htri_t exists; /* Flag if header message of interest exists */ H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -339,7 +337,7 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_STATIC_TAG(oh->cache_info.addr) /* Sanity check */ HDassert(loc); @@ -355,39 +353,39 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5O_linfo_t linfo; /* Link info message */ /* Get "new style" group info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LINFO_ID, &linfo)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_LINFO_ID, &linfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't read LINFO message") /* Check if name index available */ if(H5F_addr_defined(linfo.name_bt2_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, dxpl_id, linfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, linfo.name_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_size(bt2_name, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_name, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for name index") } /* end if */ /* Check if creation order index available */ if(H5F_addr_defined(linfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(loc->file, dxpl_id, linfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(loc->file, linfo.corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_size(bt2_corder, dxpl_id, &bh_info->index_size) < 0) + if(H5B2_size(bt2_corder, &bh_info->index_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info for creation order index") } /* end if */ /* Get fractal heap size, if available */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Open the fractal heap for links */ - if(NULL == (fheap = H5HF_open(loc->file, dxpl_id, linfo.fheap_addr))) + if(NULL == (fheap = H5HF_open(loc->file, linfo.fheap_addr))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &bh_info->heap_size) < 0) + if(H5HF_size(fheap, &bh_info->heap_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info") } /* end if */ } /* end if */ @@ -395,23 +393,23 @@ H5O_group_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t * H5O_stab_t stab; /* Info about symbol table */ /* Must be "old style" group, get symbol table message */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_STAB_ID, &stab)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't find LINFO nor STAB messages") /* Get symbol table size info */ - if(H5G__stab_bh_size(loc->file, dxpl_id, &stab, bh_info) < 0) + if(H5G__stab_bh_size(loc->file, &stab, bh_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve symbol table size info") } /* end else */ done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_group_bh_info() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__group_bh_info() */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 76bf08b..6b28054 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -267,7 +267,6 @@ typedef struct H5G_dense_bt2_corder_rec_t { typedef struct H5G_bt2_ud_common_t { /* downward */ H5F_t *f; /* Pointer to file that fractal heap is in */ - hid_t dxpl_id; /* DXPL for operation */ H5HF_t *fheap; /* Fractal heap handle */ const char *name; /* Name of link to compare */ uint32_t name_hash; /* Hash of name of link to compare */ @@ -329,19 +328,27 @@ H5FL_EXTERN(H5G_shared_t); /* * General group routines */ -H5_DLL H5G_t *H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, - hid_t dxpl_id); +H5_DLL H5G_t *H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info); H5_DLL H5G_t *H5G__create_named(const H5G_loc_t *loc, const char *name, - hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id); -H5_DLL H5G_t *H5G__open_name(const H5G_loc_t *loc, const char *name, - hid_t gapl_id, hid_t dxpl_id); + hid_t lcpl_id, hid_t gcpl_id); +H5_DLL H5G_t *H5G__create_anon(H5F_t *file, H5G_obj_create_t *gcrt_info); +H5_DLL H5G_t *H5G__open_name(const H5G_loc_t *loc, const char *name); +H5_DLL hid_t H5G__get_create_plist(const H5G_t *grp); +H5_DLL herr_t H5G__get_info(const H5G_loc_t *loc, H5G_info_t *grp_info); +H5_DLL herr_t H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, + H5G_info_t *grp_info); +H5_DLL herr_t H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *grp_info); +H5_DLL herr_t H5G__flush(H5G_t *grp, hid_t group_id); +H5_DLL herr_t H5G__refresh(H5G_t *grp, hid_t group_id); +H5_DLL herr_t H5G__close_cb(H5G_t *grp); /* * Group hierarchy traversal routines */ H5_DLL herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, - const H5O_link_t *lnk, unsigned target, size_t *nlinks, hbool_t last_comp, - H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); + const H5O_link_t *lnk, unsigned target, hbool_t last_comp, + H5G_loc_t *obj_loc, hbool_t *obj_exists); /* * Utility functions @@ -353,38 +360,35 @@ H5_DLL const char *H5G__component(const char *name, size_t *size_p); * functions that understand names are exported to the rest of * the library and appear in H5Gprivate.h. */ -H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, - const H5O_ginfo_t *ginfo, H5O_stab_t *stab); -H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id); +H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, + H5O_stab_t *stab); +H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint); H5_DLL herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id); + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info); H5_DLL herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, - const void *crt_info, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab); -H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, + const void *crt_info); +H5_DLL herr_t H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab); +H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL herr_t H5G__stab_count(struct H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, +H5_DLL herr_t H5G__stab_count(const struct H5O_loc_t *oloc, hsize_t *num_objs); +H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info); H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, - hsize_t n, char* name, size_t size, hid_t dxpl_id); -H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, + hsize_t n, char* name, size_t size); +H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name); +H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); + H5O_link_t *lnk); H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, - hsize_t n, H5O_link_t *lnk, hid_t dxpl_id); + hsize_t n, H5O_link_t *lnk); #ifndef H5_STRICT_FORMAT_CHECKS -H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, - H5O_stab_t *alt_stab); +H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab); #endif /* H5_STRICT_FORMAT_CHECKS */ #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, - hid_t dxpl_id); +H5_DLL H5G_obj_t H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -398,25 +402,25 @@ H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); -H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, - const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, - const void *crt_info, H5G_entry_t *ent); +H5_DLL herr_t H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, + const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, + H5G_entry_t *ent); H5_DLL herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, int fwidth, const H5HL_t *heap); /* Functions that understand symbol table nodes */ H5_DLL herr_t H5G__node_init(H5F_t *f); -H5_DLL int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_iterate(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_sumup(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_by_idx(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_copy(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_build_table(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); H5_DLL herr_t H5G__node_free(H5G_node_t *sym); @@ -430,78 +434,73 @@ H5_DLL herr_t H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type H5_DLL herr_t H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *last_lnk, const H5G_lib_iterate_t op, void *op_data); H5_DLL herr_t H5G__link_release_table(H5G_link_table_t *ltable); -H5_DLL herr_t H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk); +H5_DLL herr_t H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, + const H5O_link_t *lnk); /* Functions that understand "compact" link storage */ -H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, - hid_t dxpl_id); -H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk); +H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char *name, size_t size); -H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, - H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name); +H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); H5_DLL htri_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, + H5O_link_t *lnk); +H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL H5G_obj_t H5G__compact_get_type_by_idx(H5O_loc_t *oloc, const H5O_linfo_t *linfo, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand "dense" link storage */ -H5_DLL herr_t H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); -H5_DLL herr_t H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline); -H5_DLL herr_t H5G__dense_insert(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, const H5O_link_t *lnk); -H5_DLL htri_t H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, const char *name, H5O_link_t *lnk); -H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, - hsize_t n, H5O_link_t *lnk); -H5_DLL herr_t H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, + const H5O_link_t *lnk); +H5_DLL htri_t H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, + const char *name, H5O_link_t *lnk); +H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); +H5_DLL herr_t H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, - H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - char *name, size_t size); -H5_DLL herr_t H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, + size_t size); +H5_DLL herr_t H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, - const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, - hbool_t adj_link); +H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, + H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, + hsize_t n); +H5_DLL herr_t H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, - H5O_linfo_t *linfo, hsize_t idx); +H5_DLL H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, H5O_linfo_t *linfo, + hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand group objects */ -H5_DLL herr_t H5G__obj_create(H5F_t *f, hid_t dxpl_id, - H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL herr_t H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, - const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, - const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, +H5_DLL herr_t H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, - hid_t dxpl_id); +H5_DLL herr_t H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, + const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, + H5O_loc_t *oloc/*out*/); +H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo); H5_DLL herr_t H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id); -H5_DLL herr_t H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id); + H5G_lib_iterate_t op, void *op_data); +H5_DLL herr_t H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info); H5_DLL htri_t H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *lnk, hid_t dxpl_id); + H5O_link_t *lnk); /* * These functions operate on group hierarchy names. @@ -512,7 +511,7 @@ H5_DLL herr_t H5G__name_init(H5G_name_t *name, const char *path); * These functions operate on group "locations" */ H5_DLL herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, - H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id); + H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info); /* Testing functions */ #ifdef H5G_TESTING diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index c48e687..427f14b 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -189,7 +189,7 @@ typedef struct H5G_entry_t H5G_entry_t; H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); H5_DLL H5F_t *H5G_fileof(H5G_t *grp); -H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc, hid_t dxpl_id); +H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc); H5_DLL herr_t H5G_close(H5G_t *grp); H5_DLL herr_t H5G_get_shared_count(H5G_t *grp); H5_DLL herr_t H5G_mount(H5G_t *grp); @@ -208,14 +208,12 @@ H5_DLL char *H5G_normalize(const char *name); * Group hierarchy traversal routines */ H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, - unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); + unsigned target, H5G_traverse_t op, void *op_data); H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id); + const H5G_link_iterate_t *lnk_op, void *op_data); H5_DLL herr_t H5G_visit(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, - hid_t lapl_id, hid_t dxpl_id); + H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data); /* * Functions that understand links in groups @@ -227,23 +225,23 @@ H5_DLL herr_t H5G_link_to_info(const struct H5O_link_t *lnk, H5L_info_t *linfo); */ H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, struct H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, - const void *crt_info, hid_t dxpl_id); + const void *crt_info); H5_DLL ssize_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); + H5_iter_order_t order, hsize_t n, char* name, size_t size); H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, - const char *name, hid_t dxpl_id); + const char *name); H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL hid_t H5G_get_create_plist(H5G_t *grp); + H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk); +H5_DLL hid_t H5G_get_create_plist(const H5G_t *grp); /* * These functions operate on symbol table nodes. */ H5_DLL herr_t H5G_node_close(const H5F_t *f); -H5_DLL herr_t H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t heap); +H5_DLL herr_t H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth, haddr_t heap); /* * These functions operate on group object locations. @@ -257,14 +255,14 @@ H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *en H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name); H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS_str_t *src_full_path_r, H5F_t *dst_file, - H5RS_str_t *dst_full_path_r, hid_t dxpl_id); + H5RS_str_t *dst_full_path_r); H5_DLL herr_t H5G_name_reset(H5G_name_t *name); H5_DLL herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_name_free(H5G_name_t *name); H5_DLL ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, - hbool_t *cached, hid_t lapl_id, hid_t dxpl_id); -H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, hid_t lapl_id, hid_t dxpl_id, - const struct H5O_loc_t *loc, char* name, size_t size); + hbool_t *cached); +H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, const struct H5O_loc_t *loc, + char* name, size_t size); H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); /* @@ -273,26 +271,24 @@ H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc); H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, - H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, + H5G_loc_t *obj_loc/*out*/); +H5_DLL herr_t H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, - H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name, - hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_loc_info(H5G_loc_t *loc, const char *name, - hbool_t want_ih_info, H5O_info_t *oinfo/*out*/, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL herr_t H5G_loc_set_comment(H5G_loc_t *loc, const char *name, - const char *comment, hid_t lapl_id, hid_t dxpl_id); -H5_DLL ssize_t H5G_loc_get_comment(H5G_loc_t *loc, const char *name, - char *comment/*out*/, size_t bufsize, hid_t lapl_id, hid_t dxpl_id); + H5G_loc_t *obj_loc/*out*/); +H5_DLL htri_t H5G_loc_exists(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5G_loc_info(const H5G_loc_t *loc, const char *name, + hbool_t want_ih_info, H5O_info_t *oinfo/*out*/); +H5_DLL herr_t H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, + const char *comment); +H5_DLL ssize_t H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, + char *comment/*out*/, size_t bufsize); H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc); H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc); /* * These functions operate on the root group */ -H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); +H5_DLL herr_t H5G_mkroot(H5F_t *f, hbool_t create_root); H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); H5_DLL herr_t H5G_root_free(H5G_t *grp); H5_DLL H5G_t *H5G_rootof(H5F_t *f); diff --git a/src/H5Groot.c b/src/H5Groot.c index fbc4f1a..36aa8f6 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -143,7 +143,7 @@ H5G_rootof(H5F_t *f) *------------------------------------------------------------------------- */ herr_t -H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) +H5G_mkroot(H5F_t *f, hbool_t create_root) { H5G_loc_t root_loc; /* Root location information */ H5G_obj_create_t gcrt_info; /* Root group object creation info */ @@ -192,13 +192,13 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* (Pass the FCPL which is a sub-class of the group creation property class) */ gcrt_info.gcpl_id = f->shared->fcpl_id; gcrt_info.cache_type = H5G_NOTHING_CACHED; - if(H5G__obj_create(f, dxpl_id, &gcrt_info, root_loc.oloc/*out*/) < 0) + if(H5G__obj_create(f, &gcrt_info, root_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") - if(1 != H5O_link(root_loc.oloc, 1, dxpl_id)) + if(1 != H5O_link(root_loc.oloc, 1)) HGOTO_ERROR(H5E_SYM, H5E_LINKCOUNT, FAIL, "internal error (wrong link count)") /* Decrement refcount on root group's object header in memory */ - if(H5O_dec_rc_by_loc(root_loc.oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(root_loc.oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on root group's object header") /* Mark superblock dirty, so root group info is flushed */ @@ -235,7 +235,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check for the situation where the symbol table is cached but does * not exist. This can happen if, for example, an external link is * added to the root group. */ - if((stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") /* Remove the cache if the stab does not exist */ @@ -253,7 +253,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check if the symbol table message is valid, and replace with the * cached symbol table if necessary */ - if(H5G__stab_valid(root_loc.oloc, dxpl_id, &cached_stab) < 0) + if(H5G__stab_valid(root_loc.oloc, &cached_stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to verify symbol table") } /* end if */ #endif /* H5_STRICT_FORMAT_CHECKS */ @@ -272,12 +272,12 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Check if the stab message exists. It's possible for the root group * to use the latest version while the superblock is an old version. * If stab_exists is not -1 then we have already checked. */ - if(stab_exists == -1 && (stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID, dxpl_id)) < 0) + if(stab_exists == -1 && (stab_exists = H5O_msg_exists(root_loc.oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check if symbol table message exists") if(stab_exists) { /* Read the root group's symbol table message */ - if(NULL == H5O_msg_read(root_loc.oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(root_loc.oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") /* Update the root group symbol table entry */ diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 4dc06ca..64c4054 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -69,7 +69,6 @@ typedef struct H5G_bt_it_gtbi_t { /* downward */ H5G_bt_it_idx_common_t common; /* Common information for "by index" lookup */ H5F_t *f; /* Pointer to file that symbol table is in */ - hid_t dxpl_id; /* DXPL for operation */ /* upward */ H5G_obj_t type; /*member type to be returned */ @@ -134,7 +133,7 @@ typedef struct H5G_bt_it_lbi_t { *------------------------------------------------------------------------- */ herr_t -H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id) +H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint) { H5HL_t *heap = NULL; /* Pointer to local heap */ size_t name_offset; /* Offset of "" name */ @@ -150,19 +149,19 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t HDassert(size_hint > 0); /* Create the B-tree */ - if(H5B_create(f, dxpl_id, H5B_SNODE, NULL, &(stab->btree_addr)/*out*/) < 0) + if(H5B_create(f, H5B_SNODE, NULL, &(stab->btree_addr)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create B-tree") /* Create symbol table private heap */ - if(H5HL_create(f, dxpl_id, size_hint, &(stab->heap_addr)/*out*/) < 0) + if(H5HL_create(f, size_hint, &(stab->heap_addr)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Insert name into the heap */ - if(UFAIL == (name_offset = H5HL_insert(f, dxpl_id, heap, (size_t)1, ""))) + if(UFAIL == (name_offset = H5HL_insert(f, heap, (size_t)1, ""))) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert name into heap") /* @@ -201,14 +200,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, - H5O_stab_t *stab) +H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab) { size_t heap_hint; /* Local heap size hint */ size_t size_hint; /* Local heap size hint */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* * Check arguments. @@ -226,18 +224,18 @@ H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, size_hint = MAX(heap_hint, H5HL_SIZEOF_FREE(grp_oloc->file) + 2); /* Go create the B-tree & local heap */ - if(H5G__stab_create_components(grp_oloc->file, stab, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(grp_oloc->file, stab, size_hint) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components") /* * Insert the symbol table message into the object header and the symbol * table entry. */ - if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab, dxpl_id) < 0) + if(H5O_msg_create(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME, stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_create() */ @@ -258,8 +256,7 @@ done: */ herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id) + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_ins_t udata; /* Data to pass through B-tree */ @@ -274,7 +271,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, HDassert(obj_lnk); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -285,7 +282,7 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, udata.crt_info = crt_info; /* Insert into symbol table */ - if(H5B_insert(f, dxpl_id, H5B_SNODE, stab->btree_addr, &udata) < 0) + if(H5B_insert(f, H5B_SNODE, stab->btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry") done: @@ -314,13 +311,12 @@ done: */ herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id) + H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info) { H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -328,15 +324,14 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, HDassert(obj_lnk); /* Retrieve symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") - if(H5G__stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, - crt_info, dxpl_id) < 0) + if(H5G__stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, crt_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5_ITER_ERROR) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_insert() */ @@ -353,7 +348,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove(const H5O_loc_t *loc, H5RS_str_t *grp_full_path_r, const char *name) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -367,11 +362,11 @@ H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_ HDassert(name && *name); /* Read in symbol table message */ - if(NULL == H5O_msg_read(loc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(loc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(loc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(loc->file, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -380,7 +375,7 @@ H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_ udata.grp_full_path_r = grp_full_path_r; /* Remove from symbol table */ - if(H5B_remove(loc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) + if(H5B_remove(loc->file, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to remove entry") done: @@ -405,7 +400,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -420,16 +415,16 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *gr HDassert(grp_oloc && grp_oloc->file); /* Look up name of link to remove, by index */ - if(H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get link information") lnk_copied = TRUE; /* Read in symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Initialize data to pass through B-tree */ @@ -438,7 +433,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *gr udata.grp_full_path_r = grp_full_path_r; /* Remove link from symbol table */ - if(H5B_remove(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) + if(H5B_remove(grp_oloc->file, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to remove entry") done: @@ -464,12 +459,10 @@ done: * Programmer: Quincey Koziol * Thursday, March 20, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) +H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_rm_t udata; /*data to pass through B-tree */ @@ -483,7 +476,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) HDassert(H5F_addr_defined(stab->heap_addr)); /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(f, dxpl_id, stab->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data for B-tree deletion */ @@ -491,7 +484,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) udata.common.heap = heap; /* Delete entire B-tree */ - if(H5B_delete(f, dxpl_id, H5B_SNODE, stab->btree_addr, &udata) < 0) + if(H5B_delete(f, H5B_SNODE, stab->btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree") /* Release resources */ @@ -500,7 +493,7 @@ H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) heap = NULL; /* Delete local heap for names */ - if(H5HL_delete(f, dxpl_id, stab->heap_addr) < 0) + if(H5HL_delete(f, stab->heap_addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table heap") done: @@ -525,7 +518,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, +H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { H5HL_t *heap = NULL; /* Local heap for group */ @@ -533,18 +526,18 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); HDassert(op); /* Get the B-tree info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Check on iteration order */ @@ -560,7 +553,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, udata.op_data = op_data; /* Iterate over the group members */ - if((ret_value = H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_iterate, &udata)) < 0) + if((ret_value = H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_iterate, &udata)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); /* Check for too high of a starting index (ex post facto :-) */ @@ -577,7 +570,7 @@ H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, udata.ltable = <able; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_build_table, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_build_table, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to build link table") /* Check for skipping out of bounds */ @@ -600,7 +593,7 @@ done: if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_iterate() */ @@ -617,12 +610,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) +H5G__stab_count(const H5O_loc_t *oloc, hsize_t *num_objs) { H5O_stab_t stab; /* Info about symbol table */ herr_t ret_value = SUCCEED; - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); @@ -632,15 +625,15 @@ H5G__stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) *num_objs = 0; /* Get the B-tree info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_count() */ @@ -657,8 +650,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, - H5_ih_info_t *bh_info) +H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info) { hsize_t snode_size; /* Symbol table node size */ H5B_info_t bt_info; /* B-tree node info */ @@ -675,14 +667,14 @@ H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, snode_size = 0; /* Get the B-tree & symbol table node size info */ - if(H5B_get_info(f, dxpl_id, H5B_SNODE, stab->btree_addr, &bt_info, H5G__node_iterate_size, &snode_size) < 0) + if(H5B_get_info(f, H5B_SNODE, stab->btree_addr, &bt_info, H5G__node_iterate_size, &snode_size) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "iteration operator failed") /* Add symbol table & B-tree node sizes to index info */ bh_info->index_size += snode_size + bt_info.size; /* Get the size of the local heap for the group */ - if(H5HL_heapsize(f, dxpl_id, stab->heap_addr, &(bh_info->heap_size)) < 0) + if(H5HL_heapsize(f, stab->heap_addr, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "iteration operator failed") done: @@ -747,7 +739,7 @@ done: */ ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, - char* name, size_t size, hid_t dxpl_id) + char* name, size_t size) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5O_stab_t stab; /* Info about local heap & B-tree */ @@ -764,11 +756,11 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t HDassert(oloc); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -776,7 +768,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -792,7 +784,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t udata_valid = TRUE; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we don't know the name now, we almost certainly went out of bounds */ @@ -869,8 +861,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, - hid_t dxpl_id) +H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_lkp_t bt_udata; /* Data to pass through B-tree */ @@ -886,11 +877,11 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, HDassert(lnk); /* Retrieve the symbol table message for the group */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't read message") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Set up user data to pass to 'find' operation callback */ @@ -905,7 +896,7 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, bt_udata.op_data = &udata; /* Search the B-tree */ - if((ret_value = H5B_find(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, &bt_udata)) < 0) + if((ret_value = H5B_find(grp_oloc->file, H5B_SNODE, stab.btree_addr, &bt_udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") done: @@ -973,7 +964,7 @@ done: */ herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, - H5O_link_t *lnk, hid_t dxpl_id) + H5O_link_t *lnk) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_it_lbi_t udata; /* Iteration information */ @@ -987,11 +978,11 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ HDassert(lnk); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap") /* Remap index for decreasing iteration order */ @@ -999,7 +990,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) + if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -1015,7 +1006,7 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ udata.found = FALSE; /* Iterate over the group members */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(grp_oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we didn't find the link, we almost certainly went out of bounds */ @@ -1055,24 +1046,24 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) +H5G__stab_valid(H5O_loc_t *grp_oloc, H5O_stab_t *alt_stab) { H5O_stab_t stab; /* Current symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ hbool_t changed = FALSE; /* Whether stab has been modified */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Read the symbol table message */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message"); /* Check if the symbol table message's b-tree address is valid */ - if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) { + if(H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr) < 0) { /* Address is invalid, try the b-tree address in the alternate symbol * table message */ - if(!alt_stab || H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, alt_stab->btree_addr) < 0) + if(!alt_stab || H5B_valid(grp_oloc->file, H5B_SNODE, alt_stab->btree_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "unable to locate b-tree") else { /* The alternate symbol table's b-tree address is valid. Adjust the @@ -1083,10 +1074,10 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) } /* end if */ /* Check if the symbol table message's heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) { + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) { /* Address is invalid, try the heap address in the alternate symbol * table message */ - if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, alt_stab->heap_addr, H5AC__READ_ONLY_FLAG))) + if(!alt_stab || NULL == (heap = H5HL_protect(grp_oloc->file, alt_stab->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "unable to locate heap") else { /* The alternate symbol table's heap address is valid. Adjust the @@ -1099,7 +1090,7 @@ H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) /* Update the symbol table message and clear errors if necessary */ if(changed) { H5E_clear_stack(NULL); - if(H5O_msg_write(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME | H5O_UPDATE_FORCE, &stab, dxpl_id) < 0) + if(H5O_msg_write(grp_oloc, H5O_STAB_ID, 0, H5O_UPDATE_TIME | H5O_UPDATE_FORCE, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to correct symbol table message") } /* end if */ @@ -1108,7 +1099,7 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_valid */ #endif /* H5_STRICT_FORMAT_CHECKS */ @@ -1161,7 +1152,7 @@ H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata) tmp_oloc.addr = ent->header; /* Get the type of the object */ - if(H5O_obj_type(&tmp_oloc, &obj_type, udata->dxpl_id) < 0) + if(H5O_obj_type(&tmp_oloc, &obj_type) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type") udata->type = H5G_map_obj_type(obj_type); } @@ -1189,19 +1180,19 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) +H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx) { H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gtbi_t udata; /* User data for B-tree callback */ H5G_obj_t ret_value = H5G_UNKNOWN; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ HDassert(oloc); /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "unable to determine local heap address") /* Set iteration information */ @@ -1209,11 +1200,10 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) udata.common.num_objs = 0; udata.common.op = H5G_stab_get_type_by_idx_cb; udata.f = oloc->file; - udata.dxpl_id = dxpl_id; udata.type = H5G_UNKNOWN; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) + if(H5B_iterate(oloc->file, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed") /* If we don't know the type now, we almost certainly went out of bounds */ @@ -1224,7 +1214,7 @@ H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) ret_value = udata.type; done: - FUNC_LEAVE_NOAPI_TAG(ret_value, H5G_UNKNOWN) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__stab_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 7271cdc..eaee737 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -29,6 +29,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ @@ -95,7 +96,7 @@ H5G__is_empty_test(hid_t gid) H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -104,14 +105,19 @@ H5G__is_empty_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* "New format" checks */ /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { /* Sanity check that new group format shouldn't have old messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") @@ -120,19 +126,19 @@ H5G__is_empty_test(hid_t gid) } /* end if */ /* Check for a link info message */ - if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0) + if((linfo_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(linfo_exists > 0) { H5O_linfo_t linfo; /* Link info message */ /* Sanity check that new group format shouldn't have old messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found") /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -151,7 +157,7 @@ H5G__is_empty_test(hid_t gid) /* "Old format" checks */ /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { H5O_stab_t stab; /* Info about local heap & B-tree */ @@ -160,17 +166,17 @@ H5G__is_empty_test(hid_t gid) /* Sanity check that old group format shouldn't have new messages */ if(linfo_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found") - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and group info messages found") /* Get the B-tree & local heap info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol table message") /* Get the count of links in the group */ - if(H5G__stab_count(&(grp->oloc), &nlinks, dxpl_id) < 0) + if(H5G__stab_count(&(grp->oloc), &nlinks) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to count links") /* Check for link count */ @@ -179,6 +185,9 @@ H5G__is_empty_test(hid_t gid) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_empty_test() */ @@ -207,7 +216,7 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -216,14 +225,19 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists == 0) HGOTO_DONE(FALSE) /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") @@ -233,12 +247,15 @@ H5G__has_links_test(hid_t gid, unsigned *nmsgs) int msg_count; /* Number of messages of a type */ /* Check how many link messages there are */ - if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_count = H5O_msg_count(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count link messages") *nmsgs = (unsigned)msg_count; } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_links_test() */ @@ -266,7 +283,7 @@ H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -275,19 +292,27 @@ H5G__has_stab_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists == 0) HGOTO_DONE(FALSE) /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link messages found") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__has_stab_test() */ @@ -317,7 +342,7 @@ H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_PACKAGE @@ -326,26 +351,31 @@ H5G__is_new_dense_test(hid_t gid) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Check if the group has a symbol table message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_DONE(FALSE) /* Check if the group has any link messages */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINK_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) HGOTO_DONE(FALSE) /* Check if the group has link info message */ - if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id)) < 0) + if((msg_exists = H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(msg_exists > 0) { H5O_linfo_t linfo; /* Link info message */ /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -356,6 +386,9 @@ H5G__is_new_dense_test(hid_t gid) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__is_new_dense_test() */ @@ -388,7 +421,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_linfo_t linfo; /* Link info message */ H5G_t *grp = NULL; /* Pointer to group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -397,21 +430,26 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(dxpl_id, grp->oloc.addr, FAIL); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set metadata tag in API context */ + H5_BEGIN_TAG(grp->oloc.addr); /* Get the link info */ - if(H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ if(!H5F_addr_defined(linfo.fheap_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) if(!H5F_addr_defined(linfo.name_bt2_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(grp->oloc.file, dxpl_id, linfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(grp->oloc.file, linfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ @@ -421,7 +459,7 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) /* Check if there is a creation order index */ if(H5F_addr_defined(linfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, dxpl_id, linfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(grp->oloc.file, linfo.corder_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ @@ -431,15 +469,17 @@ H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5G__new_dense_info_test() */ @@ -469,7 +509,7 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -478,15 +518,23 @@ H5G__lheap_size_test(hid_t gid, size_t *lheap_size) if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Make certain the group has a symbol table message */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read symbol table message") /* Check the size of the local heap for the group */ - if(H5HL_get_size(grp->oloc.file, dxpl_id, stab.heap_addr, lheap_size) < 0) + if(H5HL_get_size(grp->oloc.file, stab.heap_addr, lheap_size) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't query local heap size") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__lheap_size_test() */ @@ -518,6 +566,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign { void *obj_ptr; /* Pointer to object for ID */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -530,6 +579,11 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign if(NULL == (obj_ptr = H5I_object(obj_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get object for ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { case H5I_GROUP: @@ -586,6 +640,9 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign } /* end else */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* H5G__user_path_test() */ @@ -611,17 +668,16 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) { H5O_stab_t stab; /* Symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Verify that stab info is cached in ent */ if(ent->type != H5G_CACHED_STAB) HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "symbol table information is not cached") /* Read the symbol table message from the group */ - if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "unable to read symbol table message") /* Verify that the cached symbol table info matches the symbol table message @@ -631,11 +687,11 @@ H5G__verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "cached stab info does not match object header") /* Verify that the btree address is valid */ - if(H5B_valid(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr) < 0) + if(H5B_valid(grp_oloc->file, H5B_SNODE, stab.btree_addr) < 0) HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "b-tree address is invalid") /* Verify that the heap address is valid */ - if(NULL == (heap = H5HL_protect(grp_oloc->file, dxpl_id, stab.heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(grp_oloc->file, stab.heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "heap address is invalid") done: @@ -643,12 +699,12 @@ done: if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5G__verify_cached_stab_test() */ /*------------------------------------------------------------------------- - * Function: H5G_verify_cached_stabs_test_cb + * Function: H5G__verify_cached_stabs_test_cb * * Purpose: Verify that all entries in this node contain cached symbol * table information if and only if the entry refers to a @@ -663,9 +719,8 @@ done: *------------------------------------------------------------------------- */ static int -H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, - const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, - void H5_ATTR_UNUSED *udata) +H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, + haddr_t addr, const void H5_ATTR_UNUSED *_rt_key, void H5_ATTR_UNUSED *udata) { H5G_node_t *sn = NULL; H5O_loc_t targ_oloc; @@ -675,7 +730,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, unsigned i; int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -684,7 +739,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, HDassert(H5F_addr_defined(addr)); /* Load the node */ - if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) + if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node") /* Check each target object to see if its stab message (if present) matches @@ -699,7 +754,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, targ_oloc.addr = sn->entry[i].header; /* Load target object header */ - if(NULL == (targ_oh = H5O_protect(&targ_oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (targ_oh = H5O_protect(&targ_oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SYM, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to protect target object header") /* Check if a symbol table message exists */ @@ -708,7 +763,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, if(stab_exists) { /* Read symbol table message */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, targ_oh, H5O_STAB_ID, &stab)) + if(NULL == H5O_msg_read_oh(f, targ_oh, H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to read STAB message") /* Check if the stab matches the cached stab info */ @@ -723,23 +778,23 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, H5_ITER_ERROR, "nonexistent STAB message is cached") /* Unprotect target object */ - if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header"); targ_oh = NULL; } /* end for */ done: - if(sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) + if(sn && H5AC_unprotect(f, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") if(targ_oh) { HDassert(ret_value == H5_ITER_ERROR); - if(H5O_unprotect(&targ_oloc, dxpl_id, targ_oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header"); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_verify_cached_stabs_test_cb() */ +} /* end H5G__verify_cached_stabs_test_cb() */ /*------------------------------------------------------------------------- @@ -768,7 +823,6 @@ H5G__verify_cached_stabs_test(hid_t gid) H5O_stab_t stab; /* Symbol table message */ H5G_bt_common_t udata = {NULL, NULL}; /* Dummy udata so H5B_iterate doesn't freak out */ haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* transfer property list used for this operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -781,13 +835,11 @@ H5G__verify_cached_stabs_test(hid_t gid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") /* Set up metadata tagging */ - if(H5AC_tag(dxpl_id, grp->oloc.addr, &prev_tag) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag") + H5AC_tag(grp->oloc.addr, &prev_tag); /* Check for group having a symbol table message */ /* Check for the group having a group info message */ - if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, - dxpl_id)) < 0) + if((stab_exists = H5O_msg_exists(&(grp->oloc), H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") /* No need to check anything if the symbol table doesn't exist */ @@ -795,17 +847,16 @@ H5G__verify_cached_stabs_test(hid_t gid) HGOTO_DONE(SUCCEED); /* Read the stab */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab, dxpl_id)) + if(NULL == H5O_msg_read(&(grp->oloc), H5O_STAB_ID, &stab)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get symbol table info") /* Iterate over the b-tree, checking validity of cached information */ - if((ret_value = H5B_iterate(grp->oloc.file, dxpl_id, H5B_SNODE, - stab.btree_addr, H5G_verify_cached_stabs_test_cb, &udata)) < 0) + if((ret_value = H5B_iterate(grp->oloc.file, H5B_SNODE, stab.btree_addr, + H5G__verify_cached_stabs_test_cb, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "iteration operator failed"); /* Reset metadata tagging */ - if(H5AC_tag(dxpl_id, prev_tag, NULL) < 0) - HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to apply metadata tag") + H5AC_tag(prev_tag, NULL); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index ff1206e..37b6292 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -33,6 +33,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -73,18 +74,15 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5G_traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, +static herr_t H5G__traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5G_traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, - unsigned target, size_t *nlinks, H5G_traverse_t op, void *op_data, - hid_t lapl_id, hid_t dxpl_id); +static herr_t H5G__traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists); +static herr_t H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists); +static herr_t H5G__traverse_real(const H5G_loc_t *loc, const char *name, + unsigned target, H5G_traverse_t op, void *op_data); /*********************/ @@ -104,7 +102,7 @@ static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, /*------------------------------------------------------------------------- - * Function: H5G_traverse_slink_cb + * Function: H5G__traverse_slink_cb * * Purpose: Callback for soft link traversal. This routine sets the * correct information for the object location. @@ -117,14 +115,14 @@ static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNUSED *name, +H5G__traverse_slink_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5G_trav_slink_t *udata = (H5G_trav_slink_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check for dangling soft link */ if(obj_loc == NULL) { @@ -147,11 +145,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_slink_cb() */ +} /* end H5G__traverse_slink_cb() */ /*------------------------------------------------------------------------- - * Function: H5G_traverse_link_ud + * Function: H5G__traverse_ud * * Purpose: Callback for user-defined link traversal. Sets up a * location ID and passes it to the user traversal callback. @@ -164,9 +162,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t _lapl_id, hid_t dxpl_id) +H5G__traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists) { const H5L_class_t *link_class; /* User-defined link class */ hid_t cb_return = -1; /* The ID the user-defined callback returned */ @@ -175,20 +172,16 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, H5O_loc_t grp_oloc_copy; H5G_loc_t new_loc; /* Group location for newly opened external object */ H5G_t *grp; - hid_t lapl_id = (-1); /* LAPL local to this routine */ - H5P_genplist_t *lapl; /* LAPL with nlinks set */ hid_t cur_grp = (-1); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(grp_loc); HDassert(lnk); HDassert(lnk->type >= H5L_TYPE_UD_MIN); HDassert(obj_loc); - HDassert(nlinks); - HDassert(_lapl_id >= 0); /* Get the link class for this type of link. */ if(NULL == (link_class = H5L_find_class(lnk->type))) @@ -203,37 +196,17 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy object location") /* Create a group ID to pass to the user-defined callback */ - if(NULL == (grp = H5G_open(&grp_loc_copy, dxpl_id))) + if(NULL == (grp = H5G_open(&grp_loc_copy))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((cur_grp = H5I_register(H5I_GROUP, grp, FALSE)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "unable to register group") - /* Check for generic default property list and use link access default if so */ - if(_lapl_id == H5P_DEFAULT) { - HDassert(H5P_LINK_ACCESS_DEFAULT != -1); - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(H5P_LINK_ACCESS_DEFAULT))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get default property list") - } /* end if */ - else { - /* Get the underlying property list passed in */ - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(_lapl_id))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get property list from ID") - } /* end else */ - - /* Copy the property list passed in */ - if((lapl_id = H5P_copy_plist(lapl, FALSE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, FAIL, "unable to copy property list") - - /* Get the underlying property list copy */ - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_SYM, H5E_BADATOM, FAIL, "unable to get property list from ID") - - /* Record number of soft links left to traverse in the property list. */ - if(H5P_set(lapl, H5L_ACS_NLINKS_NAME, nlinks) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set nlink info") - /* User-defined callback function */ - cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, lapl_id); + /* (Backwardly compatible with v0 H5L_class_t traverssal callback) */ + if(link_class->version == H5L_LINK_CLASS_T_VERS_0) + cb_return = (((const H5L_class_0_t *)link_class)->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl()); + else + cb_return = (link_class->trav_func)(lnk->name, cur_grp, lnk->u.ud.udata, lnk->u.ud.size, H5CX_get_lapl(), H5CX_get_dxpl()); /* Check for failing to locate the object */ if(cb_return < 0) { @@ -284,16 +257,12 @@ done: if(ret_value < 0 && cb_return > 0 && H5I_dec_ref(cb_return) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") - /* Close the LAPL, if we copied one */ - if(lapl_id > 0 && H5I_dec_ref(lapl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close copied link access property list") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_ud() */ +} /* end H5G__traverse_ud() */ /*------------------------------------------------------------------------- - * Function: H5G_traverse_slink + * Function: H5G__traverse_slink * * Purpose: Traverses symbolic link. The link head appears in the group * whose entry is GRP_LOC and the link tail entry is OBJ_LOC. @@ -309,9 +278,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, - hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id) +H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, + H5G_loc_t *obj_loc/*in,out*/, unsigned target, hbool_t *obj_exists) { H5G_trav_slink_t udata; /* User data to pass to link traversal callback */ H5G_name_t tmp_obj_path; /* Temporary copy of object's path */ @@ -322,13 +290,12 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, hbool_t tmp_grp_loc_set = FALSE; /* Flag to indicate that tmp group location is initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(grp_loc); HDassert(lnk); HDassert(lnk->type == H5L_TYPE_SOFT); - HDassert(nlinks); /* Set up temporary location */ tmp_grp_loc.oloc = &tmp_grp_oloc; @@ -356,7 +323,7 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, udata.obj_loc = obj_loc; /* Traverse the link */ - if(H5G_traverse_real(&tmp_grp_loc, lnk->u.soft.name, target, nlinks, H5G_traverse_slink_cb, &udata, lapl_id, dxpl_id) < 0) + if(H5G__traverse_real(&tmp_grp_loc, lnk->u.soft.name, target, H5G__traverse_slink_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") /* Pass back information about whether the object exists */ @@ -374,7 +341,7 @@ done: H5G_loc_free(&tmp_grp_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_slink() */ +} /* end H5G__traverse_slink() */ /*------------------------------------------------------------------------- @@ -392,9 +359,10 @@ done: */ herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, - unsigned target, size_t *nlinks, hbool_t last_comp, - H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id) + unsigned target, hbool_t last_comp, H5G_loc_t *obj_loc, + hbool_t *obj_exists) { + size_t nlinks; /* # of soft / UD links left to traverse */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -403,7 +371,6 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, HDassert(grp_loc); HDassert(lnk); HDassert(obj_loc); - HDassert(nlinks); /* * If we found a symbolic link then we should follow it. But if this @@ -412,9 +379,20 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, */ if(H5L_TYPE_SOFT == lnk->type && (0 == (target & H5G_TARGET_SLINK) || !last_comp)) { - if((*nlinks)-- <= 0) + /* Get the # of soft / UD links left to traverse */ + if(H5CX_get_nlinks(&nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") + + /* Decrement # of links and range check */ + if((nlinks)-- <= 0) HGOTO_ERROR(H5E_LINK, H5E_NLINKS, FAIL, "too many links") - if(H5G_traverse_slink(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), nlinks, obj_exists, lapl_id, dxpl_id) < 0) + + /* Update the # of links in the API context */ + if(H5CX_set_nlinks(nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't update # of soft / UD links to traverse") + + /* Traverse soft link */ + if(H5G__traverse_slink(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "symbolic link traversal failed") } /* end if */ @@ -425,9 +403,20 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, */ if(lnk->type >= H5L_TYPE_UD_MIN && (0 == (target & H5G_TARGET_UDLINK) || !last_comp) ) { - if((*nlinks)-- <= 0) + /* Get the # of soft / UD links left to traverse */ + if(H5CX_get_nlinks(&nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") + + /* Decrement # of links and range check */ + if((nlinks)-- <= 0) HGOTO_ERROR(H5E_LINK, H5E_NLINKS, FAIL, "too many links") - if(H5G_traverse_ud(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), nlinks, obj_exists, lapl_id, dxpl_id) < 0) + + /* Update the # of links in the API context */ + if(H5CX_set_nlinks(nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't update # of soft / UD links to traverse") + + /* Traverse user-defined link */ + if(H5G__traverse_ud(grp_loc, lnk, obj_loc, (target & H5G_TARGET_EXISTS), obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "user-defined link traversal failed") } /* end if */ @@ -462,7 +451,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_traverse_real + * Function: H5G__traverse_real * * Purpose: Internal version of path traversal routine * @@ -478,8 +467,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, - size_t *nlinks, H5G_traverse_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id) +H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, + H5G_traverse_t op, void *op_data) { H5G_loc_t loc; /* Location of start object */ H5O_loc_t grp_oloc; /* Object loc. for current group */ @@ -500,12 +489,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, hbool_t last_comp = FALSE; /* Flag to indicate that a component is the last component in the name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check parameters */ HDassert(_loc); HDassert(name); - HDassert(nlinks); HDassert(op); /* @@ -590,7 +578,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, } /* end if */ /* Get information for object in current group */ - if((lookup_status = H5G__obj_lookup(grp_loc.oloc, comp, &lnk/*out*/, dxpl_id)) < 0) + if((lookup_status = H5G__obj_lookup(grp_loc.oloc, comp, &lnk/*out*/)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't look up component") obj_exists = FALSE; @@ -611,7 +599,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ - if(H5G__traverse_special(&grp_loc, &lnk, target, nlinks, last_comp, &obj_loc, &obj_exists, lapl_id, dxpl_id) < 0) + if(H5G__traverse_special(&grp_loc, &lnk, target, last_comp, &obj_loc, &obj_exists) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") } /* end if */ @@ -660,11 +648,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a group info message */ /* (OK if not found) */ - if((exists = H5O_msg_exists(grp_loc.oloc, H5O_GINFO_ID, dxpl_id)) < 0) + if((exists = H5O_msg_exists(grp_loc.oloc, H5O_GINFO_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Get the group info for parent group */ - if(NULL == H5O_msg_read(grp_loc.oloc, H5O_GINFO_ID, &par_ginfo, dxpl_id)) + if(NULL == H5O_msg_read(grp_loc.oloc, H5O_GINFO_ID, &par_ginfo)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "group info message not present") /* Use parent group info settings */ @@ -677,7 +665,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a link info message */ /* (OK if not found) */ /* Get the link info for parent group */ - if((exists = H5G__obj_get_linfo(grp_loc.oloc, &par_linfo, dxpl_id)) < 0) + if((exists = H5G__obj_get_linfo(grp_loc.oloc, &par_linfo)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Only keep the creation order information from the parent @@ -694,11 +682,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a filter pipeline message */ /* (OK if not found) */ - if((exists = H5O_msg_exists(grp_loc.oloc, H5O_PLINE_ID, dxpl_id)) < 0) + if((exists = H5O_msg_exists(grp_loc.oloc, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Get the filter pipeline for parent group */ - if(NULL == H5O_msg_read(grp_loc.oloc, H5O_PLINE_ID, &par_pline, dxpl_id)) + if(NULL == H5O_msg_read(grp_loc.oloc, H5O_PLINE_ID, &par_pline)) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "filter pipeline message not present") /* Use parent filter pipeline settings */ @@ -713,15 +701,15 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, gcrt_info.gcpl_id = H5P_GROUP_CREATE_DEFAULT; gcrt_info.cache_type = H5G_NOTHING_CACHED; HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); - if(H5G__obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) + if(H5G__obj_create_real(grp_oloc.file, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") /* Insert new group into current group's symbol table */ - if(H5G__loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info, dxpl_id) < 0) + if(H5G__loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert intermediate group") /* Decrement refcount on intermediate group's object header in memory */ - if(H5O_dec_rc_by_loc(obj_loc.oloc, dxpl_id) < 0) + if(H5O_dec_rc_by_loc(obj_loc.oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") /* Close new group */ @@ -806,7 +794,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't release wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_real() */ +} /* end H5G__traverse_real() */ /*------------------------------------------------------------------------- @@ -827,11 +815,10 @@ done: */ herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traverse_t op, - void *op_data, hid_t lapl_id, hid_t dxpl_id) + void *op_data) { - size_t nlinks; /* Link countdown value */ - H5P_genplist_t *lapl; /* Property list with value for nlinks */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t orig_nlinks; /* Original value for # of soft / UD links able to traverse */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -842,17 +829,14 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no starting location") if(!op) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no operation provided") - HDassert(lapl_id >= 0); - /* Set nlinks value from property list, if it exists */ - if(lapl_id == H5P_DEFAULT) - nlinks = H5L_NUM_LINKS; - else { - if(NULL == (lapl = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - if(H5P_get(lapl, H5L_ACS_NLINKS_NAME, &nlinks) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of links") - } /* end else */ + /* Retrieve the original # of soft / UD links that are able to be traversed */ + /* (So that multiple calls to H5G_traverse don't incorrectly look + * like they've traversed too many. Nested calls, like in H5L__move(), + * may need their own mechanism to set & reset the # of links to traverse) + */ + if(H5CX_get_nlinks(&orig_nlinks) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") /* Set up invalid tag. This is a precautionary step only. Setting an invalid tag here will ensure that no metadata accessed while doing the traversal @@ -860,14 +844,18 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver first. This will ensure we're not accidentally tagging something we shouldn't be during the traversal. Note that for best tagging assertion coverage, setting H5C_DO_TAGGING_SANITY_CHECKS is advised. */ - H5_BEGIN_TAG(dxpl_id, H5AC__INVALID_TAG, FAIL); + H5_BEGIN_TAG(H5AC__INVALID_TAG); /* Go perform "real" traversal */ - if(H5G_traverse_real(loc, name, target, &nlinks, op, op_data, lapl_id, dxpl_id) < 0) + if(H5G__traverse_real(loc, name, target, op, op_data) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_NOTFOUND, FAIL, "internal path traversal failed") /* Reset tag after traversal */ - H5_END_TAG(FAIL); + H5_END_TAG + + /* Reset the # of soft / UD links that can be traversed */ + if(H5CX_set_nlinks(orig_nlinks) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HF.c b/src/H5HF.c index 6c09969..b7a6244 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -150,7 +150,7 @@ H5HF_op_write(const void *obj, size_t obj_len, void *op_data) *------------------------------------------------------------------------- */ H5HF_t * -H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) +H5HF_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -166,7 +166,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HDassert(cparam); /* Create shared fractal heap header */ - if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, dxpl_id, cparam))) + if(HADDR_UNDEF == (fh_addr = H5HF_hdr_create(f, cparam))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Allocate fractal heap wrapper */ @@ -174,7 +174,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed for fractal heap info") /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__NO_FLAGS_SET))) 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 */ @@ -193,10 +193,10 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value && fh) - if(H5HF_close(fh, dxpl_id) < 0) + if(H5HF_close(fh) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, NULL, "unable to close fractal heap") FUNC_LEAVE_NOAPI(ret_value) @@ -218,7 +218,7 @@ done: *------------------------------------------------------------------------- */ H5HF_t * -H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) +H5HF_open(H5F_t *f, haddr_t fh_addr) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ @@ -233,7 +233,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Load the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Check for pending heap deletion */ @@ -260,10 +260,10 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) ret_value = fh; done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release fractal heap header") if(!ret_value && fh) - if(H5HF_close(fh, dxpl_id) < 0) + if(H5HF_close(fh) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, NULL, "unable to close fractal heap") FUNC_LEAVE_NOAPI(ret_value) @@ -347,8 +347,7 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) *------------------------------------------------------------------------- */ herr_t -H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, - void *id/*out*/) +H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id/*out*/) { H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; @@ -374,7 +373,7 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, if(size > hdr->max_man_size) { /* Store 'huge' object in heap */ /* (Casting away const OK - QAK) */ - if(H5HF_huge_insert(hdr, dxpl_id, size, (void *)obj, id) < 0) + if(H5HF__huge_insert(hdr, size, (void *)obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'huge' object in fractal heap") } /* end if */ /* Check for 'tiny' object */ @@ -390,7 +389,7 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "'write once' managed blocks not su } /* end if */ else { /* Allocate space for object in 'managed' heap */ - if(H5HF_man_insert(hdr, dxpl_id, size, obj, id) < 0) + if(H5HF__man_insert(hdr, size, obj, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't store 'managed' object in fractal heap") } /* end else */ } /* end else */ @@ -414,7 +413,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) +H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -445,7 +444,7 @@ H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'managed' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { - if(H5HF_huge_get_obj_len(fh->hdr, dxpl_id, id, obj_len_p) < 0) + if(H5HF__huge_get_obj_len(fh->hdr, id, obj_len_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's length") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -476,7 +475,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) +H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -507,7 +506,7 @@ H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, hsize_t *obj_off_p) } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Huge objects are located directly in the file */ - if(H5HF__huge_get_obj_off(fh->hdr, dxpl_id, id, obj_off_p) < 0) + if(H5HF__huge_get_obj_off(fh->hdr, id, obj_off_p) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'huge' object's offset") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -538,7 +537,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *_id, void *obj/*out*/) +H5HF_read(H5HF_t *fh, const void *_id, void *obj/*out*/) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -566,12 +565,12 @@ H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *_id, void *obj/*out*/) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Read object from managed heap blocks */ - if(H5HF_man_read(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__man_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Read 'huge' object from file */ - if(H5HF_huge_read(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__huge_read(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -615,8 +614,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, - const void *obj) +H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void *obj) { uint8_t *id = (uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -645,12 +643,12 @@ H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t H5_ATTR_UNUSED *id_chan if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Operate on object from managed heap blocks */ /* (ID can't change and modifying object is "easy" to manage) */ - if(H5HF_man_write(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__man_write(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "can't write to 'managed' heap object") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Operate on "huge" object */ - if(H5HF_huge_write(fh->hdr, dxpl_id, id, obj) < 0) + if(H5HF__huge_write(fh->hdr, id, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "can't write to 'huge' heap object") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -687,8 +685,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *_id, H5HF_operator_t op, - void *op_data) +H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -716,12 +713,12 @@ H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *_id, H5HF_operator_t op, /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Operate on object from managed heap blocks */ - if(H5HF_man_op(fh->hdr, dxpl_id, id, op, op_data) < 0) + if(H5HF__man_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Operate on 'huge' object from file */ - if(H5HF_huge_op(fh->hdr, dxpl_id, id, op, op_data) < 0) + if(H5HF__huge_op(fh->hdr, id, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -753,7 +750,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) +H5HF_remove(H5HF_t *fh, const void *_id) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -781,12 +778,12 @@ H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) /* Check type of object in heap */ if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_MAN) { /* Remove object from managed heap blocks */ - if(H5HF_man_remove(fh->hdr, dxpl_id, id) < 0) + if(H5HF__man_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_HUGE) { /* Remove 'huge' object from file & v2 B-tree tracker */ - if(H5HF_huge_remove(fh->hdr, dxpl_id, id) < 0) + if(H5HF__huge_remove(fh->hdr, id) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'huge' object from fractal heap") } /* end if */ else if((id_flags & H5HF_ID_TYPE_MASK) == H5HF_ID_TYPE_TINY) { @@ -818,7 +815,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_close(H5HF_t *fh, hid_t dxpl_id) +H5HF_close(H5HF_t *fh) { hbool_t pending_delete = FALSE; /* Whether the heap is pending deletion */ haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ @@ -842,7 +839,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ - if(H5HF_space_close(fh->hdr, dxpl_id) < 0) + if(H5HF__space_close(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") /* Reset the block iterator, if necessary */ @@ -860,7 +857,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) * has the address of an object in the file, which might be * modified by the shutdown routine - QAK) */ - if(H5HF_huge_term(fh->hdr, dxpl_id) < 0) + if(H5HF__huge_term(fh->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release 'huge' object info") /* Check for pending heap deletion */ @@ -885,11 +882,11 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) H5HF_hdr_t *hdr; /* Another pointer to fractal heap header */ /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(fh->f, dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(fh->f, heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Delete heap, starting with header (unprotects header) */ - if(H5HF_hdr_delete(hdr, dxpl_id) < 0) + if(H5HF__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") } /* end if */ @@ -915,7 +912,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) +H5HF_delete(H5F_t *f, haddr_t fh_addr) { H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; /* Return value */ @@ -929,7 +926,7 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Lock the heap header into memory */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Check for files using shared heap header */ @@ -937,14 +934,14 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) hdr->pending_delete = TRUE; else { /* Delete heap now, starting with header (unprotects header) */ - if(H5HF_hdr_delete(hdr, dxpl_id) < 0) + if(H5HF__hdr_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") hdr = NULL; } /* end if */ done: /* Unprotect the header, if an error occurred */ - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 2d35368..5807c56 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -306,7 +306,7 @@ H5HF__huge_bt2_indir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -509,7 +509,7 @@ H5HF__huge_bt2_filt_indir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -691,7 +691,7 @@ H5HF__huge_bt2_dir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ @@ -903,7 +903,7 @@ H5HF__huge_bt2_filt_dir_remove(const void *nrecord, void *_udata) FUNC_ENTER_PACKAGE /* Free the space in the file for the object being removed */ - if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len) < 0) + if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free space for huge object on disk") /* Set the length of the object removed */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 069bf17..6572720 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -79,9 +79,8 @@ static htri_t H5HF__cache_hdr_verify_chksum(const void *image_ptr, size_t len, v static void *H5HF__cache_hdr_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_hdr_free_icr(void *thing); @@ -91,9 +90,8 @@ static htri_t H5HF__cache_iblock_verify_chksum(const void *image_ptr, size_t len static void *H5HF__cache_iblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_iblock_pre_serialize(H5F_t *f, void *thing, + haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *thing); @@ -104,26 +102,26 @@ static htri_t H5HF__cache_dblock_verify_chksum(const void *image_ptr, size_t len static void *H5HF__cache_dblock_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len); -static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, - void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, - unsigned *flags); +static herr_t H5HF__cache_dblock_pre_serialize(H5F_t *f, void *thing, haddr_t addr, + size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *thing); static herr_t H5HF__cache_dblock_free_icr(void *thing); +static herr_t H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size); /* Debugging Function Prototypes */ #ifndef NDEBUG -static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, - H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean); +static herr_t H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, + hbool_t *fd_clean, hbool_t *clean); static herr_t H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, - hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, - unsigned *iblock_status, hbool_t *fd_clean, hbool_t *clean); + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, + hbool_t *fd_clean, hbool_t *clean); static herr_t H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_dblocks); static herr_t H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, - hid_t dxpl_id, haddr_t fd_parent_addr, H5HF_indirect_t *iblock, + haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, hbool_t *has_iblocks); #endif /* NDEBUG */ @@ -183,7 +181,7 @@ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{ H5HF__cache_dblock_serialize, /* 'serialize' callback */ H5HF__cache_dblock_notify, /* 'notify' callback */ H5HF__cache_dblock_free_icr, /* 'free_icr' callback */ - NULL, /* 'fsf_size' callback */ + H5HF__cache_dblock_fsf_size, /* 'fsf_size' callback */ }}; @@ -572,7 +570,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, hdr->pline_root_direct_filter_mask); /* Decode I/O filter information */ - if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, udata->dxpl_id, NULL, H5O_PLINE_ID, image))) + if(NULL == (pline = (H5O_pline_t *)H5O_msg_decode(hdr->f, NULL, H5O_PLINE_ID, image))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't decode I/O pipeline filters") /* Advance past filter info to checksum */ @@ -665,9 +663,9 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, - void *_thing, haddr_t addr, size_t len, haddr_t H5_ATTR_UNUSED *new_addr, - size_t H5_ATTR_UNUSED *new_len, unsigned *flags) +H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, + haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len, + unsigned *flags) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -716,7 +714,7 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, * call still looks for dirty descendants. At present we do not check * this value. */ - if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, dxpl_id, hdr, &fd_children_clean, &descendants_clean) < 0) + if(H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, hdr, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") HDassert(fd_children_clean); } @@ -1044,7 +1042,10 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, /* this copy of the parent pointer is needed by the notify callback so */ /* that it can take down flush dependencies on eviction even if */ /* the parent pointer has been nulled out. JRM -- 5/18/14 */ - iblock->fd_parent = udata->par_info->iblock; + if(udata->par_info->iblock) + iblock->fd_parent = udata->par_info->iblock; + else + iblock->fd_parent = udata->par_info->hdr; iblock->par_entry = udata->par_info->entry; if(iblock->parent) { /* Share parent block */ @@ -1203,9 +1204,9 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, - haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, - size_t H5_ATTR_UNUSED *new_len, unsigned *flags) +H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, + size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len, + unsigned *flags) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */ @@ -1247,7 +1248,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, * there is no need to check to see if it is pinned or protected, or to * protect it if it is not. */ - if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, dxpl_id, iblock->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) + if(H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, iblock->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") HDassert(fd_children_clean); } @@ -1260,14 +1261,14 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, haddr_t iblock_addr; /* Allocate 'normal' space for the new indirect block on disk */ - if(HADDR_UNDEF == (iblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (iblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") /* Sanity check */ HDassert(!H5F_addr_eq(iblock->addr, iblock_addr)); /* Let the metadata cache know the block moved */ - if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr, dxpl_id) < 0) + if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move indirect block") /* Update the internal address for the block */ @@ -1459,9 +1460,6 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); HDassert(iblock->hdr); - if(action == H5AC_NOTIFY_ACTION_BEFORE_EVICT) - HDassert((iblock->parent == iblock->fd_parent) || ((NULL == iblock->parent) && (iblock->fd_parent))); - /* further sanity checks */ if(iblock->parent == NULL) { /* pointer from hdr to root iblock will not be set up unless */ @@ -1492,16 +1490,10 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: - if(iblock->parent) { /* this is a child iblock */ - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(iblock->parent, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end if */ - else { /* this is the root iblock */ - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(iblock->hdr, iblock) < 0) + /* Create flush dependency with parent, if there is one */ + if(iblock->fd_parent) + if(H5AC_create_flush_dependency(iblock->fd_parent, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end else */ break; case H5AC_NOTIFY_ACTION_AFTER_FLUSH: @@ -1515,16 +1507,12 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: - if(iblock->fd_parent) { /* this is a child iblock */ - /* destroy flush dependency with parent iblock */ + if(iblock->fd_parent) { + /* Destroy flush dependency with parent */ if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + iblock->fd_parent = NULL; } /* end if */ - else { /* this is the root iblock */ - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(iblock->hdr, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } /* end else */ break; default: @@ -1890,7 +1878,10 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Address of parent block */ dblock->parent = par_info->iblock; - dblock->fd_parent = par_info->iblock; + if(par_info->iblock) + dblock->fd_parent = par_info->iblock; + else + dblock->fd_parent = par_info->hdr; dblock->par_entry = par_info->entry; if(dblock->parent) { /* Share parent block */ @@ -2080,7 +2071,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, +H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { hbool_t at_tmp_addr; /* Flag to indicate direct block is */ @@ -2257,11 +2248,11 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(!at_tmp_addr) /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, addr, (hsize_t)hdr->pline_root_direct_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Update information about compressed direct block's @@ -2309,11 +2300,11 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(!at_tmp_addr) /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Update information about compressed direct block's @@ -2353,7 +2344,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, */ if(at_tmp_addr) { /* Allocate 'normal' space for the direct block */ - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") /* Check for root direct block */ @@ -2512,23 +2503,14 @@ H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); HDassert(dblock->hdr); - HDassert((dblock->fd_parent) || - ((dblock->hdr->man_dtable.curr_root_rows == 0) && (dblock->block_off == (hsize_t)0))); switch(action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: - HDassert(dblock->parent == dblock->fd_parent); - if(dblock->parent) { /* this is a leaf dblock */ - /* create flush dependency with parent iblock */ - if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) + /* Create flush dependency with parent, if there is one */ + if(dblock->fd_parent) + if(H5AC_create_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end if */ - else { /* this is a root dblock */ - /* create flush dependency with header */ - if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") - } /* end else */ break; case H5AC_NOTIFY_ACTION_AFTER_FLUSH: @@ -2542,18 +2524,12 @@ H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: - HDassert((dblock->parent == dblock->fd_parent) || - ((NULL == dblock->parent) && (dblock->fd_parent))); - if(dblock->fd_parent) { /* this is a leaf dblock */ - /* destroy flush dependency with parent iblock */ + if(dblock->fd_parent) { + /* Destroy flush dependency with parent */ if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; } /* end if */ - else { /* this is a root dblock */ - /* destroy flush dependency with header */ - if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } /* end else */ break; default: @@ -2606,6 +2582,42 @@ done: } /* end H5HF__cache_dblock_free_icr() */ +/*------------------------------------------------------------------------- + * Function: H5HF__cache_dblock_fsf_size + * + * Purpose: Tell the metadata cache the actual amount of file space + * to free when a dblock entry is destroyed with the free + * file space flag set. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 1/5/18 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) +{ + const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Fractal heap direct block */ + + FUNC_ENTER_STATIC_NOERR + + /* Sanity checks */ + HDassert(dblock); + HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + HDassert(dblock->file_size > 0); + HDassert(fsf_size); + + /* Set free space in file size */ + *fsf_size = dblock->file_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF__cache_dblock_fsf_size() */ + + /*------------------------------------------------------------------------ * Function: H5HF__cache_verify_hdr_descendants_clean * @@ -2671,8 +2683,8 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, - H5HF_hdr_t *hdr, hbool_t *fd_clean, hbool_t *clean) +H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, + hbool_t *fd_clean, hbool_t *clean) { hbool_t fd_exists = FALSE; /* whether flush dependency exists. */ haddr_t hdr_addr; /* Address of header */ @@ -2793,19 +2805,19 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * in this case, since we know that the entry is in cache, * we can pass NULL udata. * - * The tag specified in the dxpl we received - * as a parameter (via dxpl_id) may not be correct. + * The tag specified in the API context we received + * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by * these macros must be reported with HGOTO_ERROR_TAG. */ - H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) + H5_BEGIN_TAG(hdr->heap_addr) - if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (root_iblock = (H5HF_indirect_t *)H5AC_protect(f, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - H5_END_TAG(FAIL) + H5_END_TAG unprotect_root_iblock = TRUE; } /* end if */ @@ -2867,19 +2879,19 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, * in this case, since we know that the entry is in cache, * we can pass NULL udata. * - * The tag associated specified in the dxpl we received - * as a parameter (via dxpl_id) may not be correct. + * The tag associated specified in the API context we received + * as a parameter (via API context) may not be correct. * Grab the (hopefully) correct tag from the header, - * and load it into the dxpl via the H5_BEGIN_TAG and + * and load it into the API context via the H5_BEGIN_TAG and * H5_END_TAG macros. Note that any error bracked by * these macros must be reported with HGOTO_ERROR_TAG. */ - H5_BEGIN_TAG(dxpl_id, hdr->heap_addr, FAIL) + H5_BEGIN_TAG(hdr->heap_addr) - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(f, H5AC_FHEAP_IBLOCK, root_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - H5_END_TAG(FAIL) + H5_END_TAG unprotect_root_iblock = TRUE; HDassert(iblock == root_iblock); @@ -2893,13 +2905,13 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, hid_t dxpl_id, HDassert(root_iblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, hdr->heap_addr, root_iblock, &root_iblock_status, fd_clean, clean) < 0) + if(H5HF__cache_verify_iblock_descendants_clean(f, hdr->heap_addr, root_iblock, &root_iblock_status, fd_clean, clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify root iblock & descendants clean.") /* Unprotect the root indirect block if required */ if(unprotect_root_iblock) { HDassert(root_iblock); - if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") } /* end if */ } /* end else */ @@ -3036,9 +3048,9 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, unsigned *iblock_status, - hbool_t * fd_clean, hbool_t *clean) +H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, + H5HF_indirect_t *iblock, unsigned *iblock_status, hbool_t * fd_clean, + hbool_t *clean) { hbool_t has_dblocks = FALSE; hbool_t has_iblocks = FALSE; @@ -3060,7 +3072,7 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, hid_t dxpl_id, if((*fd_clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_dblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify dblocks clean.") - if((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, dxpl_id, fd_parent_addr, iblock, fd_clean, clean, &has_iblocks) < 0) + if((*fd_clean) && H5HF__cache_verify_descendant_iblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_iblocks) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify iblocks clean.") /* verify that flush dependency setup is plausible */ @@ -3318,9 +3330,9 @@ done: */ #ifndef NDEBUG static herr_t -H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, - haddr_t fd_parent_addr, H5HF_indirect_t *iblock, hbool_t *fd_clean, - hbool_t *clean, hbool_t *has_iblocks) +H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, + H5HF_indirect_t *iblock, hbool_t *fd_clean, hbool_t *clean, + hbool_t *has_iblocks) { unsigned first_iblock_index; unsigned last_iblock_index; @@ -3442,23 +3454,23 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, /* in this case, since we know that the */ /* entry is in cache, we can pass NULL udata */ /* */ - /* The tag associated specified in the dxpl */ - /* we received as a parameter (via dxpl_id) */ + /* The tag associated specified in the API context */ + /* we received as a parameter (via API context) */ /* may not be correct. */ /* */ /* Grab the (hopefully) correct tag from the */ - /* parent iblock, and load it into the dxpl */ + /* parent iblock, and load it into the API context */ /* via the H5_BEGIN_TAG and H5_END_TAG */ /* macros. Note that any error bracked by */ /* these macros must be reported with */ /* HGOTO_ERROR_TAG. */ - H5_BEGIN_TAG(dxpl_id, iblock->hdr->heap_addr, FAIL) + H5_BEGIN_TAG(iblock->hdr->heap_addr) - if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) + if(NULL == (child_iblock = (H5HF_indirect_t *) H5AC_protect(f, H5AC_FHEAP_IBLOCK, child_iblock_addr, NULL, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR_TAG(H5E_HEAP, H5E_CANTPROTECT, FAIL, "H5AC_protect() faild.") - H5_END_TAG(FAIL) + H5_END_TAG unprotect_child_iblock = TRUE; } /* end if */ @@ -3489,7 +3501,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, HDassert(child_iblock->addr == child_iblock_addr); /* now make the recursive call */ - if(H5HF__cache_verify_iblock_descendants_clean(f, dxpl_id, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) + if(H5HF__cache_verify_iblock_descendants_clean(f, fd_parent_addr, child_iblock, &child_iblock_status, fd_clean, clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify child iblock clean.") /* if iblock_addr != fd_parent_addr, verify that a flush @@ -3506,7 +3518,7 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, hid_t dxpl_id, /* if we protected the child iblock, unprotect it now */ if(unprotect_child_iblock) { - if(H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_IBLOCK, child_iblock_addr, child_iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(f, H5AC_FHEAP_IBLOCK, child_iblock_addr, child_iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() faild.") } /* end if */ } /* end if */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 279de1e..70dfeed 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -111,7 +111,7 @@ static herr_t H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, *------------------------------------------------------------------------- */ herr_t -H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, const void *_id, FILE *stream, int indent, int fwidth) +H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ uint8_t id_flags; /* Heap ID flag bits */ @@ -154,11 +154,11 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ /* Get the length of the heap object */ - if(H5HF_get_obj_len(fh, dxpl_id, id, &obj_len) < 0) + if(H5HF_get_obj_len(fh, id, &obj_len) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") /* Get the offset of the heap object */ - if(H5HF_get_obj_off(fh, dxpl_id, id, &obj_off) < 0) + if(H5HF_get_obj_off(fh, id, &obj_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve heap ID length") /* Display the heap ID */ @@ -257,7 +257,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi *------------------------------------------------------------------------- */ void -H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) +H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -341,8 +341,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE "Filter mask for root direct block:", hdr->pline_root_direct_filter_mask); } /* end if */ - H5O_debug_id(H5O_PLINE_ID, hdr->f, dxpl_id, &(hdr->pline), stream, - indent + 3, MAX(0, fwidth - 3)); + H5O_debug_id(H5O_PLINE_ID, hdr->f, &(hdr->pline), stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ /* Print internal (runtime) information, if requested */ @@ -378,7 +377,7 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -395,14 +394,14 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Print the information about the heap's header */ - H5HF_hdr_print(hdr, dxpl_id, FALSE, stream, indent, fwidth); + H5HF_hdr_print(hdr, FALSE, stream, indent, fwidth); done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -507,8 +506,8 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t hdr_addr, size_t block_size) +H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, size_t block_size) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_direct_t *dblock = NULL; /* Fractal heap direct block info */ @@ -531,13 +530,13 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(block_size > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, addr, block_size, NULL, 0, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap direct block") /* Print opening message */ @@ -562,7 +561,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Initialize the free space information for the heap */ - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* If there is a free space manager for the heap, check for sections that overlap this block */ @@ -583,11 +582,11 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); /* Iterate over the free space sections, to detect overlaps with this block */ - if(H5FS_sect_iterate(f, dxpl_id, hdr->fspace, H5HF_dblock_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, hdr->fspace, H5HF_dblock_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") /* Close the free space information */ - if(H5HF_space_close(hdr, dxpl_id) < 0) + if(H5HF__space_close(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") /* Keep the amount of space free */ @@ -610,9 +609,9 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, H5_buffer_dump(stream, indent, dblock->blk, marker, (size_t)0, dblock->size); done: - if(dblock && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_DBLOCK, addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(f, H5AC_FHEAP_DBLOCK, addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") H5MM_xfree(marker); @@ -766,8 +765,8 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t hdr_addr, unsigned nrows) +H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, + haddr_t hdr_addr, unsigned nrows) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ @@ -788,22 +787,22 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDassert(nrows > 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* * Load the heap indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, addr, nrows, NULL, 0, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Print the information about the heap's indirect block */ H5HF_iblock_print(iblock, FALSE, stream, indent, fwidth); done: - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) @@ -879,8 +878,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, - FILE *stream, int indent, int fwidth) +H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, + int fwidth) { H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -897,11 +896,11 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, HDassert(fwidth >= 0); /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") /* Initialize the free space information for the heap */ - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* If there is a free space manager for the heap, iterate over them */ @@ -915,16 +914,16 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, udata.fwidth = fwidth; /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, hdr->fspace, H5HF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, hdr->fspace, H5HF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") /* Close the free space information */ - if(H5HF_space_close(hdr, dxpl_id) < 0) + if(H5HF__space_close(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") } /* end if */ done: - if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(hdr && H5AC_unprotect(f, H5AC_FHEAP_HDR, fh_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 4496962..a6560e2 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -79,7 +79,7 @@ H5FL_DEFINE(H5HF_direct_t); /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_create + * Function: H5HF__man_dblock_create * * Purpose: Allocate & initialize a managed direct block * @@ -92,7 +92,7 @@ H5FL_DEFINE(H5HF_direct_t); *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, +H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p, H5HF_free_section_t **ret_sec_node) { H5HF_free_section_t *sec_node; /* Pointer to free space section for block */ @@ -101,7 +101,7 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo size_t free_space; /* Free space in new block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -155,16 +155,19 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") } /* end if */ else { - if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)dblock->size))) + if(HADDR_UNDEF == (dblock_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_DBLOCK, (hsize_t)dblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") } /* end else */ /* Attach to parent indirect block, if there is one */ dblock->parent = par_iblock; - dblock->fd_parent = par_iblock; - if(dblock->parent) + if(dblock->parent) { if(H5HF_man_iblock_attach(dblock->parent, par_entry, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach direct block to parent indirect block") + dblock->fd_parent = par_iblock; + } /* end if */ + else + dblock->fd_parent = hdr; dblock->par_entry = par_entry; /* Create a new 'single' section for the free space in the block */ @@ -178,12 +181,12 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo *ret_sec_node = sec_node; else { /* Add new free space to the heap's list of space */ - if(H5HF_space_add(hdr, dxpl_id, sec_node, 0) < 0) + if(H5HF__space_add(hdr, sec_node, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add direct block free space to global list") } /* end else */ /* Cache the new fractal heap direct block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap direct block to cache") /* Increase the allocated heap size */ @@ -201,11 +204,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_create() */ +} /* end H5HF__man_dblock_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_destroy + * Function: H5HF__man_dblock_destroy * * Purpose: Destroy a managed direct block * @@ -222,14 +225,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, - haddr_t dblock_addr) +H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, + haddr_t dblock_addr, hbool_t *parent_removed) { hsize_t dblock_size; /* Size of direct block on disk */ unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -258,6 +261,10 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, else dblock_size = (hsize_t)dblock->size; + /* Reset the parent_removed flag */ + if(parent_removed) + *parent_removed = FALSE; + /* Check for root direct block */ if(hdr->man_dtable.curr_root_rows == 0) { /* Sanity check */ @@ -267,11 +274,8 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, /* Sanity check block iterator */ HDassert(!H5HF_man_iter_ready(&hdr->next_block)); - /* Reset root pointer information */ - hdr->man_dtable.table_addr = HADDR_UNDEF; - /* Reset header information back to "empty heap" state */ - if(H5HF_hdr_empty(hdr) < 0) + if(H5HF__hdr_empty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") } /* end if */ else { @@ -279,36 +283,32 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, hdr->man_alloc_size -= dblock->size; /* Check for this direct block being the highest in the heap */ - if((dblock->block_off + dblock->size) == hdr->man_iter_off) { + if((dblock->block_off + dblock->size) == hdr->man_iter_off) /* Move 'next block' iterator backwards (may shrink heap) */ - if(H5HF_hdr_reverse_iter(hdr, dxpl_id, dblock_addr) < 0) + if(H5HF__hdr_reverse_iter(hdr, dblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reverse 'next block' iterator") - } /* end if */ -#if 0 - else { - unsigned par_row, par_col; /* Row & column in parent indirect block */ - - /* Compute row & column in parent indirect block */ - par_row = dblock->par_entry / hdr->man_dtable.cparam.width; - par_col = dblock->par_entry % hdr->man_dtable.cparam.width; - - /* Add a 'range' section for the space in the destroyed block */ - if(H5HF_sect_range_add(hdr, dxpl_id, dblock->block_off, hdr->man_dtable.row_tot_dblock_free[par_row], - dblock->parent, par_row, par_col, 1) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't create range section for direct block being destroyed") - } /* end else */ -#endif /* 0 */ /* Detach from parent indirect block */ if(dblock->parent) { - if(H5HF_man_iblock_detach(dblock->parent, dxpl_id, dblock->par_entry) < 0) + /* Destroy flush dependency between direct block and parent */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; + + /* If this is the last direct block for the indirect block, the + * indirect block will be removed when this direct block is detached + */ + if(parent_removed && 1 == dblock->parent->nchildren) + *parent_removed = TRUE; + + if(H5HF__man_iblock_detach(dblock->parent, dblock->par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block"); dblock->parent = NULL; dblock->par_entry = 0; } /* end if */ } /* end else */ - /* Indicate that the indirect block should be deleted */ + /* Indicate that the direct block should be deleted */ dblock->file_size = dblock_size; cache_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG; @@ -318,15 +318,15 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, done: /* Unprotect the indirect block, with appropriate flags */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_destroy() */ +} /* end H5HF__man_dblock_destroy() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_new + * Function: H5HF__man_dblock_new * * Purpose: Create a direct block large enough to hold an object of * the requested size @@ -340,14 +340,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, +H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_sec_node) { haddr_t dblock_addr; /* Address of new direct block */ size_t min_dblock_size; /* Min. size of direct block to allocate */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -371,7 +371,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, if(!H5F_addr_defined(hdr->man_dtable.table_addr) && min_dblock_size == hdr->man_dtable.cparam.start_block_size) { /* Create new direct block at starting offset */ - if(H5HF_man_dblock_create(dxpl_id, hdr, NULL, 0, &dblock_addr, ret_sec_node) < 0) + if(H5HF__man_dblock_create(hdr, NULL, 0, &dblock_addr, ret_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") /* Point root at new direct block */ @@ -394,7 +394,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, size_t next_size; /* Size of next direct block to create */ /* Update iterator to reflect any previous increments as well as allow for requested direct block size */ - if(H5HF_hdr_update_iter(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__hdr_update_iter(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "unable to update block iterator") /* Retrieve information about current iterator position */ @@ -414,17 +414,17 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not su HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment 'next block' iterator") /* Create new direct block at current location*/ - if(H5HF_man_dblock_create(dxpl_id, hdr, iblock, next_entry, &dblock_addr, ret_sec_node) < 0) + if(H5HF__man_dblock_create(hdr, iblock, next_entry, &dblock_addr, ret_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_new() */ +} /* end H5HF__man_dblock_new() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_protect + * Function: H5HF__man_dblock_protect * * Purpose: Convenience wrapper around H5AC_protect on a direct block * (Use H5AC_unprotect to unprotect it for now) @@ -438,7 +438,7 @@ done: *------------------------------------------------------------------------- */ H5HF_direct_t * -H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, +H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned flags) { @@ -446,7 +446,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, H5HF_dblock_cache_ud_t udata; /* parent and other infor for deserializing direct block */ H5HF_direct_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -496,7 +496,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, udata.dblk = NULL; /* Protect the direct block */ - if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, flags))) + if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap direct block") /* Set the return value */ @@ -504,11 +504,11 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_protect() */ +} /* end H5HF__man_dblock_protect() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_locate + * Function: H5HF__man_dblock_locate * * Purpose: Locate a direct block in a managed heap * @@ -521,7 +521,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, +H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_iblock, unsigned *ret_entry, hbool_t *ret_did_protect, unsigned flags) { @@ -532,7 +532,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, unsigned entry; /* Entry of block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -553,7 +553,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, iblock_addr = hdr->man_dtable.table_addr; /* Lock root indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, flags, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, hdr->man_dtable.curr_root_rows, NULL, 0, FALSE, flags, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check for indirect block row */ @@ -575,7 +575,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, /* Check if we need to (re-)create the child indirect block */ if(!H5F_addr_defined(iblock_addr)) { - if(H5HF_man_iblock_create(hdr, dxpl_id, iblock, entry, nrows, nrows, &iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, iblock, entry, nrows, nrows, &iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Indicate that the parent indirect block was modified */ @@ -583,11 +583,11 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, } /* end if */ /* Lock child indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, iblock, entry, FALSE, flags, &new_did_protect))) + if(NULL == (new_iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, iblock, entry, FALSE, flags, &new_did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Release the current indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, cache_flags, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, cache_flags, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Switch variables to use new indirect block */ @@ -608,17 +608,17 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_locate() */ +} /* end H5HF__man_dblock_locate() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_dblock_delete + * Function: H5HF__man_dblock_delete * * Purpose: Delete a managed direct block * * Note: This routine does _not_ modify any indirect block that points * to this direct block, it is assumed that the whole heap is - * being deleted. (H5HF_man_dblock_destroy modifies the indirect + * being deleted. (H5HF__man_dblock_destroy modifies the indirect * block) * * Return: SUCCEED/FAIL @@ -630,19 +630,19 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, - hsize_t dblock_size) +H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size) { unsigned dblock_status = 0; /* Direct block's status in the metadata cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. */ HDassert(f); HDassert(H5F_addr_defined(dblock_addr)); + HDassert(dblock_size > 0); /* Check the direct block's status in the metadata cache */ if(H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) @@ -655,13 +655,13 @@ H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, HDassert(!(dblock_status & H5AC_ES__IS_PROTECTED)); /* Evict the direct block from the metadata cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_FHEAP_DBLOCK, dblock_addr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove direct block from cache") } /* end if */ /* Check if the direct block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(f, dblock_addr)) { + if(!H5F_IS_TMP_ADDR(f, dblock_addr)) /* Release direct block's disk space */ /* (XXX: Under the best of circumstances, this block's space in the file * would be freed in the H5AC_expunge_entry() call above (and the @@ -671,18 +671,14 @@ H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, * "file_size" field for the direct block structure. In order to * do that, we'd have to protect/unprotect the direct block and * that would add a bunch of unnecessary overhead to the process, - * so we just release the file space here, directly. When the - * revised metadata cache is operating, it will "know" the file - * size of each entry in the cache and we can the the - * H5AC_expunge_entry() method. -QAK) + * so we just release the file space here, directly. -QAK) */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, dblock_addr, dblock_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - } /* end if */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dblock_addr, dblock_size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block file space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_dblock_delete() */ +} /* end H5HF__man_dblock_delete() */ /*------------------------------------------------------------------------- @@ -715,7 +711,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) if(H5HF_hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(dblock->parent) - if(H5HF_iblock_decr(dblock->parent) < 0) + if(H5HF__iblock_decr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Free block's buffer */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 2f01ce6..9394fc0 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -337,7 +337,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) +H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam) { H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ size_t dblock_overhead; /* Direct block's overhead */ @@ -495,11 +495,11 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, HADDR_UNDEF, "max. direct block size not large enough to hold all managed blocks") /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, dxpl_id, (hsize_t)hdr->heap_size))) + if(HADDR_UNDEF == (hdr->heap_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, (hsize_t)hdr->heap_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for fractal heap header") /* Cache the new fractal heap header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, HADDR_UNDEF, "can't add fractal heap header to cache") /* Set address of heap header to return */ @@ -515,7 +515,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_protect + * Function: H5HF__hdr_protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -528,13 +528,13 @@ done: *------------------------------------------------------------------------- */ H5HF_hdr_t * -H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) +H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags) { H5HF_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5HF_hdr_t *hdr; /* Fractal heap header */ H5HF_hdr_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -545,10 +545,9 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) /* 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, addr, &cache_udata, flags))) + if(NULL == (hdr = (H5HF_hdr_t *)H5AC_protect(f, H5AC_FHEAP_HDR, addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") /* Set the header's address */ @@ -562,7 +561,7 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_protect() */ +} /* end H5HF__hdr_protect() */ /*------------------------------------------------------------------------- @@ -921,7 +920,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_skip_blocks + * Function: H5HF__hdr_skip_blocks * * Purpose: Add skipped direct blocks to free space for heap * @@ -934,14 +933,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *iblock, +H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries) { unsigned row, col; /* Row & column of entry */ hsize_t sect_size; /* Size of section in heap space */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -961,16 +960,16 @@ H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *iblock, HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't increase allocated heap size") /* Add 'indirect' section for blocks skipped in this row */ - if(H5HF_sect_indirect_add(hdr, dxpl_id, iblock, start_entry, nentries) < 0) + if(H5HF__sect_indirect_add(hdr, iblock, start_entry, nentries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section for indirect block's free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_skip_blocks() */ +} /* end H5HF__hdr_skip_blocks() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_update_iter + * Function: H5HF__hdr_update_iter * * Purpose: Update state of heap to account for current iterator * position. @@ -986,11 +985,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1000,7 +999,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) /* Check for creating first indirect block */ if(hdr->man_dtable.curr_root_rows == 0) { - if(H5HF_man_iblock_root_create(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__man_iblock_root_create(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "unable to create root indirect block") } /* end if */ else { @@ -1016,7 +1015,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) /* Initialize block iterator, if necessary */ if(!H5HF_man_iter_ready(&hdr->next_block)) { /* Start iterator with previous offset of iterator */ - if(H5HF_man_iter_start_offset(hdr, dxpl_id, &hdr->next_block, hdr->man_iter_off) < 0) + if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") } /* end if */ @@ -1037,7 +1036,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) skip_entries = min_entry - next_entry; /* Add skipped direct blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, skip_entries) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, skip_entries) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") /* Get information about new iterator location */ @@ -1054,7 +1053,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) while(next_row >= iblock->nrows) { /* Check for needing to expand root indirect block */ if(iblock->parent == NULL) { - if(H5HF_man_iblock_root_double(hdr, dxpl_id, min_dblock_size) < 0) + if(H5HF__man_iblock_root_double(hdr, min_dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "unable to double root indirect block") } /* end if */ else { @@ -1099,7 +1098,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) child_entry = iblock->nrows * hdr->man_dtable.cparam.width; /* Add skipped indirect blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, (child_entry - next_entry)) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, (child_entry - next_entry)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") } /* end if */ else { @@ -1108,11 +1107,11 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) haddr_t new_iblock_addr; /* New indirect block's address */ /* Allocate new indirect block */ - if(H5HF_man_iblock_create(hdr, dxpl_id, iblock, next_entry, child_nrows, child_nrows, &new_iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, iblock, next_entry, child_nrows, child_nrows, &new_iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Lock new indirect block */ - if(NULL == (new_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (new_iblock = H5HF__man_iblock_protect(hdr, new_iblock_addr, child_nrows, iblock, next_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Move iterator down one level (pins indirect block) */ @@ -1127,12 +1126,12 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) new_entry = hdr->man_dtable.cparam.width * min_dblock_row; /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, new_iblock, 0, new_entry) < 0) + if(H5HF__hdr_skip_blocks(hdr, new_iblock, 0, new_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") } /* end if */ /* Unprotect child indirect block */ - if(H5HF_man_iblock_unprotect(new_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(new_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") } /* end else */ @@ -1148,7 +1147,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_update_iter() */ +} /* end H5HF__hdr_update_iter() */ /*------------------------------------------------------------------------- @@ -1191,7 +1190,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_reverse_iter + * Function: H5HF__hdr_reverse_iter * * Purpose: Walk "next block" iterator backwards until the correct * location to allocate next block from is found @@ -1205,7 +1204,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) +H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) { H5HF_indirect_t *iblock; /* Indirect block where iterator is located */ unsigned curr_entry; /* Current entry for iterator */ @@ -1213,7 +1212,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) hbool_t walked_up; /* Loop flag */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1223,7 +1222,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) /* Initialize block iterator, if necessary */ if(!H5HF_man_iter_ready(&hdr->next_block)) /* Start iterator with previous offset of iterator */ - if(H5HF_man_iter_start_offset(hdr, dxpl_id, &hdr->next_block, hdr->man_iter_off) < 0) + if(H5HF__man_iter_start_offset(hdr, &hdr->next_block, hdr->man_iter_off) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to set block iterator location") /* Walk backwards through heap, looking for direct block to place iterator after */ @@ -1306,7 +1305,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, hdr->man_dtable.row_block_size[row]); /* Lock child indirect block */ - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, iblock->ents[curr_entry].addr, child_nrows, iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Set the current location of the iterator */ @@ -1322,7 +1321,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) curr_entry = (child_iblock->nrows * hdr->man_dtable.cparam.width) - 1; /* Unprotect child indirect block */ - if(H5HF_man_iblock_unprotect(child_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(child_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Note that we walked down */ @@ -1333,11 +1332,11 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_reverse_iter() */ +} /* end H5HF__hdr_reverse_iter() */ /*------------------------------------------------------------------------- - * Function: H5HF_hdr_empty + * Function: H5HF__hdr_empty * * Purpose: Reset heap header to 'empty heap' state * @@ -1350,11 +1349,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_empty(H5HF_hdr_t *hdr) +H5HF__hdr_empty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(hdr); @@ -1369,6 +1368,10 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr) hdr->man_size = 0; hdr->man_alloc_size = 0; + /* Reset root pointer information */ + hdr->man_dtable.curr_root_rows = 0; + hdr->man_dtable.table_addr = HADDR_UNDEF; + /* Reset the 'next block' iterator location */ hdr->man_iter_off = 0; @@ -1381,7 +1384,7 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_empty() */ +} /* end H5HF__hdr_empty() */ /*------------------------------------------------------------------------- @@ -1427,7 +1430,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_hdr_delete + * Function: H5HF__hdr_delete * * Purpose: Delete a fractal heap, starting with the header * @@ -1440,12 +1443,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__hdr_delete(H5HF_hdr_t *hdr) { unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1471,35 +1474,35 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* (must occur before attempting to delete the heap, so indirect blocks * will get unpinned) */ - if(H5F_addr_defined(hdr->fs_addr)) { + if(H5F_addr_defined(hdr->fs_addr)) /* Delete free space manager for heap */ - if(H5HF_space_delete(hdr, dxpl_id) < 0) + if(H5HF__space_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap free space manager") - } /* end if */ /* Check for root direct/indirect block */ if(H5F_addr_defined(hdr->man_dtable.table_addr)) { if(hdr->man_dtable.curr_root_rows == 0) { - hsize_t dblock_size; /* Size of direct block */ + hsize_t dblock_size; /* Size of direct block on disk */ /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - dblock_size = (hsize_t)hdr->pline_root_direct_size; + /* Set the dblock's size */ + dblock_size = hdr->pline_root_direct_size; /* Reset the header's pipeline information */ hdr->pline_root_direct_size = 0; hdr->pline_root_direct_filter_mask = 0; - } /* end else */ + } /* end if */ else - dblock_size = (hsize_t)hdr->man_dtable.cparam.start_block_size; + dblock_size = hdr->man_dtable.cparam.start_block_size; /* Delete root direct block */ - if(H5HF_man_dblock_delete(hdr->f, dxpl_id, hdr->man_dtable.table_addr, dblock_size) < 0) + if(H5HF__man_dblock_delete(hdr->f, hdr->man_dtable.table_addr, dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap root direct block") } /* end if */ else { /* Delete root indirect block */ - if(H5HF_man_iblock_delete(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0) < 0) + if(H5HF__man_iblock_delete(hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap root indirect block") } /* end else */ } /* end if */ @@ -1507,7 +1510,7 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Check for 'huge' objects in heap */ if(H5F_addr_defined(hdr->huge_bt2_addr)) { /* Delete huge objects in heap and their tracker */ - if(H5HF_huge_delete(hdr, dxpl_id) < 0) + if(H5HF__huge_delete(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap 'huge' objects and tracker") } /* end if */ @@ -1516,9 +1519,9 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) done: /* Unprotect the header with appropriate flags */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, cache_flags) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_HDR, hdr->heap_addr, hdr, cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_hdr_delete() */ +} /* end H5HF__hdr_delete() */ diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 350100e..6e475ad 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -64,12 +64,12 @@ /********************/ /* Local v2 B-tree operations */ -static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id); +static herr_t H5HF__huge_bt2_create(H5HF_hdr_t *hdr); /* Local 'huge' object support routines */ static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); -static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, hbool_t is_read, H5HF_operator_t op, void *op_data); +static herr_t H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, + hbool_t is_read, H5HF_operator_t op, void *op_data); /*********************/ @@ -88,7 +88,7 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, /*------------------------------------------------------------------------- - * Function: H5HF_huge_bt2_create + * Function: H5HF__huge_bt2_create * * Purpose: Create the v2 B-tree for tracking the huge objects in the heap * @@ -101,12 +101,12 @@ static herr_t H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_bt2_create(H5HF_hdr_t *hdr) { H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -155,7 +155,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) bt2_cparam.merge_percent = H5HF_HUGE_BT2_MERGE_PERC; /* Create v2 B-tree for tracking 'huge' objects */ - if(NULL == (hdr->huge_bt2 = H5B2_create(hdr->f, dxpl_id, &bt2_cparam, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_create(hdr->f, &bt2_cparam, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") /* Retrieve the v2 B-tree's address in the file */ @@ -164,7 +164,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_bt2_create() */ +} /* end H5HF__huge_bt2_create() */ /*------------------------------------------------------------------------- @@ -291,7 +291,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_insert + * Function: H5HF__huge_insert * * Purpose: Insert a 'huge' object into the file and track it * @@ -304,8 +304,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, - void *_id) +H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) { uint8_t *id = (uint8_t *)_id; /* Pointer to ID buffer */ haddr_t obj_addr; /* Address of object in the file */ @@ -314,7 +313,7 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef QAK HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); #endif /* QAK */ @@ -330,14 +329,14 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check if the v2 B-tree for tracking 'huge' heap objects has been created yet */ if(!H5F_addr_defined(hdr->huge_bt2_addr)) { /* Go create (& open) v2 B-tree */ - if(H5HF_huge_bt2_create(hdr, dxpl_id) < 0) + if(H5HF__huge_bt2_create(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create v2 B-tree for tracking 'huge' heap objects") } /* end if */ else { /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ } /* end else */ @@ -377,11 +376,11 @@ HDfprintf(stderr, "%s: obj_size = %Zu, obj = %p\n", FUNC, obj_size, obj); } /* end else */ /* Allocate space in the file for storing the 'huge' object */ - if(HADDR_UNDEF == (obj_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (obj_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap huge object") /* Write the object's data to disk */ - if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, write_size, H5AC_rawdata_dxpl_id, write_buf) < 0) + if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, write_size, write_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "writing 'huge' object to file failed") /* Release buffer for writing, if we had one */ @@ -405,7 +404,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu, %x, %Hu}\n", FUNC, obj_rec.addr, obj_ #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -426,7 +425,7 @@ HDfprintf(stderr, "%s: obj_rec = {%a, %Hu}\n", FUNC, obj_rec.addr, obj_rec.len); #endif /* QAK */ /* Insert record for object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, &obj_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, &obj_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -473,7 +472,7 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi } /* end else */ /* Insert record for tracking object in v2 B-tree */ - if(H5B2_insert(hdr->huge_bt2, dxpl_id, ins_rec) < 0) + if(H5B2_insert(hdr->huge_bt2, ins_rec) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "couldn't insert object tracking record in v2 B-tree") /* Encode ID for user */ @@ -491,11 +490,11 @@ HDfprintf(stderr, "%s: indir_rec = {%a, %Hu, %Hu}\n", FUNC, indir_rec.addr, indi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_insert() */ +} /* end H5HF__huge_insert() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_get_obj_len + * Function: H5HF__huge_get_obj_len * * Purpose: Get the size of a 'huge' object in a fractal heap * @@ -508,12 +507,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - size_t *obj_len_p) +H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -547,7 +545,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -559,7 +557,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -573,7 +571,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's length */ @@ -583,7 +581,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_get_obj_len() */ +} /* end H5HF__huge_get_obj_len() */ /*------------------------------------------------------------------------- @@ -600,13 +598,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - hsize_t *obj_off_p) +H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) { haddr_t obj_addr; /* Object's address in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -631,7 +628,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -643,7 +640,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -657,7 +654,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -674,7 +671,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_huge_op_real + * Function: H5HF__huge_op_real * * Purpose: Internal routine to perform an operation on a 'huge' object * @@ -687,8 +684,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - hbool_t is_read, H5HF_operator_t op, void *op_data) +H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, + H5HF_operator_t op, void *op_data) { void *read_buf = NULL; /* Pointer to buffer for reading */ haddr_t obj_addr; /* Object's address in the file */ @@ -696,7 +693,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -725,7 +722,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -737,7 +734,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -753,7 +750,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -772,7 +769,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Read the object's (possibly filtered) data from the file */ /* (reads directly into application's buffer if no filters are present) */ - if(H5F_block_read(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, (size_t)obj_size, H5AC_rawdata_dxpl_id, read_buf) < 0) + if(H5F_block_read(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, (size_t)obj_size, read_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_READERROR, FAIL, "can't read 'huge' object's data from the file") /* Check for I/O pipeline filter on heap */ @@ -816,11 +813,11 @@ done: read_buf = H5MM_xfree(read_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_op_real() */ +} /* end H5HF__huge_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_write + * Function: H5HF__huge_write * * Purpose: Write a 'huge' object to the heap * @@ -838,14 +835,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj) +H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) { haddr_t obj_addr; /* Object's address in the file */ size_t obj_size; /* Object's size in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -877,7 +873,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -885,7 +881,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) /* Look up object in v2 B-tree */ - if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) + if(H5B2_find(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_found, &found_rec) != TRUE) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") /* Retrieve the object's address & length */ @@ -895,16 +891,16 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Write the object's data to the file */ /* (writes directly from application's buffer) */ - if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, obj_size, H5AC_rawdata_dxpl_id, obj) < 0) + if(H5F_block_write(hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, obj_addr, obj_size, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "writing 'huge' object to file failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_write() */ +} /* end H5HF__huge_write() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_read + * Function: H5HF__huge_read * * Purpose: Read a 'huge' object from the heap * @@ -917,11 +913,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) +H5HF__huge_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -931,16 +927,16 @@ H5HF_huge_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine */ - if(H5HF_huge_op_real(hdr, dxpl_id, id, TRUE, NULL, obj) < 0) + if(H5HF__huge_op_real(hdr, id, TRUE, NULL, obj) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_read() */ +} /* end H5HF__huge_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_op + * Function: H5HF__huge_op * * Purpose: Operate directly on a 'huge' object * @@ -953,12 +949,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data) +H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, + void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -968,16 +964,16 @@ H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_huge_op_real(hdr, dxpl_id, id, FALSE, op, op_data) < 0) + if(H5HF__huge_op_real(hdr, id, FALSE, op, op_data) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_op() */ +} /* end H5HF__huge_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_remove + * Function: H5HF__huge_remove * * Purpose: Remove a 'huge' object from the file and the v2 B-tree tracker * @@ -990,12 +986,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) +H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1007,7 +1003,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Check if v2 B-tree is open yet */ if(NULL == hdr->huge_bt2) { /* Open existing v2 B-tree */ - if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ @@ -1016,7 +1012,6 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Set up the common callback info */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Check for 'huge' object ID that encodes address & length directly */ if(hdr->huge_ids_direct) { @@ -1030,7 +1025,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -1043,7 +1038,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_dir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_dir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end if */ @@ -1056,7 +1051,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_filt_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_filt_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end if */ else { @@ -1067,7 +1062,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Remove the record for tracking the 'huge' object from the v2 B-tree */ /* (space in the file for the object is freed in the 'remove' callback) */ - if(H5B2_remove(hdr->huge_bt2, dxpl_id, &search_rec, H5HF__huge_bt2_indir_remove, &udata) < 0) + if(H5B2_remove(hdr->huge_bt2, &search_rec, H5HF__huge_bt2_indir_remove, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove object from B-tree") } /* end else */ } /* end else */ @@ -1082,11 +1077,11 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_remove() */ +} /* end H5HF__huge_remove() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_term + * Function: H5HF__huge_term * * Purpose: Shut down the information for tracking 'huge' objects * @@ -1099,11 +1094,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_term(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1116,7 +1111,7 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); /* Close v2 B-tree index */ - if(H5B2_close(hdr->huge_bt2, dxpl_id) < 0) + if(H5B2_close(hdr->huge_bt2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree") hdr->huge_bt2 = NULL; } /* end if */ @@ -1130,7 +1125,7 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Delete the v2 B-tree */ /* (any v2 B-tree class will work here) */ - if(H5B2_delete(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f, NULL, NULL) < 0) + if(H5B2_delete(hdr->f, hdr->huge_bt2_addr, hdr->f, NULL, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") /* Reset the information about 'huge' objects in the file */ @@ -1145,11 +1140,11 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_term() */ +} /* end H5HF__huge_term() */ /*------------------------------------------------------------------------- - * Function: H5HF_huge_delete + * Function: H5HF__huge_delete * * Purpose: Delete all the 'huge' objects in the heap, and the v2 B-tree * tracker for them @@ -1163,13 +1158,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__huge_delete(H5HF_hdr_t *hdr) { H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ H5B2_remove_t op; /* Callback for v2 B-tree removal */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1181,7 +1176,6 @@ H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) /* Set up the callback info */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Set the v2 B-tree callback operator */ if(hdr->huge_ids_direct) { @@ -1198,10 +1192,10 @@ H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) } /* end else */ /* Delete the v2 B-tree */ - if(H5B2_delete(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f, op, &udata) < 0) + if(H5B2_delete(hdr->f, hdr->huge_bt2_addr, hdr->f, op, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete v2 B-tree") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_huge_delete() */ +} /* end H5HF__huge_delete() */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 11abce0..e5c2559 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -57,10 +57,10 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_iblock_pin(H5HF_indirect_t *iblock); -static herr_t H5HF_iblock_unpin(H5HF_indirect_t *iblock); -static herr_t H5HF_man_iblock_root_halve(H5HF_indirect_t *root_iblock, hid_t dxpl_id); -static herr_t H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id); +static herr_t H5HF__iblock_pin(H5HF_indirect_t *iblock); +static herr_t H5HF__iblock_unpin(H5HF_indirect_t *iblock); +static herr_t H5HF__man_iblock_root_halve(H5HF_indirect_t *root_iblock); +static herr_t H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock); /*********************/ @@ -92,7 +92,7 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); /*------------------------------------------------------------------------- - * Function: H5HF_iblock_pin + * Function: H5HF__iblock_pin * * Purpose: Pin an indirect block in memory * @@ -105,11 +105,11 @@ H5FL_SEQ_DEFINE(H5HF_indirect_ptr_t); *------------------------------------------------------------------------- */ static herr_t -H5HF_iblock_pin(H5HF_indirect_t *iblock) +H5HF__iblock_pin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(iblock); @@ -155,11 +155,11 @@ H5HF_iblock_pin(H5HF_indirect_t *iblock) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_pin() */ +} /* end H5HF__iblock_pin() */ /*------------------------------------------------------------------------- - * Function: H5HF_iblock_unpin + * Function: H5HF__iblock_unpin * * Purpose: Unpin an indirect block in the metadata cache * @@ -172,57 +172,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_iblock_unpin(H5HF_indirect_t *iblock) +H5HF__iblock_unpin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(iblock); - /* If this indirect block has a parent, reset it's child iblock pointer */ - if(iblock->parent) { - H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */ - unsigned indir_idx; /* Index in parent's child iblock pointer array */ - - /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width)); - - /* Compute index in parent's child iblock pointer array */ - indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width); - - /* Reset pointer to pinned child indirect block in parent */ - HDassert(par_iblock->child_iblocks[indir_idx]); - par_iblock->child_iblocks[indir_idx] = NULL; - } /* end if */ - else { - /* Check for root indirect block */ - if(iblock->block_off == 0) { - /* Sanity check - shouldn't be recursively unpinning root indirect block */ - HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); - - /* Check if we should reset the root iblock pointer */ - if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { - HDassert(NULL != iblock->hdr->root_iblock); - iblock->hdr->root_iblock = NULL; - } /* end if */ - - /* Indicate that the root indirect block is unpinned */ - iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED)); - } /* end if */ - } /* end else */ - /* Mark block as evictable again */ if(H5AC_unpin_entry(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_unpin() */ +} /* end H5HF__iblock_unpin() */ /*------------------------------------------------------------------------- @@ -251,7 +216,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) /* Mark block as un-evictable when a child block is depending on it */ if(iblock->rc == 0) - if(H5HF_iblock_pin(iblock) < 0) + if(H5HF__iblock_pin(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTPIN, FAIL, "unable to pin fractal heap indirect block") /* Increment reference count on shared indirect block */ @@ -263,7 +228,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_decr + * Function: H5HF__iblock_decr * * Purpose: Decrement reference count on shared indirect block * @@ -276,11 +241,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_iblock_decr(H5HF_indirect_t *iblock) +H5HF__iblock_decr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(iblock); @@ -288,63 +253,60 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) /* Decrement reference count on shared indirect block */ iblock->rc--; - /* Mark block as evictable again when no child blocks depend on it */ + /* Check for last reference to block */ if(iblock->rc == 0) { - H5HF_hdr_t *hdr; /* Fractal heap header */ - haddr_t iblock_addr; /* Address of fractal heap */ - hbool_t expunge_iblock = FALSE; /* Whether to expunge indirect block from heap */ - - /* Set up convenience variables */ - hdr = iblock->hdr; - iblock_addr = iblock->addr; - - if(iblock->nchildren == 0) { - /* Check for deleting root indirect block (and no root direct block) */ - if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) { - /* Reset root pointer information */ - hdr->man_dtable.curr_root_rows = 0; - hdr->man_dtable.table_addr = HADDR_UNDEF; - - /* Reset header information back to "empty heap" state */ - if(H5HF_hdr_empty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") - } /* end if */ - /* Detach from parent indirect block */ - if(iblock->parent) { - /* Detach from parent indirect block */ - if(H5HF_man_iblock_detach(iblock->parent, H5AC_ind_read_dxpl_id, iblock->par_entry) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block") - iblock->parent = NULL; - iblock->par_entry = 0; - } /* end if */ - - /* Mark indirect block for removal from the metadata cache */ - expunge_iblock = TRUE; - } /* end if */ - - /* Unpin the indirect block */ - if(H5HF_iblock_unpin(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") - - /* Check for expunging the indirect block from the metadata cache */ - if(expunge_iblock) { - unsigned cache_flags = H5AC__NO_FLAGS_SET; - - /* if the indirect block is in real file space, tell - * the cache to free its file space. - */ - if (!H5F_IS_TMP_ADDR(hdr->f, iblock_addr)) - cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; - - if(H5AC_expunge_entry(hdr->f, H5AC_ind_read_dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, cache_flags) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove indirect block from cache") - } /* end if */ + /* If this indirect block has a parent, reset it's child iblock pointer */ + if(iblock->parent) { + H5HF_indirect_t *par_iblock = iblock->parent; /* Parent indirect block */ + unsigned indir_idx; /* Index in parent's child iblock pointer array */ + + /* Sanity check */ + HDassert(par_iblock->child_iblocks); + HDassert(iblock->par_entry >= (iblock->hdr->man_dtable.max_direct_rows + * iblock->hdr->man_dtable.cparam.width)); + + /* Compute index in parent's child iblock pointer array */ + indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows + * iblock->hdr->man_dtable.cparam.width); + + /* Reset pointer to pinned child indirect block in parent */ + HDassert(par_iblock->child_iblocks[indir_idx]); + par_iblock->child_iblocks[indir_idx] = NULL; + } /* end if */ + else { + /* Check for root indirect block */ + if(iblock->block_off == 0) { + /* Sanity check - shouldn't be recursively unpinning root indirect block */ + HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); + + /* Check if we should reset the root iblock pointer */ + if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { + HDassert(NULL != iblock->hdr->root_iblock); + iblock->hdr->root_iblock = NULL; + } /* end if */ + + /* Indicate that the root indirect block is unpinned */ + iblock->hdr->root_iblock_flags &= (unsigned)(~(H5HF_ROOT_IBLOCK_PINNED)); + } /* end if */ + } /* end else */ + + /* Check if the block is still in the cache */ + if(!iblock->removed_from_cache) { + /* Unpin the indirect block, making it evictable again */ + if(H5HF__iblock_unpin(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") + } /* end if */ + else { + /* Destroy the indirect block */ + if(H5HF_man_iblock_dest(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + } /* end else */ } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_iblock_decr() */ +} /* end H5HF__iblock_decr() */ /*------------------------------------------------------------------------- @@ -380,7 +342,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_create + * Function: H5HF__man_iblock_root_create * * Purpose: Create root indirect block * @@ -393,7 +355,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size) { H5HF_indirect_t *iblock; /* Pointer to indirect block */ haddr_t iblock_addr; /* Indirect block's address */ @@ -404,7 +366,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check for allocating entire root indirect block initially */ if(hdr->man_dtable.cparam.start_root_rows == 0) @@ -424,13 +386,13 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si } /* end else */ /* Allocate root indirect block */ - if(H5HF_man_iblock_create(hdr, dxpl_id, NULL, 0, nrows, hdr->man_dtable.max_root_rows, &iblock_addr) < 0) + if(H5HF__man_iblock_create(hdr, NULL, 0, nrows, hdr->man_dtable.max_root_rows, &iblock_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap indirect block") /* Move current direct block (used as root) into new indirect block */ /* Lock new indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, NULL, 0, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, NULL, 0, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Check if there's already a direct block as root) */ @@ -439,21 +401,22 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si H5HF_direct_t *dblock; /* Pointer to direct block to query */ /* Lock first (root) direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, hdr->man_dtable.table_addr, hdr->man_dtable.cparam.start_block_size, NULL, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") /* Attach direct block to new root indirect block */ dblock->parent = iblock; - dblock->fd_parent = iblock; dblock->par_entry = 0; - /* destroy flush dependency between direct block and header */ - if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0) + /* Destroy flush dependency between direct block and header */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; - /* create flush dependency between direct block and new root indirect block */ - if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0) + /* Create flush dependency between direct block and new root indirect block */ + if(H5AC_create_flush_dependency(iblock, dblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + dblock->fd_parent = iblock; if(H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block") @@ -470,11 +433,11 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si } /* end if */ /* Scan free space sections to set any 'parent' pointers to new indirect block */ - if(H5HF_space_create_root(hdr, dxpl_id, iblock) < 0) + if(H5HF__space_create_root(hdr, iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set free space section info to new root indirect block") /* Unlock first (previously the root) direct block */ - if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") dblock = NULL; } /* end if */ @@ -484,19 +447,18 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize block iterator") /* Check for skipping over direct blocks, in order to get to large enough block */ - if(min_dblock_size > hdr->man_dtable.cparam.start_block_size) { + if(min_dblock_size > hdr->man_dtable.cparam.start_block_size) /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, have_direct_block, + if(H5HF__hdr_skip_blocks(hdr, iblock, have_direct_block, ((nrows - 1) * hdr->man_dtable.cparam.width) - have_direct_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") - } /* end if */ /* Mark indirect block as modified */ if(H5HF_iblock_dirty(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") /* Unprotect root indirect block (it's pinned by the iterator though) */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__DIRTIED_FLAG, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__DIRTIED_FLAG, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; @@ -519,11 +481,11 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_create() */ +} /* end H5HF__man_iblock_root_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_double + * Function: H5HF__man_iblock_root_double * * Purpose: Double size of root indirect block * @@ -536,7 +498,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) +H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) { H5HF_indirect_t *iblock; /* Pointer to root indirect block */ haddr_t new_addr; /* New address of indirect block */ @@ -553,7 +515,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Get "new block" iterator information */ if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) @@ -587,20 +549,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { -/* Currently, the old block data is "thrown away" after the space is reallocated, -* to avoid data copy in H5MF_realloc() call by just free'ing the space and -* allocating new space. -* -* This also keeps the file smaller, by freeing the space and then -* allocating new space, instead of vice versa (in H5MF_realloc). -* -* QAK - 3/14/2006 -*/ + if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ - if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute size of buffer needed for new indirect block */ iblock->nrows = new_nrows; @@ -613,7 +565,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ @@ -625,7 +577,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -635,11 +587,10 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for direct entries") /* Check for skipping over rows and add free section for skipped rows */ - if(skip_direct_rows) { + if(skip_direct_rows) /* Add skipped blocks to heap's free space */ - if(H5HF_hdr_skip_blocks(hdr, dxpl_id, iblock, next_entry, (new_next_entry - next_entry)) < 0) + if(H5HF__hdr_skip_blocks(hdr, iblock, next_entry, (new_next_entry - next_entry)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't add skipped blocks to heap's free space") - } /* end if */ /* Initialize new direct block entries in rows added */ acc_dblock_free = 0; @@ -706,11 +657,11 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_double() */ +} /* end H5HF__man_iblock_root_double() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_halve + * Function: H5HF__man_iblock_root_halve * * Purpose: Halve size of root indirect block * @@ -723,7 +674,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) +H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) { H5HF_hdr_t *hdr = iblock->hdr; /* Pointer to heap header */ haddr_t new_addr; /* New address of indirect block */ @@ -735,7 +686,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(iblock); @@ -750,20 +701,10 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Check if the indirect block is NOT currently allocated in temp. file space */ /* (temp. file space does not need to be freed) */ - if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) { -/* Currently, the old block data is "thrown away" after the space is reallocated, -* to avoid data copy in H5MF_realloc() call by just free'ing the space and -* allocating new space. -* -* This also keeps the file smaller, by freeing the space and then -* allocating new space, instead of vice versa (in H5MF_realloc). -* -* QAK - 6/12/2006 -*/ + if(!H5F_IS_TMP_ADDR(hdr->f, iblock->addr)) /* Free previous indirect block disk space */ - if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, iblock->addr, (hsize_t)iblock->size) < 0) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, iblock->addr, (hsize_t)iblock->size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") - } /* end if */ /* Compute free space in rows to delete */ acc_dblock_free = 0; @@ -782,7 +723,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ @@ -794,7 +735,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) /* Move object in cache, if it actually was relocated */ if(H5F_addr_ne(iblock->addr, new_addr)) { - if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr, dxpl_id) < 0) + if(H5AC_move_entry(hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, new_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSPLIT, FAIL, "unable to move fractal heap root indirect block") iblock->addr = new_addr; } /* end if */ @@ -841,11 +782,11 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_halve() */ +} /* end H5HF__man_iblock_root_halve() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_root_revert + * Function: H5HF__man_iblock_root_revert * * Purpose: Revert root indirect block back to root direct block * @@ -861,7 +802,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) +H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) { H5HF_hdr_t *hdr; /* Pointer to heap's header */ H5HF_direct_t *dblock = NULL; /* Pointer to new root indirect block */ @@ -869,7 +810,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) size_t dblock_size; /* Direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -882,7 +823,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) dblock_size = hdr->man_dtable.cparam.start_block_size; /* Get pointer to last direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") HDassert(dblock->parent == root_iblock); HDassert(dblock->par_entry == 0); @@ -894,24 +835,21 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) hdr->pline_root_direct_filter_mask = root_iblock->filt_ents[0].filter_mask; } /* end if */ + /* Destroy flush dependency between old root iblock and new root direct block */ + if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + dblock->fd_parent = NULL; + /* Detach direct block from parent */ - if(H5HF_man_iblock_detach(dblock->parent, dxpl_id, 0) < 0) + if(H5HF__man_iblock_detach(dblock->parent, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach direct block from parent indirect block") dblock->parent = NULL; dblock->par_entry = 0; - /* destroy flush dependency between old root iblock and new root direct block*/ - if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \ - "unable to destroy flush dependency") - - - /* create flush dependency between header and new root direct block */ - if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \ - "unable to create flush dependency") - - dblock->fd_parent = NULL; + /* Create flush dependency between header and new root direct block */ + if(H5AC_create_flush_dependency(hdr, dblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + dblock->fd_parent = hdr; /* Point root at direct block */ hdr->man_dtable.curr_root_rows = 0; @@ -926,20 +864,19 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") /* Scan free space sections to reset any 'parent' pointers */ - if(H5HF_space_revert_root(hdr, dxpl_id) < 0) + if(H5HF__space_revert_root(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRESET, FAIL, "can't reset free space section info") - done: - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_root_revert() */ +} /* end H5HF__man_iblock_root_revert() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_alloc_row + * Function: H5HF__man_iblock_alloc_row * * Purpose: Allocate a "single" section for an object, out of a * "row" section. @@ -955,7 +892,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t **sec_node) +H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ H5HF_free_section_t *old_sec_node = *sec_node; /* Pointer to old indirect section node */ @@ -963,7 +900,7 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** hbool_t iblock_held = FALSE; /* Flag to indicate that indirect block is held */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -972,12 +909,14 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** HDassert(sec_node && old_sec_node); HDassert(old_sec_node->u.row.row < hdr->man_dtable.max_direct_rows); - /* Check for serialized section */ - if(old_sec_node->sect_info.state == H5FS_SECT_SERIALIZED) { - /* Revive indirect section */ - if(H5HF_sect_row_revive(hdr, dxpl_id, old_sec_node) < 0) + /* Check for serialized row section, or serialized / deleted indirect + * section under it. */ + if(old_sec_node->sect_info.state == H5FS_SECT_SERIALIZED + || (H5FS_SECT_SERIALIZED == old_sec_node->u.row.under->sect_info.state) + || (TRUE == old_sec_node->u.row.under->u.indirect.u.iblock->removed_from_cache)) + /* Revive row and / or indirect section */ + if(H5HF__sect_row_revive(hdr, old_sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") - } /* end if */ /* Get a pointer to the indirect block covering the section */ if(NULL == (iblock = H5HF_sect_row_get_iblock(old_sec_node))) @@ -989,25 +928,25 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** iblock_held = TRUE; /* Reduce (& possibly re-add) 'row' section */ - if(H5HF_sect_row_reduce(hdr, dxpl_id, old_sec_node, &dblock_entry) < 0) + if(H5HF__sect_row_reduce(hdr, old_sec_node, &dblock_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce row section node") /* Create direct block & single section */ - if(H5HF_man_dblock_create(dxpl_id, hdr, iblock, dblock_entry, NULL, sec_node) < 0) + if(H5HF__man_dblock_create(hdr, iblock, dblock_entry, NULL, sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't allocate fractal heap direct block") done: /* Release hold on indirect block */ if(iblock_held) - if(H5HF_iblock_decr(iblock) < 0) + if(H5HF__iblock_decr(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_alloc_row() */ +} /* end H5HF__man_iblock_alloc_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_create + * Function: H5HF__man_iblock_create * * Purpose: Allocate & initialize a managed indirect block * @@ -1020,14 +959,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblock, +H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned nrows, unsigned max_rows, haddr_t *addr_p) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1050,10 +989,11 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo if(H5HF_hdr_incr(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared heap header") - /* Set info for direct block */ + /* Set info for indirect block */ iblock->rc = 0; iblock->nrows = nrows; iblock->max_rows = max_rows; + iblock->removed_from_cache = FALSE; /* Compute size of buffer needed for indirect block */ iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); @@ -1100,19 +1040,13 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end if */ else { - if(HADDR_UNDEF == (*addr_p = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, dxpl_id, (hsize_t)iblock->size))) + if(HADDR_UNDEF == (*addr_p = H5MF_alloc(hdr->f, H5FD_MEM_FHEAP_IBLOCK, (hsize_t)iblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") } /* end else */ iblock->addr = *addr_p; /* Attach to parent indirect block, if there is one */ iblock->parent = par_iblock; - iblock->fd_parent = par_iblock; /* this copy of the parent pointer is */ - /* needed by the notify callback so */ - /* that it can take down flush */ - /* dependencies on eviction even if */ - /* the parent pointer has been nulled */ - /* out. JRM -- 5/18/14 */ iblock->par_entry = par_entry; if(iblock->parent) { /* Attach new block to parent */ @@ -1124,16 +1058,23 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo iblock->block_off = par_iblock->block_off; iblock->block_off += hdr->man_dtable.row_block_off[par_entry / hdr->man_dtable.cparam.width]; iblock->block_off += hdr->man_dtable.row_block_size[par_entry / hdr->man_dtable.cparam.width] * (par_entry % hdr->man_dtable.cparam.width); + + /* Set indirect block parent as flush dependency parent */ + iblock->fd_parent = par_iblock; } /* end if */ - else + else { iblock->block_off = 0; /* Must be the root indirect block... */ + /* Set heap header as flush dependency parent */ + iblock->fd_parent = hdr; + } /* end else */ + /* Update indirect block's statistics */ iblock->nchildren = 0; iblock->max_child = 0; /* Cache the new indirect block */ - if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, *addr_p, iblock, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(hdr->f, H5AC_FHEAP_IBLOCK, *addr_p, iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add fractal heap indirect block to cache") done: @@ -1143,11 +1084,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_create() */ +} /* end H5HF__man_iblock_create() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_protect + * Function: H5HF__man_iblock_protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -1160,7 +1101,7 @@ done: *------------------------------------------------------------------------- */ H5HF_indirect_t * -H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, +H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, unsigned flags, hbool_t *did_protect) { @@ -1169,7 +1110,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ H5HF_indirect_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1241,7 +1182,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, cache_udata.nrows = &iblock_nrows; /* Protect the indirect block */ - if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, flags))) + if(NULL == (iblock = (H5HF_indirect_t *)H5AC_protect(hdr->f, H5AC_FHEAP_IBLOCK, iblock_addr, &cache_udata, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap indirect block") /* Set the indirect block's address */ @@ -1274,11 +1215,11 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_protect() */ +} /* end H5HF__man_iblock_protect() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_unprotect + * Function: H5HF__man_iblock_unprotect * * Purpose: Convenience wrapper around H5AC_unprotect on an indirect block * @@ -1291,12 +1232,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, - unsigned cache_flags, hbool_t did_protect) +H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, + hbool_t did_protect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1322,13 +1263,13 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, } /* end if */ /* Unprotect the indirect block */ - if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) + if(H5AC_unprotect(iblock->hdr->f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_unprotect() */ +} /* end H5HF__man_iblock_unprotect() */ /*------------------------------------------------------------------------- @@ -1397,7 +1338,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_detach + * Function: H5HF__man_iblock_detach * * Purpose: Detach a child block (direct or indirect) from an indirect block * @@ -1410,12 +1351,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) +H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) { + H5HF_hdr_t *hdr; /* Fractal heap header */ + H5HF_indirect_t *del_iblock = NULL; /* Pointer to protected indirect block, when deleting */ unsigned row; /* Row for entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1423,34 +1366,36 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) HDassert(iblock); HDassert(iblock->nchildren); + /* Set up convenience variables */ + hdr = iblock->hdr; + /* Reset address of entry */ iblock->ents[entry].addr = HADDR_UNDEF; /* Compute row for entry */ - row = entry / iblock->hdr->man_dtable.cparam.width; + row = entry / hdr->man_dtable.cparam.width; /* Check for I/O filters on this heap */ - if(iblock->hdr->filter_len > 0) { + if(hdr->filter_len > 0) { /* Sanity check */ HDassert(iblock->filt_ents); /* If this is a direct block, reset its initial size */ - if(row < iblock->hdr->man_dtable.max_direct_rows) { + if(row < hdr->man_dtable.max_direct_rows) { iblock->filt_ents[entry].size = 0; iblock->filt_ents[entry].filter_mask = 0; } /* end if */ } /* end if */ /* Check for indirect block being detached */ - if(row >= iblock->hdr->man_dtable.max_direct_rows) { + if(row >= hdr->man_dtable.max_direct_rows) { unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ HDassert(iblock->child_iblocks); /* Compute index in child iblock pointer array */ - indir_idx = entry - (iblock->hdr->man_dtable.max_direct_rows - * iblock->hdr->man_dtable.cparam.width); + indir_idx = entry - (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width); /* Sanity check */ HDassert(iblock->child_iblocks[indir_idx]); @@ -1482,38 +1427,127 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) * direct block */ if(iblock->nchildren == 1 && H5F_addr_defined(iblock->ents[0].addr)) - if(H5HF_man_iblock_root_revert(iblock, dxpl_id) < 0) + if(H5HF__man_iblock_root_revert(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't convert root indirect block back to root direct block") - /* Check for reducing size of root indirect block */ - if(iblock->nchildren > 0 && iblock->hdr->man_dtable.cparam.start_root_rows != 0 - && entry > iblock->max_child) { - unsigned max_child_row; /* Row for max. child entry */ - - /* Compute information needed for determining whether to reduce size of root indirect block */ - max_child_row = iblock->max_child / iblock->hdr->man_dtable.cparam.width; - - /* Check if the root indirect block should be reduced */ - if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2)) - if(H5HF_man_iblock_root_halve(iblock, dxpl_id) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block") - } /* end if */ + /* If the indirect block wasn't removed already (by reverting it) */ + if(!iblock->removed_from_cache) { + /* Check for reducing size of root indirect block */ + if(iblock->nchildren > 0 && hdr->man_dtable.cparam.start_root_rows != 0 + && entry > iblock->max_child) { + unsigned max_child_row; /* Row for max. child entry */ + + /* Compute information needed for determining whether to reduce size of root indirect block */ + max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; + + /* Check if the root indirect block should be reduced */ + if(iblock->nrows > 1 && max_child_row <= (iblock->nrows / 2)) + if(H5HF__man_iblock_root_halve(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce size of root indirect block") + } /* end if */ + } /* end if */ } /* end if */ - /* Mark indirect block as modified */ - if(H5HF_iblock_dirty(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") + /* If the indirect block wasn't removed already (by reverting it) */ + if(!iblock->removed_from_cache) { + /* Mark indirect block as modified */ + if(H5HF_iblock_dirty(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark indirect block as dirty") + + /* Check for last child being removed from indirect block */ + if(iblock->nchildren == 0) { + hbool_t did_protect = FALSE; /* Whether the indirect block was protected */ + + /* If this indirect block's refcount is >1, then it's being deleted + * from the fractal heap (since its nchildren == 0), but is still + * referred to from free space sections in the heap (refcount >1). + * Its space in the file needs to be freed now, and it also needs + * to be removed from the metadata cache now, in case the space in + * the file is reused by another piece of metadata that is inserted + * into the cache before the indirect block's entry is evicted + * (having two entries at the same address would be an error, from + * the cache's perspective). + */ + /* Lock indirect block for deletion */ + if(NULL == (del_iblock = H5HF__man_iblock_protect(hdr, iblock->addr, iblock->nrows, iblock->parent, iblock->par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") + HDassert(did_protect == TRUE); + + /* Check for deleting root indirect block (and no root direct block) */ + if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) + /* Reset header information back to "empty heap" state */ + if(H5HF__hdr_empty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") + + /* Detach from parent indirect block */ + if(iblock->parent) { + /* Destroy flush dependency between indirect block and parent */ + if(H5AC_destroy_flush_dependency(iblock->fd_parent, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") + iblock->fd_parent = NULL; + + /* Detach from parent indirect block */ + if(H5HF__man_iblock_detach(iblock->parent, iblock->par_entry) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't detach from parent indirect block") + iblock->parent = NULL; + iblock->par_entry = 0; + } /* end if */ + } /* end if */ + } /* end if */ - /* Decrement the reference count on this indirect block */ - /* (should be last, so that potential 'unpin' on this indirect block - * doesn't invalidate the 'iblock' variable) + /* Decrement the reference count on this indirect block if we're not deleting it */ + /* (should be after iblock needs to be modified, so that potential 'unpin' + * on this indirect block doesn't invalidate the 'iblock' variable, if it's + * not being deleted) */ - if(H5HF_iblock_decr(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + if(H5HF__iblock_decr(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + iblock = NULL; + + /* Delete indirect block from cache, if appropriate */ + if(del_iblock) { + unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotect */ + hbool_t took_ownership = FALSE; /* Flag to indicate that block ownership has transitioned */ + + /* If the refcount is still >0, unpin the block and take ownership + * from the cache, otherwise let the cache destroy it. + */ + if(del_iblock->rc > 0) { + cache_flags |= (H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG); + cache_flags |= H5AC__UNPIN_ENTRY_FLAG; + took_ownership = TRUE; + } /* end if */ + else { + /* Entry should be removed from the cache */ + cache_flags |= H5AC__DELETED_FLAG; + + /* If the indirect block is in real file space, tell + * the cache to free its file space as well. + */ + if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr)) + cache_flags |= H5AC__FREE_FILE_SPACE_FLAG; + } /* end else */ + + /* Unprotect the indirect block, with appropriate flags */ + if(H5HF__man_iblock_unprotect(del_iblock, cache_flags, TRUE) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") + + /* if took ownership, free file space & mark block as removed from cache */ + if(took_ownership) { + /* Free indirect block disk space, if it's in real space */ + if(!H5F_IS_TMP_ADDR(hdr->f, del_iblock->addr)) + if(H5MF_xfree(hdr->f, H5FD_MEM_FHEAP_IBLOCK, del_iblock->addr, (hsize_t)del_iblock->size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap indirect block file space") + del_iblock->addr = HADDR_UNDEF; + + /* Mark block as removed from the cache */ + del_iblock->removed_from_cache = TRUE; + } /* end if */ + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_detach() */ +} /* end H5HF__man_iblock_detach() */ /*------------------------------------------------------------------------- @@ -1548,7 +1582,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi /*------------------------------------------------------------------------- - * Function: H5HF_man_iblock_delete + * Function: H5HF__man_iblock_delete * * Purpose: Delete a managed indirect block * @@ -1565,7 +1599,7 @@ H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *chi *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, +H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry) { H5HF_indirect_t *iblock; /* Pointer to indirect block */ @@ -1575,7 +1609,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1585,7 +1619,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, HDassert(iblock_nrows > 0); /* Lock indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") HDassert(iblock->nchildren > 0); HDassert(did_protect == TRUE); @@ -1597,33 +1631,32 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, for(col = 0; col < hdr->man_dtable.cparam.width; col++, entry++) { /* Check for child entry at this position */ if(H5F_addr_defined(iblock->ents[entry].addr)) { - hsize_t row_block_size; /* The size of blocks in this row */ - - /* Get the row's block size */ - row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; - /* Are we in a direct or indirect block row */ if(row < hdr->man_dtable.max_direct_rows) { - hsize_t dblock_size; /* Size of direct block on disk */ + hsize_t dblock_size; /* Size of direct block on disk */ - /* Check for I/O filters on this heap */ - if(hdr->filter_len > 0) - dblock_size = iblock->filt_ents[entry].size; - else - dblock_size = row_block_size; + /* Check for I/O filters on this heap */ + if(hdr->filter_len > 0) + dblock_size = iblock->filt_ents[entry].size; + else + dblock_size = hdr->man_dtable.row_block_size[row]; /* Delete child direct block */ - if(H5HF_man_dblock_delete(hdr->f, dxpl_id, iblock->ents[entry].addr, dblock_size) < 0) + if(H5HF__man_dblock_delete(hdr->f, iblock->ents[entry].addr, dblock_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap child direct block") } /* end if */ else { + hsize_t row_block_size; /* The size of blocks in this row */ unsigned child_nrows; /* Number of rows in new indirect block */ + /* Get the row's block size */ + row_block_size = (hsize_t)hdr->man_dtable.row_block_size[row]; + /* Compute # of rows in next child indirect block to use */ child_nrows = H5HF_dtable_size_to_rows(&hdr->man_dtable, row_block_size); /* Delete child indirect block */ - if(H5HF_man_iblock_delete(hdr, dxpl_id, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) + if(H5HF__man_iblock_delete(hdr, iblock->ents[entry].addr, child_nrows, iblock, entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release fractal heap child indirect block") } /* end else */ } /* end if */ @@ -1654,16 +1687,16 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, done: /* Unprotect the indirect block, with appropriate flags */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, cache_flags, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, cache_flags, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_delete() */ +} /* end H5HF__man_iblock_delete() */ /*------------------------------------------------------------------------- * - * Function: H5HF_man_iblock_size + * Function: H5HF__man_iblock_size * * Purpose: Gather storage used for the indirect block in fractal heap * @@ -1674,14 +1707,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_addr, +H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size) { H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1692,7 +1725,7 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad HDassert(heap_size); /* Protect the indirect block */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, par_iblock, par_entry, FALSE, H5AC__READ_ONLY_FLAG, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") /* Accumulate size of this indirect block */ @@ -1715,19 +1748,96 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad for(v = 0; v < hdr->man_dtable.cparam.width; v++, entry++) if(H5F_addr_defined(iblock->ents[entry].addr)) - if(H5HF_man_iblock_size(f, dxpl_id, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0) + if(H5HF__man_iblock_size(f, hdr, iblock->ents[entry].addr, num_indirect_rows, iblock, entry, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to get fractal heap storage info for indirect block") } /* end for */ } /* end if */ done: /* Release the indirect block */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iblock_size() */ +} /* end H5HF__man_iblock_size() */ + + +/*------------------------------------------------------------------------- + * + * Function: H5HF_man_iblock_parent_info + * + * Purpose: Determine the parent block's offset and entry location + * (within it's parent) of an indirect block, given its offset + * within the heap. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * koziol@lbl.gov + * Jan 14 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, + hsize_t *ret_par_block_off, unsigned *ret_entry) +{ + hsize_t par_block_off; /* Offset of parent within heap */ + hsize_t prev_par_block_off; /* Offset of previous parent block within heap */ + unsigned row, col; /* Row & column for block */ + unsigned prev_row = 0, prev_col = 0;/* Previous row & column for block */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(block_off > 0); + HDassert(ret_entry); + + /* Look up row & column for object */ + if(H5HF_dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") + + /* Sanity check - first lookup must be an indirect block */ + HDassert(row >= hdr->man_dtable.max_direct_rows); + + /* Traverse down, until a direct block at the offset is found, then + * use previous (i.e. parent's) offset, row, and column. + */ + prev_par_block_off = par_block_off = 0; + while(row >= hdr->man_dtable.max_direct_rows) { + /* Retain previous parent block offset */ + prev_par_block_off = par_block_off; + + /* Compute the new parent indirect block's offset in the heap's address space */ + /* (based on previous block offset) */ + par_block_off += hdr->man_dtable.row_block_off[row]; + par_block_off += hdr->man_dtable.row_block_size[row] * col; + + /* Preserve current row & column */ + prev_row = row; + prev_col = col; + + /* Look up row & column in new indirect block for object */ + if(H5HF_dtable_lookup(&hdr->man_dtable, (block_off - par_block_off), &row, &col) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") + } /* end while */ + + /* Sanity check */ + HDassert(row == 0); + HDassert(col == 0); + + /* Set return parameters */ + *ret_par_block_off = prev_par_block_off; + *ret_entry = (prev_row * hdr->man_dtable.cparam.width) + prev_col; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__man_iblock_par_info() */ /*------------------------------------------------------------------------- @@ -1761,7 +1871,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) if(H5HF_hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if(iblock->parent) - if(H5HF_iblock_decr(iblock->parent) < 0) + if(H5HF__iblock_decr(iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Release entry tables */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 54246d2..ceebc3b 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -109,7 +109,7 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) /*------------------------------------------------------------------------- - * Function: H5HF_man_iter_start_offset + * Function: H5HF__man_iter_start_offset * * Purpose: Initialize a block iterator to a particular location, given * an offset in the heap @@ -123,8 +123,8 @@ H5HF_man_iter_init(H5HF_block_iter_t *biter) *------------------------------------------------------------------------- */ herr_t -H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_block_iter_t *biter, hsize_t offset) +H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, + hsize_t offset) { H5HF_indirect_t *iblock; /* Indirect block for location context */ haddr_t iblock_addr; /* Address of indirect block */ @@ -137,7 +137,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t root_block = TRUE; /* Flag to indicate the current block is the root indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -216,7 +216,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, } /* end else */ /* Load indirect block for this context location */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, iblock_parent, iblock_par_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") /* Make indirect block the context for the current location */ @@ -227,7 +227,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") /* Release the current indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; @@ -261,7 +261,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_iter_start_offset() */ +} /* end H5HF__man_iter_start_offset() */ /*------------------------------------------------------------------------- @@ -395,7 +395,7 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) /* If this node is holding an indirect block, release the block */ if(curr_loc->context) - if(H5HF_iblock_decr(curr_loc->context) < 0) + if(H5HF__iblock_decr(curr_loc->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Free the current location context */ @@ -484,7 +484,7 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) HDassert(biter->curr->context); /* Release hold on current location's indirect block */ - if(H5HF_iblock_decr(biter->curr->context) < 0) + if(H5HF__iblock_decr(biter->curr->context) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") /* Get pointer to location context above this one */ diff --git a/src/H5HFman.c b/src/H5HFman.c index 2b88b50..394bcff 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -70,8 +70,8 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, H5HF_operator_t op, void *op_data, unsigned op_flags); +static herr_t H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, + H5HF_operator_t op, void *op_data, unsigned op_flags); /*********************/ /* Package Variables */ @@ -90,7 +90,7 @@ static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, /*------------------------------------------------------------------------- - * Function: H5HF_man_insert + * Function: H5HF__man_insert * * Purpose: Insert an object in a managed direct block * @@ -103,8 +103,7 @@ static herr_t H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, *------------------------------------------------------------------------- */ herr_t -H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj, - void *_id) +H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section */ H5HF_direct_t *dblock = NULL; /* Pointer to direct block to modify */ @@ -115,7 +114,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj htri_t node_found; /* Whether an existing free list node was found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -129,30 +128,28 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj H5HF_MAN_WRITE_CHECK_PLINE(hdr) /* Look for free space */ - if((node_found = H5HF_space_find(hdr, dxpl_id, (hsize_t)obj_size, &sec_node)) < 0) + if((node_found = H5HF__space_find(hdr, (hsize_t)obj_size, &sec_node)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't locate free space in fractal heap") /* If we didn't find a node, go create a direct block big enough to hold the requested block */ if(!node_found) /* Allocate direct block big enough to hold requested size */ - if(H5HF_man_dblock_new(hdr, dxpl_id, obj_size, &sec_node) < 0) + if(H5HF__man_dblock_new(hdr, obj_size, &sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create fractal heap direct block") /* Check for row section */ if(sec_node->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || sec_node->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW) { - /* Allocate 'single' selection out of 'row' selection */ - if(H5HF_man_iblock_alloc_row(hdr, dxpl_id, &sec_node) < 0) + if(H5HF__man_iblock_alloc_row(hdr, &sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't break up row section") } /* end if */ HDassert(sec_node->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Check for 'single' section being serialized */ - if(sec_node->sect_info.state == H5FS_SECT_SERIALIZED) { - if(H5HF_sect_single_revive(hdr, dxpl_id, sec_node) < 0) + if(sec_node->sect_info.state == H5FS_SECT_SERIALIZED) + if(H5HF__sect_single_revive(hdr, sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - } /* end if */ HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ @@ -160,7 +157,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve direct block information") /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") /* Insert object into block */ @@ -173,7 +170,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj HDassert(sec_node->sect_info.size >= obj_size); /* Reduce (& possibly re-add) single section */ - if(H5HF_sect_single_reduce(hdr, dxpl_id, sec_node, obj_size) < 0) + if(H5HF__sect_single_reduce(hdr, sec_node, obj_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce single section node") sec_node = NULL; @@ -205,15 +202,15 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj done: /* Release section node on error */ if(ret_value < 0) - if(sec_node && H5HF_sect_single_free((H5FS_section_info_t *)sec_node) < 0) + if(sec_node && H5HF__sect_single_free((H5FS_section_info_t *)sec_node) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release section node") /* Release the direct block (marked as dirty) */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_insert() */ +} /* end H5HF__man_insert() */ /*------------------------------------------------------------------------- @@ -290,7 +287,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off /*------------------------------------------------------------------------- - * Function: H5HF_man_op_real + * Function: H5HF__man_op_real * * Purpose: Internal routine to perform an operation on a managed heap * object @@ -304,7 +301,7 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off *------------------------------------------------------------------------- */ static herr_t -H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data, unsigned op_flags) { H5HF_direct_t *dblock = NULL; /* Pointer to direct block to query */ @@ -322,7 +319,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, uint8_t *p; /* Temporary pointer to obj info in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -370,7 +367,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, dblock_size = hdr->man_dtable.cparam.start_block_size; /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, NULL, 0, dblock_access_flags))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, NULL, 0, dblock_access_flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ else { @@ -379,7 +376,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned entry; /* Entry of block */ /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, obj_off, &iblock, &entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Set direct block info */ @@ -390,23 +387,23 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for offset of invalid direct block */ if(!H5F_addr_defined(dblock_addr)) { /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap ID not in allocated direct block") } /* end if */ /* Lock direct block */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, iblock, entry, dblock_access_flags))) { + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, iblock, entry, dblock_access_flags))) { /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; } /* end else */ @@ -432,15 +429,15 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, done: /* Unlock direct block */ - if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, dblock_cache_flags) < 0) + if(dblock && H5AC_unprotect(hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, dblock_cache_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_op_real() */ +} /* end H5HF__man_op_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_read + * Function: H5HF__man_read * * Purpose: Read an object from a managed heap * @@ -453,11 +450,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) +H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -467,16 +464,16 @@ H5HF_man_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) HDassert(obj); /* Call the internal 'op' routine routine */ - if(H5HF_man_op_real(hdr, dxpl_id, id, H5HF_op_read, obj, 0) < 0) + if(H5HF__man_op_real(hdr, id, H5HF_op_read, obj, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_read() */ +} /* end H5HF__man_read() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_write + * Function: H5HF__man_write * * Purpose: Write an object to a managed heap * @@ -489,12 +486,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj) +H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -505,16 +501,16 @@ H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Call the internal 'op' routine routine */ /* (Casting away const OK - QAK) */ - if(H5HF_man_op_real(hdr, dxpl_id, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) + if(H5HF__man_op_real(hdr, id, H5HF_op_write, (void *)obj, H5HF_OP_MODIFY) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_write() */ +} /* end H5HF__man_write() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_op + * Function: H5HF__man_op * * Purpose: Operate directly on an object from a managed heap * @@ -527,12 +523,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data) +H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -542,16 +537,16 @@ H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, HDassert(op); /* Call the internal 'op' routine routine */ - if(H5HF_man_op_real(hdr, dxpl_id, id, op, op_data, 0) < 0) + if(H5HF__man_op_real(hdr, id, op, op_data, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "unable to operate on heap object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_op() */ +} /* end H5HF__man_op() */ /*------------------------------------------------------------------------- - * Function: H5HF_man_remove + * Function: H5HF__man_remove * * Purpose: Remove an object from a managed heap * @@ -564,7 +559,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) +H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ H5HF_indirect_t *iblock = NULL; /* Pointer to indirect block */ @@ -577,7 +572,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) size_t blk_off; /* Offset of object in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -616,7 +611,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) } /* end if */ else { /* Look up indirect block containing direct block */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, obj_off, &iblock, &dblock_entry, &did_protect, H5AC__NO_FLAGS_SET) < 0) + if(H5HF__man_dblock_locate(hdr, obj_off, &iblock, &dblock_entry, &did_protect, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Check for offset of invalid direct block */ @@ -652,7 +647,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) /* Unlock indirect block */ if(iblock) { - if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") iblock = NULL; } /* end if */ @@ -665,21 +660,21 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) hdr->man_nobjs--; /* Return free space to the heap's list of space */ - if(H5HF_space_add(hdr, dxpl_id, sec_node, H5FS_ADD_RETURNED_SPACE) < 0) + if(H5HF__space_add(hdr, sec_node, H5FS_ADD_RETURNED_SPACE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add direct block free space to global list") sec_node = NULL; done: if(ret_value < 0) { /* Release section node */ - if(sec_node && H5HF_sect_single_free((H5FS_section_info_t *)sec_node) < 0) + if(sec_node && H5HF__sect_single_free((H5FS_section_info_t *)sec_node) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to release section node") } /* end if */ /* Unlock indirect block */ - if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(iblock && H5HF__man_iblock_unprotect(iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_man_remove() */ +} /* end H5HF__man_remove() */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index d03c1222..b38a897 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -382,8 +382,7 @@ struct H5HF_indirect_t { size_t rc; /* Reference count of objects using this block */ H5HF_hdr_t *hdr; /* Shared heap header info */ struct H5HF_indirect_t *parent; /* Shared parent indirect block info */ - struct H5HF_indirect_t - *fd_parent; /* Saved copy of the parent pointer -- this */ + void *fd_parent; /* Saved copy of the parent pointer -- this */ /* necessary as the parent field is sometimes */ /* nulled out before the eviction notify call */ /* is made from the metadata cache. Since */ @@ -397,6 +396,10 @@ struct H5HF_indirect_t { unsigned nchildren; /* Number of child blocks */ unsigned max_child; /* Max. offset used in child entries */ struct H5HF_indirect_t **child_iblocks; /* Array of pointers to pinned child indirect blocks */ + hbool_t removed_from_cache; /* Flag that indicates the block has */ + /* been removed from the metadata cache, but */ + /* is still 'live' due to a refcount (rc) > 0 */ + /* (usually from free space sections) */ /* Stored values */ hsize_t block_off; /* Offset of the block within the heap's address space */ @@ -412,7 +415,7 @@ typedef struct H5HF_direct_t { /* Internal heap information */ H5HF_hdr_t *hdr; /* Shared heap header info */ H5HF_indirect_t *parent; /* Shared parent indirect block info */ - H5HF_indirect_t *fd_parent; /* Saved copy of the parent pointer -- this */ + void *fd_parent; /* Saved copy of the parent pointer -- this */ /* necessary as the parent field is sometimes */ /* nulled out before the eviction notify call */ /* is made from the metadata cache. Since */ @@ -498,20 +501,17 @@ typedef struct H5HF_huge_bt2_filt_dir_rec_t { /* User data for free space section 'add' callback */ typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header */ - hid_t dxpl_id; /* DXPL ID for operation */ } H5HF_sect_add_ud_t; /* User data for v2 B-tree 'remove' callback on 'huge' objects */ typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header (in) */ - hid_t dxpl_id; /* DXPL ID for operation (in) */ hsize_t obj_len; /* Length of object removed (out) */ } H5HF_huge_remove_ud_t; /* User data for fractal heap header cache client callback */ typedef struct H5HF_hdr_cache_ud_t { H5F_t *f; /* File pointer */ - hid_t dxpl_id; /* DXPL ID for operation (in) */ } H5HF_hdr_cache_ud_t; /* User data for fractal heap indirect block cache client callbacks */ @@ -617,9 +617,8 @@ H5_DLL hsize_t H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start /* Heap header routines */ H5_DLL H5HF_hdr_t * H5HF_hdr_alloc(H5F_t *f); -H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam); -H5_DLL H5HF_hdr_t *H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, - unsigned flags); +H5_DLL haddr_t H5HF_hdr_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_hdr_t *H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags); H5_DLL herr_t H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_finish_init(H5HF_hdr_t *hdr); @@ -632,100 +631,95 @@ H5_DLL herr_t H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt); H5_DLL herr_t H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free); H5_DLL herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size); H5_DLL herr_t H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, unsigned curr_entry); -H5_DLL herr_t H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); -H5_DLL herr_t H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size); +H5_DLL herr_t H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries); +H5_DLL herr_t H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size); H5_DLL herr_t H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries); -H5_DLL herr_t H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblock_addr); +H5_DLL herr_t H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr); H5_DLL herr_t H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off); -H5_DLL herr_t H5HF_hdr_empty(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__hdr_empty(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_free(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5HF__hdr_delete(H5HF_hdr_t *hdr); H5_DLL herr_t H5HF_hdr_dest(H5HF_hdr_t *hdr); /* Indirect block routines */ H5_DLL herr_t H5HF_iblock_incr(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_iblock_decr(H5HF_indirect_t *iblock); +H5_DLL herr_t H5HF__iblock_decr(H5HF_indirect_t *iblock); H5_DLL herr_t H5HF_iblock_dirty(H5HF_indirect_t *iblock); -H5_DLL herr_t H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_root_create(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size); -H5_DLL herr_t H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node); -H5_DLL herr_t H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *par_iblock, unsigned par_entry, unsigned nrows, - unsigned max_rows, haddr_t *addr_p); -H5_DLL H5HF_indirect_t *H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t iblock_addr, unsigned iblock_nrows, - H5HF_indirect_t *par_iblock, unsigned par_entry, hbool_t must_protect, - unsigned flags, hbool_t *did_protect); -H5_DLL herr_t H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, - unsigned cache_flags, hbool_t did_protect); +H5_DLL herr_t H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, + unsigned par_entry, unsigned nrows, unsigned max_rows, haddr_t *addr_p); +H5_DLL H5HF_indirect_t *H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, + unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, + hbool_t must_protect, unsigned flags, hbool_t *did_protect); +H5_DLL herr_t H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, + hbool_t did_protect); H5_DLL herr_t H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t dblock_addr); -H5_DLL herr_t H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry); +H5_DLL herr_t H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry); H5_DLL herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr); -H5_DLL herr_t H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t iblock_addr, unsigned iblock_nrows, H5HF_indirect_t *par_iblock, - unsigned par_entry); -H5_DLL herr_t H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, + unsigned iblock_nrows, H5HF_indirect_t *par_iblock, unsigned par_entry); +H5_DLL herr_t H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned nrows, H5HF_indirect_t *par_iblock, unsigned par_entry, hsize_t *heap_size/*out*/); +H5_DLL herr_t H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, + hsize_t block_off, hsize_t *ret_par_block_off, unsigned *ret_entry); H5_DLL herr_t H5HF_man_iblock_dest(H5HF_indirect_t *iblock); /* Direct block routines */ -H5_DLL herr_t H5HF_man_dblock_new(H5HF_hdr_t *fh, hid_t dxpl_id, size_t request, +H5_DLL herr_t H5HF__man_dblock_new(H5HF_hdr_t *fh, size_t request, H5HF_free_section_t **ret_sec_node); -H5_DLL herr_t H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, +H5_DLL herr_t H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned par_entry, haddr_t *addr_p, H5HF_free_section_t **ret_sec_node); -H5_DLL herr_t H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_direct_t *dblock, haddr_t dblock_addr); -H5_DLL H5HF_direct_t *H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, - haddr_t dblock_addr, size_t dblock_size, - H5HF_indirect_t *par_iblock, unsigned par_entry, +H5_DLL herr_t H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, + haddr_t dblock_addr, hbool_t *parent_removed); +H5_DLL H5HF_direct_t *H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, + size_t dblock_size, H5HF_indirect_t *par_iblock, unsigned par_entry, + unsigned flags); +H5_DLL herr_t H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, + H5HF_indirect_t **par_iblock, unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); -H5_DLL herr_t H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, - hsize_t obj_off, H5HF_indirect_t **par_iblock, - unsigned *par_entry, hbool_t *par_did_protect, unsigned flags); -H5_DLL herr_t H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, +H5_DLL herr_t H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size); H5_DLL herr_t H5HF_man_dblock_dest(H5HF_direct_t *dblock); /* Managed object routines */ -H5_DLL herr_t H5HF_man_insert(H5HF_hdr_t *fh, hid_t dxpl_id, size_t obj_size, +H5_DLL herr_t H5HF__man_insert(H5HF_hdr_t *fh, size_t obj_size, const void *obj, void *id); H5_DLL herr_t H5HF_man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p); H5_DLL void H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p); -H5_DLL herr_t H5HF_man_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, - void *obj); -H5_DLL herr_t H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - const void *obj); -H5_DLL herr_t H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, - H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id); +H5_DLL herr_t H5HF__man_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); +H5_DLL herr_t H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj); +H5_DLL herr_t H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, + void *op_data); +H5_DLL herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id); /* 'Huge' object routines */ H5_DLL herr_t H5HF_huge_init(H5HF_hdr_t *hdr); -H5_DLL herr_t H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, +H5_DLL herr_t H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *id); -H5_DLL herr_t H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, size_t *obj_len_p); -H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *id, hsize_t *obj_off_p); -H5_DLL herr_t H5HF_huge_read(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, + size_t *obj_len_p); +H5_DLL herr_t H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, + hsize_t *obj_off_p); +H5_DLL herr_t H5HF__huge_read(H5HF_hdr_t *fh, const uint8_t *id, void *obj); -H5_DLL herr_t H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj); -H5_DLL herr_t H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, +H5_DLL herr_t H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_huge_remove(H5HF_hdr_t *fh, hid_t dxpl_id, const uint8_t *id); -H5_DLL herr_t H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5HF__huge_remove(H5HF_hdr_t *fh, const uint8_t *id); +H5_DLL herr_t H5HF__huge_term(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__huge_delete(H5HF_hdr_t *hdr); /* 'Huge' object v2 B-tree function callbacks */ H5_DLL herr_t H5HF__huge_bt2_indir_found(const void *nrecord, void *op_data); @@ -748,21 +742,21 @@ H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Debugging routines for dumping file structures */ -H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, haddr_t addr, + FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, +H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); /* Block iteration routines */ H5_DLL herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter); -H5_DLL herr_t H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_block_iter_t *biter, hsize_t offset); +H5_DLL herr_t H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, + hsize_t offset); H5_DLL herr_t H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indirect_t *iblock, unsigned start_entry); H5_DLL herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, @@ -779,39 +773,36 @@ H5_DLL herr_t H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5_DLL hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter); /* Free space manipulation routines */ -H5_DLL herr_t H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create); -H5_DLL herr_t H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *node, unsigned flags); -H5_DLL htri_t H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, +H5_DLL herr_t H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create); +H5_DLL herr_t H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, + unsigned flags); +H5_DLL htri_t H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node); -H5_DLL herr_t H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__space_revert_root(const H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock); -H5_DLL herr_t H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size); -H5_DLL herr_t H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *node); -H5_DLL herr_t H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); -H5_DLL herr_t H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, +H5_DLL herr_t H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size); +H5_DLL herr_t H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node); +H5_DLL herr_t H5HF__space_close(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_delete(H5HF_hdr_t *hdr); +H5_DLL herr_t H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *parent, unsigned par_entry); -H5_DLL herr_t H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); +H5_DLL herr_t H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); H5_DLL herr_t H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, - H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); -H5_DLL herr_t H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, size_t amt); -H5_DLL herr_t H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, unsigned *entry_p); + const H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size); +H5_DLL herr_t H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + size_t amt); +H5_DLL herr_t H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +H5_DLL herr_t H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + unsigned *entry_p); H5_DLL H5HF_indirect_t *H5HF_sect_row_get_iblock(H5HF_free_section_t *sect); -H5_DLL herr_t H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries); -H5_DLL herr_t H5HF_sect_single_free(H5FS_section_info_t *sect); +H5_DLL herr_t H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries); +H5_DLL herr_t H5HF__sect_single_free(H5FS_section_info_t *sect); /* Internal operator callbacks */ H5_DLL herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data); diff --git a/src/H5HFprivate.h b/src/H5HFprivate.h index 8cf4b3c..5086afb 100644 --- a/src/H5HFprivate.h +++ b/src/H5HFprivate.h @@ -106,36 +106,33 @@ typedef herr_t (*H5HF_operator_t)(const void *obj/*in*/, size_t obj_len, /***************************************/ /* General routines for fractal heap operations */ -H5_DLL H5HF_t *H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam); -H5_DLL H5HF_t *H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr); +H5_DLL H5HF_t *H5HF_create(H5F_t *f, const H5HF_create_t *cparam); +H5_DLL H5HF_t *H5HF_open(H5F_t *f, haddr_t fh_addr); H5_DLL herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p/*out*/); H5_DLL herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr/*out*/); -H5_DLL herr_t H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, - const void *obj, void *id/*out*/); -H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *id, - size_t *obj_len_p/*out*/); -H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, hid_t dxpl_id, const void *_id, - hsize_t *obj_off_p/*out*/); -H5_DLL herr_t H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *id, - void *obj/*out*/); -H5_DLL herr_t H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *id, hbool_t *id_changed, +H5_DLL herr_t H5HF_insert(H5HF_t *fh, size_t size, const void *obj, + void *id/*out*/); +H5_DLL herr_t H5HF_get_obj_len(H5HF_t *fh, const void *id, size_t *obj_len_p/*out*/); +H5_DLL herr_t H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p/*out*/); +H5_DLL herr_t H5HF_read(H5HF_t *fh, const void *id, void *obj/*out*/); +H5_DLL herr_t H5HF_write(H5HF_t *fh, void *id, hbool_t *id_changed, const void *obj); -H5_DLL herr_t H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *id, - H5HF_operator_t op, void *op_data); -H5_DLL herr_t H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *id); -H5_DLL herr_t H5HF_close(H5HF_t *fh, hid_t dxpl_id); -H5_DLL herr_t H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr); +H5_DLL herr_t H5HF_op(H5HF_t *fh, const void *id, H5HF_operator_t op, + void *op_data); +H5_DLL herr_t H5HF_remove(H5HF_t *fh, const void *id); +H5_DLL herr_t H5HF_close(H5HF_t *fh); +H5_DLL herr_t H5HF_delete(H5F_t *f, haddr_t fh_addr); /* Statistics routines */ H5_DLL herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats); -H5_DLL herr_t H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size/*out*/); +H5_DLL herr_t H5HF_size(const H5HF_t *fh, hsize_t *heap_size/*out*/); /* Debugging routines */ -H5_DLL herr_t H5HF_id_print(H5HF_t *fh, hid_t dxpl_id, - const void *id, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_id_print(H5HF_t *fh, const void *id, FILE *stream, + int indent, int fwidth); #ifdef H5HF_DEBUGGING -H5_DLL herr_t H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5HF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); #endif /* H5HF_DEBUGGING */ #endif /* _H5HFprivate_H */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 42c12ec..66c8414 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -77,58 +77,57 @@ static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *parent); /* 'single' section routines */ -static herr_t H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, - hbool_t refresh, H5HF_free_section_t *sect); -static herr_t H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect); +static herr_t H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); /* 'single' section callbacks */ -static herr_t H5HF_sect_single_add(H5FS_section_info_t **sect, unsigned *flags, +static herr_t H5HF__sect_single_add(H5FS_section_info_t **sect, unsigned *flags, void *udata); -static H5FS_section_info_t *H5HF_sect_single_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, +static H5FS_section_info_t *H5HF__sect_single_deserialize(const H5FS_section_class_t *cls, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static htri_t H5HF_sect_single_can_merge(const H5FS_section_info_t *sect1, +static htri_t H5HF__sect_single_can_merge(const H5FS_section_info_t *sect1, const H5FS_section_info_t *sect2, void *udata); -static herr_t H5HF_sect_single_merge(H5FS_section_info_t **sect1, +static herr_t H5HF__sect_single_merge(H5FS_section_info_t **sect1, H5FS_section_info_t *sect2, void *udata); -static htri_t H5HF_sect_single_can_shrink(const H5FS_section_info_t *sect, +static htri_t H5HF__sect_single_can_shrink(const H5FS_section_info_t *sect, void *udata); -static herr_t H5HF_sect_single_shrink(H5FS_section_info_t **_sect, +static herr_t H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *udata); -static herr_t H5HF_sect_single_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); +static herr_t H5HF__sect_single_valid(const H5FS_section_class_t *cls, + const H5FS_section_info_t *sect); /* 'row' section routines */ static H5HF_free_section_t *H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, unsigned row, unsigned col, unsigned nentries, H5HF_free_section_t *under_sect); -static herr_t H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_parent_removed(H5HF_free_section_t *sect); static herr_t H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_direct_t *dblock); -static herr_t H5HF_sect_row_free_real(H5HF_free_section_t *sect); +static herr_t H5HF__sect_row_free_real(H5HF_free_section_t *sect); /* 'row' section callbacks */ -static herr_t H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *udata); -static herr_t H5HF_sect_row_term_cls(H5FS_section_class_t *cls); -static herr_t H5HF_sect_row_serialize(const H5FS_section_class_t *cls, +static herr_t H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *udata); +static herr_t H5HF__sect_row_term_cls(H5FS_section_class_t *cls); +static herr_t H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_info_t *sect, uint8_t *buf); -static H5FS_section_info_t *H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, +static H5FS_section_info_t *H5HF__sect_row_deserialize(const H5FS_section_class_t *cls, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); -static htri_t H5HF_sect_row_can_merge(const H5FS_section_info_t *sect1, +static htri_t H5HF__sect_row_can_merge(const H5FS_section_info_t *sect1, const H5FS_section_info_t *sect2, void *udata); -static herr_t H5HF_sect_row_merge(H5FS_section_info_t **sect1, +static herr_t H5HF__sect_row_merge(H5FS_section_info_t **sect1, H5FS_section_info_t *sect2, void *udata); -static htri_t H5HF_sect_row_can_shrink(const H5FS_section_info_t *sect, +static htri_t H5HF__sect_row_can_shrink(const H5FS_section_info_t *sect, void *udata); -static herr_t H5HF_sect_row_shrink(H5FS_section_info_t **sect, +static herr_t H5HF__sect_row_shrink(H5FS_section_info_t **sect, void *udata); -static herr_t H5HF_sect_row_free(H5FS_section_info_t *sect); -static herr_t H5HF_sect_row_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); -static herr_t H5HF_sect_row_debug(const H5FS_section_info_t *sect, +static herr_t H5HF__sect_row_free(H5FS_section_info_t *sect); +static herr_t H5HF__sect_row_valid(const H5FS_section_class_t *cls, + const H5FS_section_info_t *sect); +static herr_t H5HF__sect_row_debug(const H5FS_section_info_t *sect, FILE *stream, int indent, int fwidth); /* 'indirect' section routines */ @@ -136,37 +135,36 @@ static H5HF_free_section_t *H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_indirect_t *iblock, hsize_t iblock_off, unsigned row, unsigned col, unsigned nentries); -static herr_t H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, hbool_t first_child, H5HF_free_section_t **first_row_sect, +static herr_t H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col); static H5HF_free_section_t *H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *row_sect); static herr_t H5HF_sect_indirect_decr(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock); -static herr_t H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t *alloc_from_start); -static herr_t H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry); -static herr_t H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static hbool_t H5HF_sect_indirect_is_first(H5HF_free_section_t *sect); static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect); static hsize_t H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect); static H5HF_free_section_t * H5HF_sect_indirect_top(H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect1, H5HF_free_section_t *sect2); -static herr_t H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); -static herr_t H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, +static herr_t H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); +static herr_t H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect); static herr_t H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, uint8_t *buf); -static H5FS_section_info_t *H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags); +static H5FS_section_info_t *H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); static herr_t H5HF_sect_indirect_free(H5HF_free_section_t *sect); static herr_t H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect); @@ -195,15 +193,15 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_SINGLE[1] = {{ NULL, /* Terminate section class */ /* Object methods */ - H5HF_sect_single_add, /* Add section */ + H5HF__sect_single_add, /* Add section */ NULL, /* Serialize section */ - H5HF_sect_single_deserialize, /* Deserialize section */ - H5HF_sect_single_can_merge, /* Can sections merge? */ - H5HF_sect_single_merge, /* Merge sections */ - H5HF_sect_single_can_shrink, /* Can section shrink container?*/ - H5HF_sect_single_shrink, /* Shrink container w/section */ - H5HF_sect_single_free, /* Free section */ - H5HF_sect_single_valid, /* Check validity of section */ + H5HF__sect_single_deserialize, /* Deserialize section */ + H5HF__sect_single_can_merge, /* Can sections merge? */ + H5HF__sect_single_merge, /* Merge sections */ + H5HF__sect_single_can_shrink, /* Can section shrink container?*/ + H5HF__sect_single_shrink, /* Shrink container w/section */ + H5HF__sect_single_free, /* Free section */ + H5HF__sect_single_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ NULL, /* Dump debugging for section */ }}; @@ -220,21 +218,21 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_FIRST_ROW[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_row_init_cls, /* Initialize section class */ - H5HF_sect_row_term_cls, /* Terminate section class */ + H5HF__sect_row_init_cls, /* Initialize section class */ + H5HF__sect_row_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ - H5HF_sect_row_serialize, /* Serialize section */ - H5HF_sect_row_deserialize, /* Deserialize section */ - H5HF_sect_row_can_merge, /* Can sections merge? */ - H5HF_sect_row_merge, /* Merge sections */ - H5HF_sect_row_can_shrink, /* Can section shrink container?*/ - H5HF_sect_row_shrink, /* Shrink container w/section */ - H5HF_sect_row_free, /* Free section */ - H5HF_sect_row_valid, /* Check validity of section */ + H5HF__sect_row_serialize, /* Serialize section */ + H5HF__sect_row_deserialize, /* Deserialize section */ + H5HF__sect_row_can_merge, /* Can sections merge? */ + H5HF__sect_row_merge, /* Merge sections */ + H5HF__sect_row_can_shrink, /* Can section shrink container?*/ + H5HF__sect_row_shrink, /* Shrink container w/section */ + H5HF__sect_row_free, /* Free section */ + H5HF__sect_row_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ - H5HF_sect_row_debug, /* Dump debugging for section */ + H5HF__sect_row_debug, /* Dump debugging for section */ }}; /* Class info for "normal row" free space sections */ @@ -246,8 +244,8 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1] = {{ NULL, /* Class private info */ /* Class methods */ - H5HF_sect_row_init_cls, /* Initialize section class */ - H5HF_sect_row_term_cls, /* Terminate section class */ + H5HF__sect_row_init_cls, /* Initialize section class */ + H5HF__sect_row_term_cls, /* Terminate section class */ /* Object methods */ NULL, /* Add section */ @@ -257,10 +255,10 @@ H5FS_section_class_t H5HF_FSPACE_SECT_CLS_NORMAL_ROW[1] = {{ NULL, /* Merge sections */ NULL, /* Can section shrink container?*/ NULL, /* Shrink container w/section */ - H5HF_sect_row_free, /* Free section */ - H5HF_sect_row_valid, /* Check validity of section */ + H5HF__sect_row_free, /* Free section */ + H5HF__sect_row_valid, /* Check validity of section */ NULL, /* Split section node for alignment */ - H5HF_sect_row_debug, /* Dump debugging for section */ + H5HF__sect_row_debug, /* Dump debugging for section */ }}; /* Class info for "indirect" free space sections */ @@ -459,7 +457,7 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) /* Release indirect block, if there was one */ if(iblock) - if(H5HF_iblock_decr(iblock) < 0) + if(H5HF__iblock_decr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") /* Release the section */ @@ -523,7 +521,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_locate_parent + * Function: H5HF__sect_single_locate_parent * * Purpose: Locate the parent indirect block for a single section * @@ -536,7 +534,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, +H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ @@ -544,7 +542,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -554,7 +552,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, HDassert(sect); /* Look up indirect block containing direct blocks for range */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") /* Increment reference count on indirect block that free section is in */ @@ -565,7 +563,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, if(refresh) { if(sect->u.single.parent) { /* Release hold on previous parent indirect block */ - if(H5HF_iblock_decr(sect->u.single.parent) < 0) + if(H5HF__iblock_decr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") } /* end if */ } /* end if */ @@ -575,17 +573,17 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, sect->u.single.par_entry = sec_entry; /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(sec_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(sec_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") sec_iblock = NULL; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_locate_parent() */ +} /* end H5HF__sect_single_locate_parent() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_revive + * Function: H5HF__sect_single_revive * * Purpose: Update the memory information for a 'single' free section * @@ -598,12 +596,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect) +H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -621,7 +618,7 @@ H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, } /* end if */ else { /* Look up indirect block information for section */ - if(H5HF_sect_single_locate_parent(hdr, dxpl_id, FALSE, sect) < 0) + if(H5HF__sect_single_locate_parent(hdr, FALSE, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get section's parent info") } /* end else */ @@ -630,7 +627,7 @@ H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_revive() */ +} /* end H5HF__sect_single_revive() */ /*------------------------------------------------------------------------- @@ -647,8 +644,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, - H5HF_free_section_t *sect, haddr_t *dblock_addr, size_t *dblock_size) +H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, + haddr_t *dblock_addr, size_t *dblock_size) { FUNC_ENTER_NOAPI_NOERR @@ -680,7 +677,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_reduce + * Function: H5HF__sect_single_reduce * * Purpose: Reduce the size of a single section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -695,12 +692,12 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, size_t amt) +H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + size_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -713,7 +710,7 @@ H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Check for eliminating the section */ if(sect->sect_info.size == amt) { /* Free single section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)sect) < 0) + if(H5HF__sect_single_free((H5FS_section_info_t *)sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free single section node") } /* end if */ else { @@ -722,17 +719,17 @@ H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, sect->sect_info.size -= amt; /* Re-insert section node into heap's free space */ - if(H5HF_space_add(hdr, dxpl_id, sect, 0) < 0) + if(H5HF__space_add(hdr, sect, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add single section to free space manager") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_single_reduce() */ +} /* end H5HF__sect_single_reduce() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_full_dblock + * Function: H5HF__sect_single_full_dblock * * Purpose: Checks if a single section covers the entire direct block * that it resides in, and converts it to a row section if so @@ -749,15 +746,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect) +H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { haddr_t dblock_addr; /* Section's direct block's address */ size_t dblock_size; /* Section's direct block's size */ size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(sect); @@ -774,8 +770,9 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, if((dblock_size - dblock_overhead) == sect->sect_info.size && hdr->man_dtable.curr_root_rows > 0) { H5HF_direct_t *dblock; /* Pointer to direct block for section */ + hbool_t parent_removed; /* Whether the direct block parent was removed from the file */ - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); @@ -784,18 +781,25 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't convert single section into row section") /* Destroy direct block */ - if(H5HF_man_dblock_destroy(hdr, dxpl_id, dblock, dblock_addr) < 0) + if(H5HF__man_dblock_destroy(hdr, dblock, dblock_addr, &parent_removed) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release direct block") dblock = NULL; + + /* If the parent for this direct block was removed and the indirect + * section is still "live", switch it to the "serialized" state. + */ + if(parent_removed && H5FS_SECT_LIVE == sect->u.row.under->sect_info.state) + if(H5HF__sect_row_parent_removed(sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "can't update section info") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_full_dblock() */ +} /* H5HF__sect_single_full_dblock() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_add + * Function: H5HF__sect_single_add * * Purpose: Perform any actions on section as it is added to free space * manager @@ -809,11 +813,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) +H5HF__sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Don't need to check section if we are deserializing, because it should * have already been checked when it was first added @@ -822,7 +826,6 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ /* Sanity check */ HDassert(sect); @@ -830,7 +833,7 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) /* Check if single section covers entire direct block it's in */ /* (converts to row section possibly) */ - if(H5HF_sect_single_full_dblock(hdr, dxpl_id, (*sect)) < 0) + if(H5HF__sect_single_full_dblock(hdr, (*sect)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't check/convert single section") /* Set the "returned space" flag if the single section was changed @@ -843,11 +846,11 @@ H5HF_sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_add() */ +} /* H5HF__sect_single_add() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_deserialize + * Function: H5HF__sect_single_deserialize * * Purpose: Deserialize a buffer into a "live" single section * @@ -860,14 +863,14 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, - hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, +H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, + const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5HF_free_section_t *new_sect; /* New section */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -882,11 +885,11 @@ H5HF_sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_deserialize() */ +} /* H5HF__sect_single_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_can_merge + * Function: H5HF__sect_single_can_merge * * Purpose: Can two sections of this type merge? * @@ -902,14 +905,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, +H5HF__sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect1); @@ -927,11 +930,11 @@ H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_can_merge() */ +} /* H5HF__sect_single_can_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_merge + * Function: H5HF__sect_single_merge * * Purpose: Merge two sections of this type * @@ -947,17 +950,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, +H5HF__sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, void *_udata) { H5HF_free_section_t **sect1 = (H5HF_free_section_t **)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect1); @@ -970,26 +972,26 @@ H5HF_sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2 (*sect1)->sect_info.size += sect2->sect_info.size; /* Get rid of second section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)sect2) < 0) + if(H5HF__sect_single_free((H5FS_section_info_t *)sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") /* Check to see if we should revive first section */ if((*sect1)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_single_revive(hdr, dxpl_id, (*sect1)) < 0) + if(H5HF__sect_single_revive(hdr, (*sect1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Check if single section covers entire direct block it's in */ /* (converts to row section possibly) */ - if(H5HF_sect_single_full_dblock(hdr, dxpl_id, (*sect1)) < 0) + if(H5HF__sect_single_full_dblock(hdr, (*sect1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCONVERT, FAIL, "can't check/convert single section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_merge() */ +} /* H5HF__sect_single_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_can_shrink + * Function: H5HF__sect_single_can_shrink * * Purpose: Can this section shrink the container? * @@ -1007,14 +1009,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) +H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1044,11 +1046,11 @@ H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_can_shrink() */ +} /* H5HF__sect_single_can_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_shrink + * Function: H5HF__sect_single_shrink * * Purpose: Shrink container with section * @@ -1062,18 +1064,17 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata) +H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ H5HF_direct_t *dblock; /* Pointer to direct block for section */ haddr_t dblock_addr; /* Section's direct block's address */ size_t dblock_size; /* Section's direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -1082,7 +1083,7 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata /* Check to see if we should revive section */ if((*sect)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_single_revive(hdr, dxpl_id, (*sect)) < 0) + if(H5HF__sect_single_revive(hdr, (*sect)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") /* Retrieve direct block address from section */ @@ -1092,30 +1093,29 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void H5_ATTR_UNUSED *_udata /* Protect the direct block for the section */ /* (should be a root direct block) */ HDassert(dblock_addr == hdr->man_dtable.table_addr); - if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, - dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) + if(NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") HDassert(H5F_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size)); + /* Get rid of section */ + if(H5HF__sect_single_free((H5FS_section_info_t *)*sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") + /* Destroy direct block */ - if(H5HF_man_dblock_destroy(hdr, dxpl_id, dblock, dblock_addr) < 0) + if(H5HF__man_dblock_destroy(hdr, dblock, dblock_addr, NULL) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release direct block") dblock = NULL; - /* Get rid of section */ - if(H5HF_sect_single_free((H5FS_section_info_t *)*sect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") - /* Indicate that the section has been released */ *sect = NULL; done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_shrink() */ +} /* H5HF__sect_single_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_free + * Function: H5HF__sect_single_free * * Purpose: Free a 'single' section node * @@ -1129,13 +1129,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_single_free(H5FS_section_info_t *_sect) +H5HF__sect_single_free(H5FS_section_info_t *_sect) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Pointer to section to free */ H5HF_indirect_t *parent = NULL; /* Parent indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(sect); @@ -1153,11 +1153,11 @@ H5HF_sect_single_free(H5FS_section_info_t *_sect) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_single_free() */ +} /* H5HF__sect_single_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_single_valid + * Function: H5HF__sect_single_valid * * Purpose: Check the validity of a section * @@ -1170,11 +1170,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t *_sect, hid_t dxpl_id) +H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_section_info_t *_sect) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1195,8 +1195,7 @@ H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5F HDassert(H5F_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ - /* (Casting away const OK - QAK) */ - status = H5HF_sect_single_dblock_info(iblock->hdr, (H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); + status = H5HF_sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); HDassert(status >= 0); HDassert(H5F_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); HDassert(dblock_size > 0); @@ -1220,25 +1219,24 @@ H5HF_sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5F H5HF_direct_t *dblock; /* Direct block for section */ /* Protect the direct block for the section */ - dblock = H5HF_man_dblock_protect(iblock->hdr, dxpl_id, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); + dblock = H5HF__man_dblock_protect(iblock->hdr, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); HDassert(dblock); /* Sanity check settings for section */ HDassert(dblock_size == dblock->size); HDassert(dblock->size > sect->sect_info.size); HDassert(H5F_addr_lt(dblock->block_off, sect->sect_info.addr)); - HDassert(H5F_addr_ge((dblock->block_off + dblock->size), - (sect->sect_info.addr + sect->sect_info.size))); + HDassert(H5F_addr_ge((dblock->block_off + dblock->size), (sect->sect_info.addr + sect->sect_info.size))); /* Release direct block */ - status = H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); + status = H5AC_unprotect(iblock->hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); HDassert(status >= 0); } /* end if */ } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_single_valid() */ +} /* H5HF__sect_single_valid() */ /*------------------------------------------------------------------------- @@ -1330,7 +1328,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "serializing row section not supported yet") /* Release single section's hold on underlying indirect block */ - if(H5HF_iblock_decr(dblock->parent) < 0) + if(H5HF__iblock_decr(dblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") done: @@ -1339,7 +1337,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_revive + * Function: H5HF__sect_row_revive * * Purpose: Update the memory information for a 'row' free section * @@ -1352,11 +1350,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1364,20 +1362,28 @@ H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) HDassert(hdr); HDassert(sect); HDassert(sect->u.row.under); - HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); + + /* If the indirect section's iblock has been removed from the cache, but the + * section is still marked as "live", switch it to the "serialized" state. + */ + if((H5FS_SECT_LIVE == sect->u.row.under->sect_info.state) + && (TRUE == sect->u.row.under->u.indirect.u.iblock->removed_from_cache)) + if(H5HF__sect_row_parent_removed(sect) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUPDATE, FAIL, "can't update section info") /* Pass along "revive" request to underlying indirect section */ /* (which will mark this section as "live") */ - if(H5HF_sect_indirect_revive_row(hdr, dxpl_id, sect->u.row.under) < 0) + if(H5HF__sect_indirect_revive_row(hdr, sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") + HDassert(sect->sect_info.state == H5FS_SECT_LIVE); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_revive() */ +} /* end H5HF__sect_row_revive() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_reduce + * Function: H5HF__sect_row_reduce * * Purpose: Reduce the size of a row section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -1392,13 +1398,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, +H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entry_p) { hbool_t alloc_from_start; /* Whether to allocate from the end of the row */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1416,7 +1422,7 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, /* Forward row section to indirect routines, to handle reducing underlying indirect section */ alloc_from_start = FALSE; - if(H5HF_sect_indirect_reduce_row(hdr, dxpl_id, sect, &alloc_from_start) < 0) + if(H5HF__sect_indirect_reduce_row(hdr, sect, &alloc_from_start) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce underlying section") /* Determine entry allocated */ @@ -1427,7 +1433,7 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, /* Check for eliminating the section */ if(sect->u.row.num_entries == 1) { /* Free row section */ - if(H5HF_sect_row_free((H5FS_section_info_t *)sect) < 0) + if(H5HF__sect_row_free((H5FS_section_info_t *)sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free row section node") } /* end if */ else { @@ -1445,17 +1451,17 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, sect->u.row.checked_out = FALSE; /* Add 'row' section back to free space list */ - if(H5HF_space_add(hdr, dxpl_id, sect, 0) < 0) + if(H5HF__space_add(hdr, sect, 0) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add indirect section to free space manager") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_reduce() */ +} /* end H5HF__sect_row_reduce() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_first + * Function: H5HF__sect_row_first * * Purpose: Make row a "first row" * @@ -1468,11 +1474,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(hdr); @@ -1485,15 +1491,14 @@ H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) */ if(sect->u.row.checked_out) sect->sect_info.type = H5HF_FSPACE_SECT_FIRST_ROW; - else { + else /* Change row section to be the "first row" */ - if(H5HF_space_sect_change_class(hdr, dxpl_id, sect, H5HF_FSPACE_SECT_FIRST_ROW) < 0) + if(H5HF__space_sect_change_class(hdr, sect, H5HF_FSPACE_SECT_FIRST_ROW) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set row section to be first row") - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_row_first() */ +} /* end H5HF__sect_row_first() */ /*------------------------------------------------------------------------- @@ -1531,7 +1536,60 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_init_cls + * Function: H5HF__sect_row_parent_removed + * + * Purpose: Update the information for a row and its parent indirect + * when an indirect block is removed from the metadata cache. + * + * Return: Non-negative on success / Negative on failure + * + * Programmer: Quincey Koziol + * koziol@lbl.gov + * February 4 2018 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF__sect_row_parent_removed(H5HF_free_section_t *sect) +{ + hsize_t tmp_iblock_off; /* Indirect block offset for row */ + unsigned u; /* Local index value */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check arguments */ + HDassert(sect); + + /* Get a copy of the indirect block's offset before decrementing refcount on it */ + tmp_iblock_off = sect->u.row.under->u.indirect.u.iblock->block_off; + + /* Decrement the refcount on the indirect block, since serialized sections don't hold a reference */ + if(H5HF__iblock_decr(sect->u.row.under->u.indirect.u.iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") + + /* Switch indirect block info to serialized form */ + /* (Overwrites iblock pointer in the indirect section) */ + sect->u.row.under->u.indirect.u.iblock_off = tmp_iblock_off; + sect->u.row.under->u.indirect.iblock_entries = 0; + + /* Loop over derived row sections and mark them all as 'live' now */ + for(u = 0; u < sect->u.row.under->u.indirect.dir_nrows; u++) + sect->u.row.under->u.indirect.dir_rows[u]->sect_info.state = H5FS_SECT_SERIALIZED; + + /* Mark the indirect section as serialized now */ + sect->u.row.under->sect_info.state = H5FS_SECT_SERIALIZED; + + /* Mark the row section as serialized now */ + sect->sect_info.state = H5FS_SECT_SERIALIZED; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__sect_row_parent_removed() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF__sect_row_init_cls * * Purpose: Initialize the "row" section class structure * @@ -1548,12 +1606,12 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) +H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1571,11 +1629,11 @@ H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_init_cls() */ +} /* H5HF__sect_row_init_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_term_cls + * Function: H5HF__sect_row_term_cls * * Purpose: Terminate the "row" section class structure * @@ -1592,11 +1650,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_term_cls(H5FS_section_class_t *cls) +H5HF__sect_row_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1607,11 +1665,11 @@ H5HF_sect_row_term_cls(H5FS_section_class_t *cls) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_term_cls() */ +} /* H5HF__sect_row_term_cls() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_serialize + * Function: H5HF__sect_row_serialize * * Purpose: Serialize a "live" row section into a buffer * @@ -1625,14 +1683,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_serialize(const H5FS_section_class_t *cls, +H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect, uint8_t *buf) { H5HF_hdr_t *hdr; /* Fractal heap header */ const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1648,11 +1706,11 @@ H5HF_sect_row_serialize(const H5FS_section_class_t *cls, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_serialize() */ +} /* H5HF__sect_row_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_deserialize + * Function: H5HF__sect_row_deserialize * * Purpose: Deserialize a buffer into a "live" row section * @@ -1669,14 +1727,13 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, - const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags) +H5HF__sect_row_deserialize(const H5FS_section_class_t *cls, const uint8_t *buf, + haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags) { H5HF_hdr_t *hdr; /* Fractal heap header */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(cls); @@ -1686,17 +1743,16 @@ H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, /* Forward to indirect routine to deserialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; - if(NULL == (ret_value = H5HF_sect_indirect_deserialize(hdr, dxpl_id, buf, - sect_addr, sect_size, des_flags))) + if(NULL == (ret_value = H5HF__sect_indirect_deserialize(hdr, buf, sect_addr, sect_size, des_flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, NULL, "can't deserialize row section's underlying indirect section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_deserialize() */ +} /* H5HF__sect_row_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_can_merge + * Function: H5HF__sect_row_can_merge * * Purpose: Can two sections of this type merge? * @@ -1712,7 +1768,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, +H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect1 = (const H5HF_free_section_t *)_sect1; /* Fractal heap free section */ @@ -1720,7 +1776,7 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, H5HF_free_section_t *top_indir_sect1, *top_indir_sect2; /* Top indirect section for each row */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect1); @@ -1740,7 +1796,7 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, * section. */ if(top_indir_sect1 != top_indir_sect2) { - if(H5HF_sect_indirect_iblock_off(top_indir_sect1) == H5HF_sect_indirect_iblock_off(top_indir_sect2)) { + if(H5HF_sect_indirect_iblock_off(sect1->u.row.under) == H5HF_sect_indirect_iblock_off(sect2->u.row.under)) { /* Check if second section adjoins first section */ if(H5F_addr_eq((top_indir_sect1->sect_info.addr + top_indir_sect1->u.indirect.span_size), top_indir_sect2->sect_info.addr)) HGOTO_DONE(TRUE) @@ -1749,11 +1805,11 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_can_merge() */ +} /* H5HF__sect_row_can_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_merge + * Function: H5HF__sect_row_merge * * Purpose: Merge two sections of this type * @@ -1769,17 +1825,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, +H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, void *_udata) { H5HF_free_section_t **sect1 = (H5HF_free_section_t **)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect1); @@ -1795,32 +1850,21 @@ H5HF_sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, top_indir_sect = H5HF_sect_indirect_top(sect2->u.row.under); /* Shrink away underlying indirect section */ - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, top_indir_sect) < 0) + if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't shrink underlying indirect section") } /* end if */ - else { - /* Check to see if we should revive first section */ - if((*sect1)->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_row_revive(hdr, dxpl_id, (*sect1)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - - /* Check to see if we should revive second section */ - if(sect2->sect_info.state != H5FS_SECT_LIVE) - if(H5HF_sect_row_revive(hdr, dxpl_id, sect2) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - + else /* Merge rows' underlying indirect sections together */ - if(H5HF_sect_indirect_merge_row(hdr, dxpl_id, (*sect1), sect2) < 0) + if(H5HF__sect_indirect_merge_row(hdr, (*sect1), sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMERGE, FAIL, "can't merge underlying indirect sections") - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_merge() */ +} /* H5HF__sect_row_merge() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_can_shrink + * Function: H5HF__sect_row_can_shrink * * Purpose: Can this section shrink the container? * @@ -1838,14 +1882,14 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) +H5HF__sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -1857,11 +1901,11 @@ H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_can_shrink() */ +} /* H5HF__sect_row_can_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_shrink + * Function: H5HF__sect_row_shrink * * Purpose: Shrink container with section * @@ -1875,16 +1919,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) +H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ - hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(sect); @@ -1895,7 +1938,7 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) top_indir_sect = H5HF_sect_indirect_top((*sect)->u.row.under); /* Shrink away underlying indirect section */ - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, top_indir_sect) < 0) + if(H5HF__sect_indirect_shrink(hdr, top_indir_sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't shrink underlying indirect section") /* Indicate that the section has been released */ @@ -1903,11 +1946,11 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_shrink() */ +} /* H5HF__sect_row_shrink() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_free_real + * Function: H5HF__sect_row_free_real * * Purpose: Free a 'row' section node * @@ -1921,11 +1964,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_free_real(H5HF_free_section_t *sect) +H5HF__sect_row_free_real(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); @@ -1935,11 +1978,11 @@ H5HF_sect_row_free_real(H5HF_free_section_t *sect) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_free_real() */ +} /* H5HF__sect_row_free_real() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_free + * Function: H5HF__sect_row_free * * Purpose: Free a 'row' section node * @@ -1953,12 +1996,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_free(H5FS_section_info_t *_sect) +H5HF__sect_row_free(H5FS_section_info_t *_sect) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Pointer to section to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(sect); HDassert(sect->u.row.under); @@ -1968,16 +2011,16 @@ H5HF_sect_row_free(H5FS_section_info_t *_sect) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't detach section node") /* Release the section */ - if(H5HF_sect_row_free_real(sect) < 0) + if(H5HF__sect_row_free_real(sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free section node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_row_free() */ +} /* H5HF__sect_row_free() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_valid + * Function: H5HF__sect_row_valid * * Purpose: Check the validity of a section * @@ -1990,8 +2033,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect, - hid_t H5_ATTR_UNUSED dxpl_id) +H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t *_sect) { H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ const H5HF_hdr_t *hdr; /* Fractal heap header */ @@ -1999,7 +2041,7 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * const H5HF_free_section_t *indir_sect; /* Pointer to underlying indirect section */ unsigned indir_idx; /* Index of row in underlying indirect section's row array */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Basic sanity check */ HDassert(cls); @@ -2035,11 +2077,11 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_row_valid() */ +} /* H5HF__sect_row_valid() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_row_debug + * Function: H5HF__sect_row_debug * * Purpose: Dump debugging information about an row free space section * @@ -2052,12 +2094,12 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_row_debug(const H5FS_section_info_t *_sect, +H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, int fwidth) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments. */ HDassert(sect); @@ -2083,7 +2125,7 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_sect_row_debug() */ +} /* H5HF__sect_row_debug() */ /*------------------------------------------------------------------------- @@ -2359,7 +2401,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_init_rows + * Function: H5HF__sect_indirect_init_rows * * Purpose: Initialize the derived row sections for a newly created * indirect section @@ -2373,8 +2415,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, hbool_t first_child, H5HF_free_section_t **first_row_sect, +H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + hbool_t first_child, H5HF_free_section_t **first_row_sect, unsigned space_flags, unsigned start_row, unsigned start_col, unsigned end_row, unsigned end_col) { @@ -2389,7 +2431,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2492,11 +2534,10 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Check to see if we should grab the first row section instead of adding it immediately */ if(first_row_sect) *first_row_sect = row_sect; - else { + else /* Add new row section to free space manager for the heap */ - if(H5HF_space_add(hdr, dxpl_id, row_sect, space_flags) < 0) + if(H5HF__space_add(hdr, row_sect, space_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add row section to free space") - } /* end else */ /* Increment reference count for underlying indirect section */ sect->u.indirect.rc++; @@ -2536,7 +2577,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* If the child indirect block's address is defined, protect it */ if(H5F_addr_defined(child_iblock_addr)) { - if(NULL == (child_iblock = H5HF_man_iblock_protect(hdr, dxpl_id, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) + if(NULL == (child_iblock = H5HF__man_iblock_protect(hdr, child_iblock_addr, child_nrows, sect->u.indirect.u.iblock, curr_entry, FALSE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") } /* end if */ else @@ -2551,7 +2592,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, child_sect, + if(H5HF__sect_indirect_init_rows(hdr, child_sect, first_child, first_row_sect, space_flags, 0, 0, (child_nrows - 1), (hdr->man_dtable.cparam.width - 1)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section") @@ -2559,7 +2600,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, /* If we have a valid child indirect block, release it now */ /* (will be pinned, if rows reference it) */ if(child_iblock) - if(H5HF_man_iblock_unprotect(child_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) + if(H5HF__man_iblock_unprotect(child_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") /* Attach child section to this section */ @@ -2607,11 +2648,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_init_rows() */ +} /* end H5HF__sect_indirect_init_rows() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_add + * Function: H5HF__sect_indirect_add * * Purpose: Add a new 'indirect' section to the free space manager for this * heap @@ -2625,8 +2666,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_indirect_t *iblock, unsigned start_entry, unsigned nentries) +H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, + unsigned start_entry, unsigned nentries) { H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *first_row_sect = NULL; /* First row section in new indirect section */ @@ -2639,7 +2680,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -2669,7 +2710,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, sect, TRUE, &first_row_sect, + if(H5HF__sect_indirect_init_rows(hdr, sect, TRUE, &first_row_sect, H5FS_ADD_SKIP_VALID, start_row, start_col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section") HDassert(first_row_sect); @@ -2677,7 +2718,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Now that underlying indirect section is consistent, add first row * section to free space manager for the heap */ - if(H5HF_space_add(hdr, dxpl_id, first_row_sect, H5FS_ADD_RETURNED_SPACE) < 0) + if(H5HF__space_add(hdr, first_row_sect, H5FS_ADD_RETURNED_SPACE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't add row section to free space") done: @@ -2686,7 +2727,7 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_add() */ +} /* end H5HF__sect_indirect_add() */ /*------------------------------------------------------------------------- @@ -2741,7 +2782,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_revive_row + * Function: H5HF__sect_indirect_revive_row * * Purpose: Update the memory information for a 'indirect' free section * @@ -2754,14 +2795,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { H5HF_indirect_t *sec_iblock; /* Pointer to section indirect block */ hbool_t did_protect; /* Whether we protected the indirect block or not */ - unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2771,44 +2811,24 @@ H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); /* Look up indirect block containing indirect blocks for section */ - if(H5HF_man_dblock_locate(hdr, dxpl_id, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC__READ_ONLY_FLAG) < 0) + if(H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, H5AC__READ_ONLY_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of section") - /* Increment reference count on indirect block that free section is in */ - if(H5HF_iblock_incr(sec_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared indirect block") - - /* Set the pointer to the section's indirect block */ - sect->u.indirect.u.iblock = sec_iblock; - - /* Set the number of entries in the indirect block */ - sect->u.indirect.iblock_entries = hdr->man_dtable.cparam.width * - sect->u.indirect.u.iblock->max_rows; + /* Review the section */ + if(H5HF__sect_indirect_revive(hdr, sect, sec_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") +done: /* Unlock indirect block */ - if(H5HF_man_iblock_unprotect(sec_iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") - sec_iblock = NULL; - - /* Section is "live" now */ - sect->sect_info.state = H5FS_SECT_LIVE; - - /* Loop over derived row sections and mark them all as 'live' now */ - for(u = 0; u < sect->u.indirect.dir_nrows; u++) - sect->u.indirect.dir_rows[u]->sect_info.state = H5FS_SECT_LIVE; - - /* Revive parent indirect section, if there is one */ - if(sect->u.indirect.parent && sect->u.indirect.parent->sect_info.state == H5FS_SECT_SERIALIZED) - if(H5HF_sect_indirect_revive(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") + if(sec_iblock && H5HF__man_iblock_unprotect(sec_iblock, H5AC__NO_FLAGS_SET, did_protect) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") -done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_revive_row() */ +} /* end H5HF__sect_indirect_revive_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_revive + * Function: H5HF__sect_indirect_revive * * Purpose: Update the memory information for a 'indirect' free section * @@ -2821,13 +2841,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, H5HF_indirect_t *sect_iblock) +H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + H5HF_indirect_t *sect_iblock) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2857,16 +2877,16 @@ H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, /* Revive parent indirect section, if there is one */ if(sect->u.indirect.parent && sect->u.indirect.parent->sect_info.state == H5FS_SECT_SERIALIZED) - if(H5HF_sect_indirect_revive(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) + if(H5HF__sect_indirect_revive(hdr, sect->u.indirect.parent, sect->u.indirect.u.iblock->parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_revive() */ +} /* end H5HF__sect_indirect_revive() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_reduce_row + * Function: H5HF__sect_indirect_reduce_row * * Purpose: Remove a block from an indirect section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -2881,7 +2901,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *row_sect, +H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, hbool_t *alloc_from_start) { H5HF_free_section_t *sect; /* Indirect section underlying row section */ @@ -2896,7 +2916,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2941,14 +2961,14 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ is_first = H5HF_sect_indirect_is_first(sect); /* Remove this indirect section from parent indirect section */ - if(H5HF_sect_indirect_reduce(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) + if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce parent indirect section") sect->u.indirect.parent = NULL; sect->u.indirect.par_entry = 0; /* If we weren't the first section, set "first row" for this indirect section */ if(!is_first) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect) < 0) + if(H5HF__sect_indirect_first(hdr, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ @@ -2983,7 +3003,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ /* Make new "first row" in indirect section */ if(row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) - if(H5HF_sect_row_first(hdr, dxpl_id, sect->u.indirect.dir_rows[0]) < 0) + if(H5HF__sect_row_first(hdr, sect->u.indirect.dir_rows[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ else { @@ -2996,7 +3016,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ /* Make new "first row" in indirect section */ if(row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for child indirect section") } /* end else */ } /* end if */ @@ -3133,11 +3153,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_reduce_row() */ +} /* end H5HF__sect_indirect_reduce_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_reduce + * Function: H5HF__sect_indirect_reduce * * Purpose: Reduce the size of a indirect section (possibly freeing it) * and re-add it back to the free space manager for the heap @@ -3152,7 +3172,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, +H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned child_entry) { unsigned start_entry; /* Entry for first block covered */ @@ -3163,7 +3183,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -3190,14 +3210,14 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s is_first = H5HF_sect_indirect_is_first(sect); /* Reduce parent indirect section */ - if(H5HF_sect_indirect_reduce(hdr, dxpl_id, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) + if(H5HF__sect_indirect_reduce(hdr, sect->u.indirect.parent, sect->u.indirect.par_entry) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't reduce parent indirect section") sect->u.indirect.parent = NULL; sect->u.indirect.par_entry = 0; /* If we weren't the first section, set "first row" for this indirect section */ if(!is_first) - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect) < 0) + if(H5HF__sect_indirect_first(hdr, sect) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for indirect section") } /* end if */ @@ -3229,7 +3249,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s HDassert(sect->u.indirect.indir_ents[0]); /* Make new "first row" in new first indirect child section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for child indirect section") } /* end if */ else if(child_entry == end_entry) { @@ -3335,7 +3355,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); /* Make new "first row" in peer section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, peer_sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, peer_sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't make new 'first row' for peer indirect section") /* Reset the peer_sect variable, to indicate that it has been hooked into the data structures correctly and shouldn't be freed */ @@ -3369,7 +3389,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_reduce() */ +} /* end H5HF__sect_indirect_reduce() */ /*------------------------------------------------------------------------- @@ -3408,7 +3428,7 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_first + * Function: H5HF__sect_indirect_first * * Purpose: Make new 'first row' for indirect section * @@ -3421,11 +3441,11 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(hdr); @@ -3440,7 +3460,7 @@ H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *se HDassert(sect->u.indirect.dir_rows[0]); /* Change first row section in indirect section to be the "first row" */ - if(H5HF_sect_row_first(hdr, dxpl_id, sect->u.indirect.dir_rows[0]) < 0) + if(H5HF__sect_row_first(hdr, sect->u.indirect.dir_rows[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set row section to be first row") } /* end if */ else { @@ -3450,13 +3470,13 @@ H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *se HDassert(sect->u.indirect.indir_ents[0]); /* Forward to first child indirect section */ - if(H5HF_sect_indirect_first(hdr, dxpl_id, sect->u.indirect.indir_ents[0]) < 0) + if(H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set child indirect section to be first row") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_first() */ +} /* end H5HF__sect_indirect_first() */ /*------------------------------------------------------------------------- @@ -3489,7 +3509,7 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_merge_row + * Function: H5HF__sect_indirect_merge_row * * Purpose: Merge two sections of this type * @@ -3505,8 +3525,8 @@ H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *row_sect1, H5HF_free_section_t *row_sect2) +H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, + H5HF_free_section_t *row_sect2) { H5HF_free_section_t *sect1, *sect2; /* Indirect sections underlying row sections */ unsigned start_entry1; /* Start entry for section #1 */ @@ -3518,16 +3538,14 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); HDassert(row_sect1); HDassert(row_sect1->u.row.under); - HDassert(row_sect1->sect_info.state == H5FS_SECT_LIVE); HDassert(row_sect2); HDassert(row_sect2->u.row.under); - HDassert(row_sect2->sect_info.state == H5FS_SECT_LIVE); HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ @@ -3537,13 +3555,8 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, HDassert(sect2); /* Sanity check some assumptions about the indirect sections */ - HDassert(sect1->sect_info.state == H5FS_SECT_LIVE); HDassert(sect1->u.indirect.span_size > 0); - HDassert(sect1->u.indirect.iblock_entries > 0); - HDassert(sect2->sect_info.state == H5FS_SECT_LIVE); HDassert(sect2->u.indirect.span_size > 0); - HDassert(sect2->u.indirect.iblock_entries > 0); - HDassert(sect1->u.indirect.iblock_entries == sect2->u.indirect.iblock_entries); /* Set up span information */ start_row1 = sect1->u.indirect.row; @@ -3558,6 +3571,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, * row, and thus have no row sections of it's own) */ if(sect2->u.indirect.dir_nrows > 0) { + hsize_t sect1_iblock_off, sect2_iblock_off; /* Offset of indirect block underlying row section */ unsigned new_dir_nrows1; /* New value for number of direct rows in first section */ unsigned src_row2; /* Source row for copying from second section */ unsigned nrows_moved2; /* Number of rows to move from second section to first */ @@ -3571,9 +3585,18 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, HDassert(sect1->u.indirect.dir_nrows > 0); HDassert(sect1->u.indirect.dir_rows); + /* Get the offsets for the indirect blocks under the rows */ + if(H5FS_SECT_LIVE == row_sect1->u.row.under->sect_info.state) + sect1_iblock_off = row_sect1->u.row.under->u.indirect.u.iblock->block_off; + else + sect1_iblock_off = row_sect1->u.row.under->u.indirect.u.iblock_off; + if(H5FS_SECT_LIVE == row_sect2->u.row.under->sect_info.state) + sect2_iblock_off = row_sect2->u.row.under->u.indirect.u.iblock->block_off; + else + sect2_iblock_off = row_sect2->u.row.under->u.indirect.u.iblock_off; + /* Check for sections sharing a row in the same underlying indirect block */ - if(row_sect1->u.row.under->u.indirect.u.iblock->block_off == row_sect2->u.row.under->u.indirect.u.iblock->block_off - && end_row1 == start_row2) { + if(sect1_iblock_off == sect2_iblock_off && end_row1 == start_row2) { H5HF_free_section_t *last_row_sect1; /* Last row in first indirect section */ /* Locate the last row section in first indirect section, if we don't already have it */ @@ -3689,14 +3712,14 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, (sect1->u.indirect.indir_nents + sect1->u.indirect.dir_nrows)); /* Wrap up, freeing or re-inserting second row section */ - /* (want this to be after the first indirection section is consistent again) */ + /* (want this to be after the first indirect section is consistent again) */ if(merged_rows) { /* Release second row section */ /* (indirectly releases second indirect section, since all of it's * other dependents are gone) */ HDassert(sect2->u.indirect.rc == 1); - if(H5HF_sect_row_free((H5FS_section_info_t *)row_sect2) < 0) + if(H5HF__sect_row_free((H5FS_section_info_t *)row_sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free row section") } /* end if */ else { @@ -3715,7 +3738,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, * from the free space manager and needs to be re-added) */ row_sect2->sect_info.type = H5HF_FSPACE_SECT_NORMAL_ROW; - if(H5HF_space_add(hdr, dxpl_id, row_sect2, H5FS_ADD_SKIP_VALID) < 0) + if(H5HF__space_add(hdr, row_sect2, H5FS_ADD_SKIP_VALID) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't re-add second row section to free space") } /* end else */ @@ -3724,17 +3747,17 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, if(sect1->u.indirect.iblock_entries == sect1->u.indirect.num_entries) { /* Build parent section for fully populated indirect section */ HDassert(sect1->u.indirect.parent == NULL); - if(H5HF_sect_indirect_build_parent(hdr, sect1) < 0) + if(H5HF__sect_indirect_build_parent(hdr, sect1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create parent for full indirect section") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_merge_row() */ +} /* end H5HF__sect_indirect_merge_row() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_build_parent + * Function: H5HF__sect_indirect_build_parent * * Purpose: Build a parent indirect section for a full indirect section * @@ -3747,19 +3770,21 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) +H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { H5HF_indirect_t *par_iblock; /* Indirect block for parent section */ H5HF_free_section_t *par_sect = NULL; /* Parent indirect section */ + hsize_t par_block_off; /* Offset of parent's block */ unsigned par_row, par_col; /* Row & column in parent indirect section */ unsigned par_entry; /* Entry within parent indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); HDassert(sect); + HDassert(H5FS_SECT_LIVE == sect->sect_info.state); HDassert(sect->u.indirect.span_size > 0); HDassert(sect->u.indirect.iblock_entries > 0); HDassert(sect->u.indirect.iblock_entries == sect->u.indirect.num_entries); @@ -3767,16 +3792,26 @@ H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) HDassert(sect->u.indirect.parent == NULL); /* Get information for creating parent indirect section */ - par_entry = sect->u.indirect.u.iblock->par_entry; + if(sect->u.indirect.u.iblock->parent) { + par_entry = sect->u.indirect.u.iblock->par_entry; + par_iblock = sect->u.indirect.u.iblock->parent; + par_block_off = par_iblock->block_off; + } /* end if */ + else { + /* Retrieve the information for the parent block */ + if(H5HF__man_iblock_parent_info(hdr, sect->sect_info.addr, &par_block_off, &par_entry) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get block entry") + par_iblock = NULL; + } /* end else */ + + /* Compute row & column for block in parent */ par_row = par_entry / hdr->man_dtable.cparam.width; par_col = par_entry % hdr->man_dtable.cparam.width; HDassert(par_row >= hdr->man_dtable.max_direct_rows); - par_iblock = sect->u.indirect.u.iblock->parent; - HDassert(par_iblock); /* Create parent indirect section */ if(NULL == (par_sect = H5HF_sect_indirect_new(hdr, sect->sect_info.addr, - sect->sect_info.size, par_iblock, par_iblock->block_off, + sect->sect_info.size, par_iblock, par_block_off, par_row, par_col, 1))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't create indirect section") @@ -3801,11 +3836,11 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_build_parent() */ +} /* end H5HF__sect_indirect_build_parent() */ /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_shrink + * Function: H5HF__sect_indirect_shrink * * Purpose: "Shrink" container w/section * @@ -3818,12 +3853,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) +H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check parameters */ HDassert(hdr); @@ -3837,18 +3872,18 @@ H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s /* Remove the normal rows from free space manager */ if(sect->u.indirect.dir_rows[u]->sect_info.type != H5HF_FSPACE_SECT_FIRST_ROW) { HDassert(sect->u.indirect.dir_rows[u]->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); - if(H5HF_space_remove(hdr, dxpl_id, sect->u.indirect.dir_rows[u]) < 0) + if(H5HF__space_remove(hdr, sect->u.indirect.dir_rows[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove section from heap free space") } /* end if */ /* Release the row section */ - if(H5HF_sect_row_free_real(sect->u.indirect.dir_rows[u]) < 0) + if(H5HF__sect_row_free_real(sect->u.indirect.dir_rows[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") } /* end for */ /* Walk through indirect entries, freeing them (recursively) */ for(u = 0; u < sect->u.indirect.indir_nents; u++) - if(H5HF_sect_indirect_shrink(hdr, dxpl_id, sect->u.indirect.indir_ents[u]) < 0) + if(H5HF__sect_indirect_shrink(hdr, sect->u.indirect.indir_ents[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free child section node") /* Free the indirect section itself */ @@ -3857,7 +3892,7 @@ H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_sect_indirect_shrink() */ +} /* end H5HF__sect_indirect_shrink() */ /*------------------------------------------------------------------------- @@ -3918,12 +3953,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_sect_indirect_deserialize + * Function: H5HF__sect_indirect_deserialize * * Purpose: Deserialize a buffer into a "live" indirect section * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol @@ -3932,9 +3966,8 @@ done: *------------------------------------------------------------------------- */ static H5FS_section_info_t * -H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, - const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags) +H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, + haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags) { H5HF_free_section_t *new_sect; /* New indirect section */ hsize_t iblock_off; /* Indirect block's offset */ @@ -3947,7 +3980,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned end_col; /* End column in indirect block */ H5FS_section_info_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments. */ HDassert(hdr); @@ -3981,7 +4014,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, end_col = end_entry % hdr->man_dtable.cparam.width; /* Initialize rows for new indirect section */ - if(H5HF_sect_indirect_init_rows(hdr, dxpl_id, new_sect, TRUE, NULL, + if(H5HF__sect_indirect_init_rows(hdr, new_sect, TRUE, NULL, H5FS_ADD_DESERIALIZING, new_sect->u.indirect.row, new_sect->u.indirect.col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize indirect section") @@ -3994,7 +4027,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_sect_indirect_deserialize() */ +} /* H5HF__sect_indirect_deserialize() */ /*------------------------------------------------------------------------- diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 41954fc..5d659a6 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -78,7 +78,7 @@ /*------------------------------------------------------------------------- - * Function: H5HF_space_start + * Function: H5HF__space_start * * Purpose: "Start up" free space for heap - open existing free space * structure if one exists, otherwise create a new free space @@ -92,15 +92,10 @@ * koziol@ncsa.uiuc.edu * May 2 2006 * - * Modifications: - * Vailin Choi, July 29th, 2008 - * Pass values of alignment and threshold to FS_create() and FS_open() - * for handling alignment. - * *------------------------------------------------------------------------- */ herr_t -H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) +H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for fractal heap */ H5HF_FSPACE_SECT_CLS_SINGLE, @@ -109,7 +104,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) H5HF_FSPACE_SECT_CLS_INDIRECT}; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -119,7 +114,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) /* Check for creating free space info for the heap */ if(H5F_addr_defined(hdr->fs_addr)) { /* Open an existing free space structure for the heap */ - if(NULL == (hdr->fspace = H5FS_open(hdr->f, dxpl_id, hdr->fs_addr, + if(NULL == (hdr->fspace = H5FS_open(hdr->f, hdr->fs_addr, NELMTS(classes), classes, hdr, (hsize_t)H5HF_FSPACE_THRHD_DEF, (hsize_t)H5HF_FSPACE_ALIGN_DEF))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize free space info") } /* end if */ @@ -136,7 +131,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) fs_create.max_sect_addr = hdr->man_dtable.cparam.max_index; /* Create the free space structure for the heap */ - if(NULL == (hdr->fspace = H5FS_create(hdr->f, dxpl_id, &hdr->fs_addr, + if(NULL == (hdr->fspace = H5FS_create(hdr->f, &hdr->fs_addr, &fs_create, NELMTS(classes), classes, hdr, (hsize_t)H5HF_FSPACE_THRHD_DEF, (hsize_t)H5HF_FSPACE_ALIGN_DEF))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize free space info") HDassert(H5F_addr_defined(hdr->fs_addr)); @@ -145,11 +140,11 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_start() */ +} /* end H5HF__space_start() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_add + * Function: H5HF__space_add * * Purpose: Add a section to the free space for the heap * @@ -164,13 +159,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, - unsigned flags) +H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags) { H5HF_sect_add_ud_t udata; /* User data for free space manager 'add' */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -180,29 +174,27 @@ H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, TRUE) < 0) + if(H5HF__space_start(hdr, TRUE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Construct user data */ udata.hdr = hdr; - udata.dxpl_id = dxpl_id; /* Add to the free space for the heap */ - if(H5FS_sect_add(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata) < 0) + if(H5FS_sect_add(hdr->f, hdr->fspace, (H5FS_section_info_t *)node, flags, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINSERT, FAIL, "can't add section to heap free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_add() */ +} /* end H5HF__space_add() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_find + * Function: H5HF__space_find * * Purpose: Attempt to find space in a fractal heap * * Return: Success: non-negative - * * Failure: negative * * Programmer: Quincey Koziol @@ -212,12 +204,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_section_t **node) +H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node) { htri_t node_found = FALSE; /* Whether an existing free list node was found */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -228,12 +220,12 @@ H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_secti /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Search for free space in the heap */ if(hdr->fspace) - if((node_found = H5FS_sect_find(hdr->f, dxpl_id, hdr->fspace, request, (H5FS_section_info_t **)node)) < 0) + if((node_found = H5FS_sect_find(hdr->f, hdr->fspace, request, (H5FS_section_info_t **)node)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't locate free space in fractal heap") /* Set return value */ @@ -241,7 +233,7 @@ H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_secti done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_find() */ +} /* end H5HF__space_find() */ /*------------------------------------------------------------------------- @@ -277,7 +269,7 @@ H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_udat if(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE && sect->sect_info.state == H5FS_SECT_LIVE) { /* Release hold on previous indirect block (we must have one) */ HDassert(sect->u.single.parent); - if(H5HF_iblock_decr(sect->u.single.parent) < 0) + if(H5HF__iblock_decr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") /* Reset parent information */ @@ -291,7 +283,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_revert_root + * Function: H5HF__space_revert_root * * Purpose: Reset 'parent' pointers in sections, when the heap is * changing from having a root indirect block to a direct block. @@ -306,11 +298,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_revert_root(const H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -318,15 +310,14 @@ H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(hdr); /* Only need to scan the sections if the free space has been initialized */ - if(hdr->fspace) { + if(hdr->fspace) /* Iterate over all sections, reseting the parent pointers in 'single' sections */ - if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_revert_root() */ +} /* end H5HF__space_revert_root() */ /*------------------------------------------------------------------------- @@ -383,7 +374,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_space_create_root + * Function: H5HF__space_create_root * * Purpose: Set 'parent' pointers in sections to new indirect block, when * the heap is changing from having a root direct block to a @@ -399,11 +390,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *root_iblock) +H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -412,19 +403,18 @@ H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *ro HDassert(root_iblock); /* Only need to scan the sections if the free space has been initialized */ - if(hdr->fspace) { + if(hdr->fspace) /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */ - if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + if(H5FS_sect_iterate(hdr->f, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_create_root() */ +} /* end H5HF__space_create_root() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_size + * Function: H5HF__space_size * * Purpose: Query the size of the heap's free space info on disk * @@ -438,11 +428,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) +H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -452,7 +442,7 @@ H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) /* Check if the free space for the heap has been initialized */ if(!hdr->fspace) - if(H5HF_space_start(hdr, dxpl_id, FALSE) < 0) + if(H5HF__space_start(hdr, FALSE) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize heap free space") /* Get free space metadata size */ @@ -465,11 +455,11 @@ H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_size() */ +} /* end H5HF__space_size() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_remove + * Function: H5HF__space_remove * * Purpose: Remove a section from the free space for the heap * @@ -483,11 +473,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node) +H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -497,16 +487,16 @@ H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node) HDassert(node); /* Remove from the free space for the heap */ - if(H5FS_sect_remove(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)node) < 0) + if(H5FS_sect_remove(hdr->f, hdr->fspace, (H5FS_section_info_t *)node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove section from heap free space") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_remove() */ +} /* end H5HF__space_remove() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_close + * Function: H5HF__space_close * * Purpose: Close the free space for the heap * @@ -521,11 +511,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_close(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -544,13 +534,13 @@ HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); #endif /* QAK */ /* Close the free space for the heap */ - if(H5FS_close(hdr->f, dxpl_id, hdr->fspace) < 0) + if(H5FS_close(hdr->f, hdr->fspace) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") hdr->fspace = NULL; /* Check if we can delete the free space manager for this heap */ if(!nsects) { - if(H5FS_delete(hdr->f, dxpl_id, hdr->fs_addr) < 0) + if(H5FS_delete(hdr->f, hdr->fs_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDELETE, FAIL, "can't delete free space info") hdr->fs_addr = HADDR_UNDEF; } /* end if */ @@ -558,11 +548,11 @@ HDfprintf(stderr, "%s: nsects = %Hu\n", FUNC, nsects); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_close() */ +} /* end H5HF__space_close() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_delete + * Function: H5HF__space_delete * * Purpose: Delete the free space manager for the heap * @@ -576,11 +566,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) +H5HF__space_delete(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -588,16 +578,16 @@ H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) HDassert(hdr); /* Delete the free space manager */ - if(H5FS_delete(hdr->f, dxpl_id, hdr->fs_addr) < 0) + if(H5FS_delete(hdr->f, hdr->fs_addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "can't delete to free space manager") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_delete() */ +} /* end H5HF__space_delete() */ /*------------------------------------------------------------------------- - * Function: H5HF_space_change_sect_class + * Function: H5HF__space_sect_change_class * * Purpose: Change a section's class * @@ -612,11 +602,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, uint16_t new_class) +H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, + uint16_t new_class) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ @@ -629,10 +620,10 @@ HDfprintf(stderr, "%s: Called\n", FUNC); HDassert(sect); /* Notify the free space manager that a section has changed class */ - if(H5FS_sect_change_class(hdr->f, dxpl_id, hdr->fspace, (H5FS_section_info_t *)sect, new_class) < 0) + if(H5FS_sect_change_class(hdr->f, hdr->fspace, (H5FS_section_info_t *)sect, new_class) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, FAIL, "can't modify class of free space section") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_space_sect_change_class() */ +} /* end H5HF__space_sect_change_class() */ diff --git a/src/H5HFstat.c b/src/H5HFstat.c index e38a9b1..7d18ba6 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -123,7 +123,7 @@ H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats) *------------------------------------------------------------------------- */ herr_t -H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) +H5HF_size(const H5HF_t *fh, hsize_t *heap_size) { H5HF_hdr_t *hdr; /* Fractal heap header */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ @@ -148,30 +148,30 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) /* Check for indirect blocks for managed objects */ if(H5F_addr_defined(hdr->man_dtable.table_addr) && hdr->man_dtable.curr_root_rows != 0) - if(H5HF_man_iblock_size(hdr->f, dxpl_id, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0) + if(H5HF__man_iblock_size(hdr->f, hdr, hdr->man_dtable.table_addr, hdr->man_dtable.curr_root_rows, NULL, 0, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to get fractal heap storage info for indirect block") /* Check for B-tree storage of huge objects in fractal heap */ if(H5F_addr_defined(hdr->huge_bt2_addr)) { /* Open the huge object index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + if(NULL == (bt2 = H5B2_open(hdr->f, hdr->huge_bt2_addr, hdr->f))) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' objects") /* Get the B-tree storage */ - if(H5B2_size(bt2, dxpl_id, heap_size) < 0) + if(H5B2_size(bt2, heap_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Get storage for free-space tracking info */ if(H5F_addr_defined(hdr->fs_addr)) { - if(H5HF_space_size(hdr, dxpl_id, &meta_size) < 0) + if(H5HF__space_size(hdr, &meta_size) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info") *heap_size += meta_size; } /* end if */ done: /* Release resources */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for tracking 'huge' objects") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HG.c b/src/H5HG.c index 893be80..53f1b2a 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -82,7 +82,7 @@ /* Local Prototypes */ /********************/ -static haddr_t H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size); +static haddr_t H5HG__create(H5F_t *f, size_t size); /*********************/ @@ -114,7 +114,7 @@ H5FL_BLK_DEFINE(gheap_chunk); /*------------------------------------------------------------------------- - * Function: H5HG_create + * Function: H5HG__create * * Purpose: Creates a global heap collection of the specified size. If * SIZE is less than some minimum it will be readjusted. The @@ -133,7 +133,7 @@ H5FL_BLK_DEFINE(gheap_chunk); *------------------------------------------------------------------------- */ static haddr_t -H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) +H5HG__create(H5F_t *f, size_t size) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL; @@ -141,7 +141,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) size_t n; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__GLOBALHEAP_TAG) /* Check args */ HDassert(f); @@ -151,7 +151,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) /* Create it */ H5_CHECK_OVERFLOW(size, size_t, hsize_t); - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, dxpl_id, (hsize_t)size))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, (hsize_t)size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap") if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") @@ -207,7 +207,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to add global heap collection to file's CWFS") /* Add the heap to the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to cache global heap collection") ret_value = addr; @@ -217,7 +217,7 @@ done: if(!H5F_addr_defined(ret_value)) { if(H5F_addr_defined(addr)) { /* Release the space on disk */ - if(H5MF_xfree(f, H5FD_MEM_GHEAP, dxpl_id, addr, (hsize_t)size) < 0) + if(H5MF_xfree(f, H5FD_MEM_GHEAP, addr, (hsize_t)size) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, HADDR_UNDEF, "unable to free global heap") /* Check if the heap object was allocated */ @@ -228,12 +228,12 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF); -} /* H5HG_create() */ + FUNC_LEAVE_NOAPI_TAG(ret_value); +} /* H5HG__create() */ /*------------------------------------------------------------------------- - * Function: H5HG_protect + * Function: H5HG__protect * * Purpose: Convenience wrapper around H5AC_protect on an indirect block * @@ -245,12 +245,12 @@ done: *------------------------------------------------------------------------- */ H5HG_heap_t * -H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) +H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags) { H5HG_heap_t *heap; /* Global heap */ H5HG_heap_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(f); @@ -260,7 +260,7 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Lock the heap into memory */ - if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, f, flags))) + if(NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, H5AC_GHEAP, addr, f, flags))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") /* Set the heap's address */ @@ -271,7 +271,7 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_protect() */ +} /* H5HG__protect() */ /*------------------------------------------------------------------------- @@ -412,20 +412,10 @@ done: * Programmer: Quincey Koziol * Saturday, June 12, 2004 * - * Modifications: - * - * John Mainzer, 6/8/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * - * In this case, that required adding the new heap_dirtied_ptr - * parameter to the function's argument list. - * *------------------------------------------------------------------------- */ herr_t -H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) +H5HG_extend(H5F_t *f, haddr_t addr, size_t need) { H5HG_heap_t *heap = NULL; /* Pointer to heap to extend */ unsigned heap_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotecting heap */ @@ -442,7 +432,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) HDassert(H5F_addr_defined(addr)); /* Protect the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Re-allocate the heap information in memory */ @@ -485,7 +475,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) heap_flags |= H5AC__DIRTIED_FLAG; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap") FUNC_LEAVE_NOAPI(ret_value) @@ -515,7 +505,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/) +H5HG_insert(H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/) { size_t need; /*total space needed for object */ size_t idx; @@ -524,7 +514,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ unsigned heap_flags = H5AC__NO_FLAGS_SET; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -539,7 +529,7 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ /* Look for a heap in the file's CWFS that has enough space for the object */ addr = HADDR_UNDEF; - if(H5F_cwfs_find_free_heap(f, dxpl_id, need, &addr) < 0) + if(H5F_cwfs_find_free_heap(f, need, &addr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "error trying to locate heap") /* @@ -547,14 +537,14 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ * new collection large enough for the message plus the collection header. */ if(!H5F_addr_defined(addr)) { - addr = H5HG_create(f, dxpl_id, need + H5HG_SIZEOF_HDR(f)); + addr = H5HG__create(f, need + H5HG_SIZEOF_HDR(f)); if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to allocate a global heap collection") } /* end if */ HDassert(H5F_addr_defined(addr)); - if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") /* Split the free space to make room for the new object */ @@ -577,10 +567,10 @@ H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/ hobj->idx = idx; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, heap->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to unprotect heap.") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5HG_insert() */ @@ -602,8 +592,7 @@ done: *------------------------------------------------------------------------- */ void * -H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, - size_t *buf_size) +H5HG_read(H5F_t *f, H5HG_t *hobj, void *object/*out*/, size_t *buf_size) { H5HG_heap_t *heap = NULL; /* Pointer to global heap object */ size_t size; /* Size of the heap object */ @@ -611,14 +600,14 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, void *orig_object = object; /* Keep a copy of the original object pointer */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, NULL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, NULL) /* Check args */ HDassert(f); HDassert(hobj); /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -648,13 +637,13 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, ret_value = object; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, NULL, "unable to release object header") if(NULL == ret_value && NULL == orig_object && object) H5MM_free(object); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_read() */ @@ -677,13 +666,13 @@ done: *------------------------------------------------------------------------- */ int -H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) +H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust) { H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -692,7 +681,7 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") if(adjust != 0) { @@ -710,10 +699,10 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) ret_value = heap->obj[hobj->idx].nrefs; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, heap_flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_link() */ @@ -731,12 +720,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) +H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size) { H5HG_heap_t *heap = NULL; /* Pointer to global heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -744,7 +733,7 @@ H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) HDassert(obj_size); /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -754,10 +743,10 @@ H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size) *obj_size = heap->obj[hobj->idx].size; done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5HG_get_obj_size() */ @@ -771,17 +760,10 @@ done: * Programmer: Robb Matzke * Monday, March 30, 1998 * - * Modifications: - * - * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of - * H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t -H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) +H5HG_remove (H5F_t *f, H5HG_t *hobj) { H5HG_heap_t *heap = NULL; uint8_t *p = NULL, *obj_start = NULL; @@ -790,7 +772,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned flags = H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL); + FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); @@ -799,7 +781,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ - if(NULL == (heap = H5HG_protect(f, dxpl_id, hobj->addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") HDassert(hobj->idx < heap->nused); @@ -849,10 +831,10 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) } /* end else */ done: - if(heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) < 0) + if(heap && H5AC_unprotect(f, H5AC_GHEAP, hobj->addr, heap, flags) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL); + FUNC_LEAVE_NOAPI_TAG(ret_value); } /* end H5HG_remove() */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 6dd94f5..a5e5363 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -83,8 +83,7 @@ *------------------------------------------------------------------------- */ herr_t -H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, - int fwidth) +H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { unsigned u, nused, maxobj; unsigned j, k; @@ -101,7 +100,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (h = H5HG__protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); @@ -169,7 +168,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } done: - if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) + if (h && H5AC_unprotect(f, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 47760bf..a735ba0 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -138,7 +138,7 @@ struct H5HG_heap_t { /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5HG_free(H5HG_heap_t *heap); -H5_DLL H5HG_heap_t *H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); +H5_DLL H5HG_heap_t *H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags); #endif /* _H5HGpkg_H */ diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index 19dcaa4..a7d7a80 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -54,15 +54,14 @@ typedef struct H5HG_heap_t H5HG_heap_t; /* Main global heap routines */ -H5_DLL herr_t H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, - H5HG_t *hobj/*out*/); -H5_DLL void *H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object, size_t *buf_size/*out*/); -H5_DLL int H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust); -H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, size_t *obj_size); -H5_DLL herr_t H5HG_remove(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj); +H5_DLL herr_t H5HG_insert(H5F_t *f, size_t size, void *obj, H5HG_t *hobj/*out*/); +H5_DLL void *H5HG_read(H5F_t *f, H5HG_t *hobj, void *object, size_t *buf_size/*out*/); +H5_DLL int H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust); +H5_DLL herr_t H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size); +H5_DLL herr_t H5HG_remove(H5F_t *f, H5HG_t *hobj); /* Support routines */ -H5_DLL herr_t H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need); +H5_DLL herr_t H5HG_extend(H5F_t *f, haddr_t addr, size_t need); /* Query routines */ H5_DLL haddr_t H5HG_get_addr(const H5HG_heap_t *h); @@ -70,7 +69,7 @@ H5_DLL size_t H5HG_get_size(const H5HG_heap_t *h); H5_DLL size_t H5HG_get_free_size(const H5HG_heap_t *h); /* Debugging functions */ -H5_DLL herr_t H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, +H5_DLL herr_t H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth); #endif /* _H5HGprivate_H */ diff --git a/src/H5HL.c b/src/H5HL.c index dd756f5..735077c 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -62,7 +62,7 @@ /********************/ static H5HL_free_t *H5HL__remove_free(H5HL_t *heap, H5HL_free_t *fl); -static herr_t H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap); +static herr_t H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap); static herr_t H5HL__dirty(H5HL_t *heap); @@ -110,7 +110,7 @@ H5FL_BLK_DEFINE(lheap_chunk); */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) +H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p/*out*/)) H5HL_t *heap = NULL; /* Heap created */ H5HL_prfx_t *prfx = NULL; /* Heap prefix */ @@ -131,7 +131,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) /* Allocate file space */ total_size = heap->prfx_size + size_hint; - if(HADDR_UNDEF == (heap->prfx_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, dxpl_id, total_size))) + if(HADDR_UNDEF == (heap->prfx_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, total_size))) H5E_THROW(H5E_CANTALLOC, "unable to allocate file memory"); /* Initialize info */ @@ -161,7 +161,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed"); /* Add to cache */ - if(FAIL == H5AC_insert_entry(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap prefix"); /* Set address to return */ @@ -177,7 +177,7 @@ CATCH else { if(heap) { if(H5F_addr_defined(heap->prfx_addr)) - if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, heap->prfx_addr, total_size)) + if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, heap->prfx_addr, total_size)) H5E_THROW(H5E_CANTFREE, "can't release heap data?"); if(FAIL == H5HL__dest(heap)) H5E_THROW(H5E_CANTFREE, "unable to destroy local heap"); @@ -203,7 +203,7 @@ END_FUNC(PRIV) /* end H5HL_create() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap)) +H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap)) size_t new_heap_size = heap->dblk_size; /* New size of heap */ @@ -297,7 +297,7 @@ H5HL__minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap)) H5E_THROW(H5E_CANTALLOC, "memory allocation failed"); /* Reallocate data block in file */ - if(FAIL == H5HL__dblk_realloc(f, dxpl_id, heap, new_heap_size)) + if(FAIL == H5HL__dblk_realloc(f, heap, new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed"); } /* end if */ @@ -322,7 +322,7 @@ END_FUNC(STATIC) /* H5HL__minimize_heap_space() */ */ BEGIN_FUNC(PRIV, ERR, H5HL_t *, NULL, NULL, -H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) +H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -345,7 +345,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -360,7 +360,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) prfx_cache_flags |= H5AC__PIN_ENTRY_FLAG; else { /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, flags))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block"); /* Set the flag for pinning the data block when unprotecting it */ @@ -376,11 +376,11 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags)) CATCH /* Release the prefix from the cache, now pinned */ - if(prfx && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0) + if(prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, prfx_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); /* Release the data block from the cache, now pinned */ - if(dblk && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0) + if(dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, dblk_cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block"); END_FUNC(PRIV) /* end H5HL_protect() */ @@ -547,7 +547,7 @@ END_FUNC(STATIC) /* end H5HL__dirty() */ */ BEGIN_FUNC(PRIV, ERR, size_t, UFAIL, UFAIL, -H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void *buf)) +H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf)) H5HL_free_t *fl = NULL, *last_fl = NULL; size_t offset = 0; @@ -635,7 +635,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * H5_CHECK_OVERFLOW(new_dblk_size, size_t, hsize_t); /* Extend current heap if possible */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_LHEAP, heap->dblk_addr, (hsize_t)(heap->dblk_size), (hsize_t)need_more); + was_extended = H5MF_try_extend(f, H5FD_MEM_LHEAP, heap->dblk_addr, (hsize_t)(heap->dblk_size), (hsize_t)need_more); if(FAIL == was_extended) H5E_THROW(H5E_CANTEXTEND, "error trying to extend heap"); @@ -658,7 +658,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * } /* end if */ else { /* ...if we can't, allocate a new chunk & release the old */ /* Reallocate data block in file */ - if(FAIL == H5HL__dblk_realloc(f, dxpl_id, heap, new_dblk_size)) + if(FAIL == H5HL__dblk_realloc(f, heap, new_dblk_size)) H5E_THROW(H5E_CANTRESIZE, "reallocating data block failed"); } /* end if */ @@ -761,7 +761,7 @@ END_FUNC(PRIV) /* H5HL_insert() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) +H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size)) H5HL_free_t *fl = NULL; @@ -809,7 +809,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) fl2 = H5HL__remove_free(heap, fl2); if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } H5_LEAVE(SUCCEED); @@ -818,7 +818,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) } if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } H5_LEAVE(SUCCEED); @@ -833,7 +833,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) fl2 = H5HL__remove_free(heap, fl2); if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } /* end if */ H5_LEAVE(SUCCEED); @@ -842,7 +842,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) } /* end while */ if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); } /* end if */ H5_LEAVE(SUCCEED); @@ -879,11 +879,9 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size)) heap->freelist->prev = fl; heap->freelist = fl; - if(((fl->offset + fl->size) == heap->dblk_size) && - ((2 * fl->size) > heap->dblk_size)) { - if(FAIL == H5HL__minimize_heap_space(f, dxpl_id, heap)) + if(((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) + if(FAIL == H5HL__minimize_heap_space(f, heap)) H5E_THROW(H5E_CANTFREE, "heap size minimization failed"); - } /* end if */ CATCH /* No special processing on exit */ @@ -905,7 +903,7 @@ END_FUNC(PRIV) /* end H5HL_remove() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) +H5HL_delete(H5F_t *f, haddr_t addr)) H5HL_t *heap = NULL; /* Local heap to delete */ H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ @@ -924,7 +922,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -933,7 +931,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) /* Check if heap has separate data block */ if(!heap->single_cache_obj) /* Protect the local heap data block */ - if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, H5AC__NO_FLAGS_SET))) + if(NULL == (dblk = (H5HL_dblk_t *)H5AC_protect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, heap, H5AC__NO_FLAGS_SET))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap data block"); /* Set the flags for releasing the prefix and data block */ @@ -941,11 +939,11 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr)) CATCH /* Release the data block from the cache, now deleted */ - if(dblk && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0) + if(dblk && heap && H5AC_unprotect(f, H5AC_LHEAP_DBLK, heap->dblk_addr, dblk, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap data block"); /* Release the prefix from the cache, now deleted */ - if(prfx && heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0) + if(prfx && heap && H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, cache_flags) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_delete() */ @@ -965,7 +963,7 @@ END_FUNC(PRIV) /* end H5HL_delete() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) +H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -983,7 +981,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -993,7 +991,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size)) *size = heap->dblk_size; CATCH - if(prfx && FAIL == H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_get_size() */ @@ -1014,7 +1012,7 @@ END_FUNC(PRIV) /* end H5HL_get_size() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) +H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size)) H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t *prfx = NULL; /* Local heap prefix */ @@ -1032,7 +1030,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); /* Protect the local heap prefix */ - if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load heap prefix"); /* Get the pointer to the heap */ @@ -1042,7 +1040,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)) *heap_size += (hsize_t)(heap->prfx_size + heap->dblk_size); CATCH - if(prfx && FAIL == H5AC_unprotect(f, dxpl_id, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) + if(prfx && FAIL == H5AC_unprotect(f, H5AC_LHEAP_PRFX, heap->prfx_addr, prfx, H5AC__NO_FLAGS_SET)) H5E_THROW(H5E_CANTUNPROTECT, "unable to release local heap prefix"); END_FUNC(PRIV) /* end H5HL_heapsize() */ diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 3533a39..e4e6fa8 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -47,7 +47,7 @@ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth)) +H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth)) H5HL_t *h = NULL; int free_block; @@ -62,7 +62,7 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int HDassert(indent >= 0); HDassert(fwidth >= 0); - if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (h = (H5HL_t *)H5HL_protect(f, addr, H5AC__READ_ONLY_FLAG))) H5E_THROW(H5E_CANTPROTECT, "unable to load/protect local heap"); HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 684d7f9..762a213 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -178,7 +178,7 @@ END_FUNC(PKG) /* end H5HL__dblk_dest() */ */ BEGIN_FUNC(PKG, ERR, herr_t, SUCCEED, FAIL, -H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) +H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size)) H5HL_dblk_t *dblk; /* Local heap data block */ haddr_t old_addr; /* Old location of heap data block */ @@ -193,12 +193,12 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) old_addr = heap->dblk_addr; old_heap_size = heap->dblk_size; H5_CHECK_OVERFLOW(old_heap_size, size_t, hsize_t); - if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, old_addr, (hsize_t)old_heap_size)) + if(FAIL == H5MF_xfree(f, H5FD_MEM_LHEAP, old_addr, (hsize_t)old_heap_size)) H5E_THROW(H5E_CANTFREE, "can't free old local heap data"); /* Allocate new space on disk */ H5_CHECK_OVERFLOW(new_heap_size, size_t, hsize_t); - if(HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, dxpl_id, (hsize_t)new_heap_size))) + if(HADDR_UNDEF == (new_addr = H5MF_alloc(f, H5FD_MEM_LHEAP, (hsize_t)new_heap_size))) H5E_THROW(H5E_CANTALLOC, "unable to allocate file space for local heap"); /* Update heap info*/ @@ -240,7 +240,7 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "unable to resize heap prefix in cache"); /* Insert data block into cache (pinned) */ - if(FAIL == H5AC_insert_entry(f, dxpl_id, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) + if(FAIL == H5AC_insert_entry(f, H5AC_LHEAP_DBLK, new_addr, dblk, H5AC__PIN_ENTRY_FLAG)) H5E_THROW(H5E_CANTINIT, "unable to cache local heap data block"); dblk = NULL; @@ -257,7 +257,7 @@ H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size)) H5E_THROW(H5E_CANTRESIZE, "unable to resize heap data block in cache"); /* Relocate the heap data block in the cache */ - if(FAIL == H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr, dxpl_id)) + if(FAIL == H5AC_move_entry(f, H5AC_LHEAP_DBLK, old_addr, new_addr)) H5E_THROW(H5E_CANTMOVE, "unable to move heap data block in cache"); } /* end else */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 770b7c0..44a2cfb 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -147,6 +147,6 @@ H5_DLL herr_t H5HL__prfx_dest(H5HL_prfx_t *prfx); /* Heap data block routines */ H5_DLL H5HL_dblk_t *H5HL__dblk_new(H5HL_t *heap); H5_DLL herr_t H5HL__dblk_dest(H5HL_dblk_t *dblk); -H5_DLL herr_t H5HL__dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size); +H5_DLL herr_t H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size); #endif /* _H5HLpkg_H */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 054d396..4001ef1 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -56,20 +56,18 @@ typedef struct H5HL_t H5HL_t; /* * Library prototypes */ -H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); -H5_DLL herr_t H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); -H5_DLL herr_t H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size); -H5_DLL herr_t H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size); -H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t size, - const void *buf); +H5_DLL herr_t H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr/*out*/); +H5_DLL herr_t H5HL_delete(H5F_t *f, haddr_t addr); +H5_DLL herr_t H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size); +H5_DLL herr_t H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size); +H5_DLL size_t H5HL_insert(H5F_t *f, H5HL_t *heap, size_t size, const void *buf); H5_DLL void *H5HL_offset_into(const H5HL_t *heap, size_t offset); -H5_DLL H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, unsigned flags); -H5_DLL herr_t H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, - size_t size); +H5_DLL H5HL_t *H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags); +H5_DLL herr_t H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size); H5_DLL herr_t H5HL_unprotect(H5HL_t *heap); /* Debugging routines for dumping file structures */ -H5_DLL herr_t H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5_DLL herr_t H5HL_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth); #endif diff --git a/src/H5I.c b/src/H5I.c index 99f944d..915c13c 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -30,8 +30,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Ipkg.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ @@ -126,6 +127,7 @@ static void *H5I__remove_common(H5I_id_type_t *type_ptr, hid_t id); static int H5I__inc_type_ref(H5I_type_t type); static int H5I__get_type_ref(H5I_type_t type); static H5I_id_info_t *H5I__find_id(hid_t id); +static ssize_t H5I__get_name(const H5G_loc_t *loc, char *name, size_t size); #ifdef H5I_DEBUG_OUTPUT static herr_t H5I__debug(H5I_type_t type); #endif /* H5I_DEBUG_OUTPUT */ @@ -1199,6 +1201,7 @@ done: int H5Idec_ref(hid_t id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = 0; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1207,12 +1210,18 @@ H5Idec_ref(hid_t id) /* Check arguments */ if(id < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_FILE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Idec_ref() */ @@ -2016,25 +2025,68 @@ ssize_t H5Iget_name(hid_t id, char *name/*out*/, size_t size) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", id, name, size); /* Get object location */ - if (H5G_loc(id, &loc) < 0) + if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") - /* Call internal group routine to retrieve object's name */ - if ((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call internal routine to retrieve object's name */ + if((ret_value = H5I__get_name(&loc, name, size)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Iget_name() */ /*------------------------------------------------------------------------- + * Function: H5I__get_name + * + * Purpose: Internal routine to retrieve the name for an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: The length of the name + * Failure: -1 + * + * Programmer: Quincey Koziol + * January 9, 2018 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5I__get_name(const H5G_loc_t *loc, char *name, size_t size) +{ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + + /* Retrieve object's name */ + if((ret_value = H5G_get_name(loc, name, size, NULL)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5I__get_name() */ + + +/*------------------------------------------------------------------------- * Function: H5Iget_file_id * * Purpose: The public version of H5I_get_file_id(), obtains the file diff --git a/src/H5Itest.c b/src/H5Itest.c index e7bd2a7..87aa7b9 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ #include "H5Ipkg.h" /* IDs */ @@ -78,6 +79,7 @@ ssize_t H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -86,11 +88,19 @@ H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) if(H5G_loc(id, &loc) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, cached, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5G_get_name(&loc, name, size, cached)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_name_test() */ diff --git a/src/H5L.c b/src/H5L.c index 07f3cdb..fe2cad1 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ @@ -47,14 +48,12 @@ /* User data for path traversal routine for getting link info by name */ typedef struct { H5L_info_t *linfo; /* Buffer to return to user */ - hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_gi_t; /* User data for path traversal callback to creating a link */ typedef struct { H5F_t *file; /* Pointer to the file */ H5P_genplist_t *lc_plist; /* Link creation property list */ - hid_t dxpl_id; /* Dataset transfer property list */ H5G_name_t *path; /* Path to object being linked */ H5O_obj_create_t *ocrt_info; /* Pointer to object creation info */ H5O_link_t *lnk; /* Pointer to link information to insert */ @@ -64,11 +63,10 @@ typedef struct { typedef struct { const char *dst_name; /* Destination name for moving object */ H5T_cset_t cset; /* Char set for new name */ - H5G_loc_t *dst_loc; /* Destination location for moving object */ + const H5G_loc_t *dst_loc; /* Destination location for moving object */ unsigned dst_target_flags; /* Target flags for destination object */ hbool_t copy; /* TRUE if this is a copy operation */ - hid_t lapl_id; /* LAPL to use in callback */ - hid_t dxpl_id; /* DXPL to use in callback */ + size_t orig_nlinks; /* The original value for the # of soft / UD links that can be traversed */ } H5L_trav_mv_t; /* User data for path traversal routine for moving and renaming an object */ @@ -76,15 +74,12 @@ typedef struct { H5F_t *file; /* Pointer to the file */ H5O_link_t *lnk; /* Pointer to link information to insert */ hbool_t copy; /* TRUE if this is a copy operation */ - hid_t dxpl_id; /* Dataset transfer property list */ } H5L_trav_mv2_t; /* User data for path traversal routine for checking if a link exists */ typedef struct { /* Down */ char *sep; /* Pointer to next separator in the string */ - hid_t lapl_id; /* Link access property list */ - hid_t dxpl_id; /* Dataset transfer property list */ /* Up */ hbool_t exists; /* Whether the link exists or not */ @@ -96,56 +91,81 @@ typedef struct { void *buf; /* User buffer */ } H5L_trav_gv_t; -/* User data for path traversal routine for removing link */ -typedef struct { - hid_t dxpl_id; /* DXPL to use in callback */ -} H5L_trav_rm_t; - /********************/ /* Local Prototypes */ /********************/ static int H5L_find_class_idx(H5L_type_t id); -static herr_t H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, +static herr_t H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file, H5O_link_t *lnk, H5O_obj_create_t *ocrt_info, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size); -static herr_t H5L_get_val_cb(H5G_loc_t *grp_loc/*in*/, const char *name, + hid_t lcpl_id); +static herr_t H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); +static herr_t H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, + const char *link_name, hid_t lcpl_id); +static herr_t H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size); +static herr_t H5L__get_val_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_val_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_val(const H5G_loc_t *loc, const char *name, + void *buf/*out*/, size_t size); +static herr_t H5L__get_val_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + void *buf/*out*/, size_t size); +static herr_t H5L__delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_delete_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__delete(const H5G_loc_t *loc, const char *name); +static herr_t H5L__delete_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +static herr_t H5L__move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); +static herr_t H5L__move(const H5G_loc_t *src_loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id); static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static htri_t H5L__exists(const H5G_loc_t *loc, const char *name); +static herr_t H5L__get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_info_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +static herr_t H5L__get_info(const H5G_loc_t *loc, const char *name, + H5L_info_t *linfo/*out*/); +static herr_t H5L__get_info_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static herr_t H5L_get_name_by_idx_cb(H5G_loc_t *grp_loc/*in*/, +static herr_t H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + H5L_info_t *linfo /*out*/); +static herr_t H5L__get_name_by_idx_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); +static ssize_t H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, + char *name /*out*/, size_t size); +static herr_t H5L__iterate(hid_t grp_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, + H5L_iterate_t op, void *op_data); +static herr_t H5L__visit(hid_t grp_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, + void *op_data); + /*********************/ /* Package Variables */ @@ -284,8 +304,8 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value=SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, @@ -305,11 +325,14 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), - TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -320,11 +343,12 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Move the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id, - lapl_id, dxpl_id) < 0) + if(H5L__move(src_loc_p, src_name, dst_loc_p, dst_name, FALSE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lmove() */ @@ -349,8 +373,8 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { H5G_loc_t src_loc, *src_loc_p; H5G_loc_t dst_loc, *dst_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value=SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, @@ -370,11 +394,14 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, - ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), - TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, + ((src_loc_id != H5L_SAME_LOC) ? src_loc_id : dst_loc_id), TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up src & dst location pointers */ src_loc_p = &src_loc; @@ -385,11 +412,12 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, dst_loc_p = src_loc_p; /* Copy the link */ - if(H5L_move(src_loc_p, src_name, dst_loc_p, dst_name, TRUE, lcpl_id, - lapl_id, dxpl_id) < 0) + if(H5L__move(src_loc_p, src_name, dst_loc_p, dst_name, TRUE, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcopy() */ @@ -413,11 +441,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Lcreate_soft(const char *link_target, - hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id) +H5Lcreate_soft(const char *link_target, hid_t link_loc_id, + const char *link_name, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; /* Group location for new link */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -433,15 +461,21 @@ H5Lcreate_soft(const char *link_target, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create the link */ - if(H5L_create_soft(link_target, &link_loc, link_name, lcpl_id, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + if(H5L__create_soft(link_target, &link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_soft() */ @@ -468,8 +502,8 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, { H5G_loc_t cur_loc, *cur_loc_p; H5G_loc_t new_loc, *new_loc_p; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, @@ -489,9 +523,13 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, cur_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, cur_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Set up current & new location pointers */ cur_loc_p = &cur_loc; @@ -504,11 +542,12 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if(H5L_create_hard(cur_loc_p, cur_name, new_loc_p, new_name, - lcpl_id, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") + if(H5L__create_hard(cur_loc_p, cur_name, new_loc_p, new_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_hard() */ @@ -542,8 +581,8 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id) { H5G_loc_t link_loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, @@ -557,15 +596,21 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, if(link_type < H5L_TYPE_UD_MIN || link_type > H5L_TYPE_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid link class") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create external link */ - if(H5L_create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_ud(&link_loc, link_name, udata, udata_size, link_type, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_ud() */ @@ -591,7 +636,7 @@ herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -603,15 +648,21 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Unlink */ - if(H5L_delete(&loc, name, lapl_id, dxpl_id) < 0) + if(H5L__delete(&loc, name) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete() */ @@ -636,12 +687,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ldelete_by_idx(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) +H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, hid_t lapl_id) { H5G_loc_t loc; /* Group's location */ - H5L_trav_rmbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -657,22 +707,21 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set up user data for unlink operation */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - - /* Traverse the group hierarchy to remove the link */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, - H5L_delete_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") + /* Delete the link */ + if(H5L__delete_by_idx(&loc, group_name, idx_type, order, n) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ldelete_by_idx() */ @@ -701,7 +750,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -713,15 +762,21 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link value */ - if(H5L_get_val(&loc, name, buf, size, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link value for '%s'", name) + if(H5L__get_val(&loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val() */ @@ -750,8 +805,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hid_t lapl_id) { H5G_loc_t loc; /* Group location for location to query */ - H5L_trav_gvbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -768,25 +822,21 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up user data for retrieving information */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.buf = buf; - udata.size = size; - - /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_get_val_by_idx_cb, - &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") + /* Get the link value */ + if(H5L__get_val_by_idx(&loc, group_name, idx_type, order, n, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_val_by_idx() */ @@ -808,8 +858,8 @@ htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - htri_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); @@ -820,15 +870,21 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Check for the existence of the link */ - if((ret_value = H5L_exists(&loc, name, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") + if((ret_value = H5L__exists(&loc, name)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lexists() */ @@ -852,8 +908,8 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value = SUCCEED; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id); @@ -864,15 +920,21 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the link information */ - if(H5L_get_info(&loc, name, linfo, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + if(H5L__get_info(&loc, name, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info() */ @@ -897,8 +959,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5L_info_t *linfo /*out*/, hid_t lapl_id) { H5G_loc_t loc; /* Group location for group to query */ - H5L_trav_gibi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -915,23 +976,21 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set up user data for callback */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.linfo = linfo; - - /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, - H5L_get_info_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to get link info") + /* Get the link information */ + if(H5L__get_info_by_idx(&loc, group_name, idx_type, order, n, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_info_by_idx() */ @@ -969,8 +1028,12 @@ H5Lregister(const H5L_class_t *cls) /* Check H5L_class_t version number; this is where a function to convert * from an outdated version should be called. + * + * v0 of the H5L_class_t is only different in the parameters to the + * traversal callback, which is handled in H5G_traverse_ud() + * (in src/H5Gtraverse.c), so it's allowed to to pass through here. - QAK, 2018/02/06 */ - if(cls->version != H5L_LINK_CLASS_T_VERS) + if(cls->version > H5L_LINK_CLASS_T_VERS) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5L_class_t version number") if(cls->id < H5L_TYPE_UD_MIN || cls->id > H5L_TYPE_MAX) @@ -1086,9 +1149,8 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, char *name /*out*/, size_t size, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5L_trav_gnbi_t udata; /* User data for callback */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - ssize_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, @@ -1104,28 +1166,21 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up user data for callback */ - udata.idx_type = idx_type; - udata.order = order; - udata.n = n; - udata.dxpl_id = dxpl_id; - udata.name = name; - udata.size = size; - udata.name_len = -1; - - /* Traverse the group hierarchy to locate the link to get name of */ - if(H5G_traverse(&loc, group_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, - H5L_get_name_by_idx_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Set the return value */ - ret_value = udata.name_len; + /* Get the link information */ + if((ret_value = H5L__get_name_by_idx(&loc, group_name, idx_type, order, n, name, size)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link name") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lget_name_by_idx() */ @@ -1152,11 +1207,9 @@ herr_t H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { - H5I_type_t id_type; /* Type of ID */ - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; /* Return value */ + H5I_type_t id_type; /* Type of ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", grp_id, idx_type, order, idx_p, op, op_data); @@ -1172,23 +1225,18 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, if (!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") - /* Set up iteration beginning/end info */ - idx = (idx_p == NULL ? 0 : *idx_p); - last_lnk = 0; - - /* Build link operator info */ - lnk_op.op_type = H5G_LINK_OP_NEW; - lnk_op.op_func.op_new = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Iterate over the links */ - if ((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") - - /* Set the index we stopped at */ - if(idx_p) - *idx_p = last_lnk; + if((ret_value = H5L__iterate(grp_id, ".", idx_type, order, idx_p, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate() */ @@ -1220,11 +1268,8 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data, hid_t lapl_id) { - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - herr_t ret_value; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, @@ -1240,28 +1285,21 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up iteration beginning/end info */ - idx = (idx_p == NULL ? 0 : *idx_p); - last_lnk = 0; - - /* Build link operator info */ - lnk_op.op_type = H5G_LINK_OP_NEW; - lnk_op.op_func.op_new = op; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Iterate over the links */ - if((ret_value = H5G_iterate(loc_id, group_name, idx_type, order, idx, &last_lnk, &lnk_op, - op_data, lapl_id, dxpl_id)) < 0) + if((ret_value = H5L__iterate(loc_id, group_name, idx_type, order, idx_p, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") - /* Set the index we stopped at */ - if(idx_p) - *idx_p = last_lnk; - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Literate_by_name() */ @@ -1299,6 +1337,7 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data) { H5I_type_t id_type; /* Type of ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1315,11 +1354,18 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Call internal group visitation routine */ - if((ret_value = H5G_visit(grp_id, ".", idx_type, order, op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link visitation failed") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Call internal routine */ + if((ret_value = H5L__visit(grp_id, ".", idx_type, order, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit() */ @@ -1356,7 +1402,7 @@ herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id) { - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1373,15 +1419,21 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") - /* Call internal group visitation routine */ - if((ret_value = H5G_visit(loc_id, group_name, idx_type, order, op, op_data, lapl_id, dxpl_id)) < 0) + /* Call internal routine */ + if((ret_value = H5L__visit(loc_id, group_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lvisit_by_name() */ @@ -1572,7 +1624,7 @@ done: */ herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1594,7 +1646,7 @@ H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, lnk.u.hard.addr = obj_loc->oloc->addr; /* Create the link */ - if(H5L_create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(new_loc, new_name, obj_loc->path, obj_loc->oloc->file, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -1616,7 +1668,7 @@ done: */ herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + H5O_obj_create_t *ocrt_info, hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1637,7 +1689,7 @@ H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, lnk.type = H5L_TYPE_HARD; /* Create the link */ - if(H5L_create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(new_loc, new_name, NULL, NULL, &lnk, ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -1646,7 +1698,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_link_cb + * Function: H5L__link_cb * * Purpose: Callback for creating a link to an object. * @@ -1658,7 +1710,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, +H5L__link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_cr_t *udata = (H5L_trav_cr_t *)_udata; /* User data passed in */ @@ -1669,12 +1721,12 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid location */ /* (which is not what we want) */ if(obj_loc != NULL) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name already exists") + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name already exists") /* Check for crossing file boundaries with a new hard link */ if(udata->lnk->type == H5L_TYPE_HARD) { @@ -1684,8 +1736,8 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR H5G_loc_t new_loc; /* Group location for new object */ /* Create new object at this location */ - if(NULL == (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type, udata->ocrt_info->crt_info, &new_loc, udata->dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create object") + if(NULL == (udata->ocrt_info->new_obj = H5O_obj_create(grp_loc->oloc->file, udata->ocrt_info->obj_type, udata->ocrt_info->crt_info, &new_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create object") /* Set address for hard link */ udata->lnk->u.hard.addr = new_loc.oloc->addr; @@ -1699,7 +1751,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR else { /* Check that both objects are in same file */ if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "interfile hard links are not allowed") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "interfile hard links are not allowed") } /* end else */ } /* end if */ @@ -1711,7 +1763,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR if(udata->lc_plist) { /* Get character encoding property */ if(H5P_get(udata->lc_plist, H5P_STRCRT_CHAR_ENCODING_NAME, &udata->lnk->cset) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding") + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get property value for character encoding") } /* end if */ else udata->lnk->cset = H5F_DEFAULT_CSET; /* Default character encoding for link */ @@ -1723,14 +1775,13 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR /* Insert link into group */ if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, udata->ocrt_info ? udata->ocrt_info->obj_type : H5O_TYPE_UNKNOWN, - udata->ocrt_info ? udata->ocrt_info->crt_info : NULL, - udata->dxpl_id) < 0) + udata->ocrt_info ? udata->ocrt_info->crt_info : NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link for object") /* Set object's path if it has been passed in and is not set */ if(udata->path != NULL && udata->path->user_path_r == NULL) if(H5G_name_set(grp_loc->path, udata->path, name) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot set name") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "cannot set name") /* If link is a user-defined link, trigger its creation callback if it has one */ if(udata->lnk->type >= H5L_TYPE_UD_MIN) { @@ -1749,17 +1800,17 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR */ H5G_name_reset(&temp_path); if(H5O_loc_copy(&temp_oloc, grp_loc->oloc, H5_COPY_DEEP) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location") temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; temp_loc_init = TRUE; /* Set up location for user-defined callback */ - if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G_open(&temp_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register ID for group") + HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register ID for group") /* Make callback */ if((link_class->create_func)(name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size, H5P_DEFAULT) < 0) @@ -1778,18 +1829,18 @@ done: oloc.addr = udata->lnk->u.hard.addr; /* Decrement refcount on new object's object header in memory */ - if(H5O_dec_rc_by_loc(&oloc, udata->dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&oloc) < 0) HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") } /* end if */ /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { if(H5I_dec_app_ref(grp_id) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { if(H5G_close(grp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") } /* end if */ else if(temp_loc_init) H5G_loc_free(&temp_loc); @@ -1799,11 +1850,11 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_link_cb() */ +} /* end H5L__link_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_create_real + * Function: H5L__create_real * * Purpose: Creates a link at a path location * @@ -1822,9 +1873,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, +H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *obj_path, H5F_t *obj_file, H5O_link_t *lnk, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + H5O_obj_create_t *ocrt_info, hid_t lcpl_id) { char *norm_link_name = NULL; /* Pointer to normalized link name */ unsigned target_flags = H5G_TARGET_NORMAL; /* Flags to pass to group traversal function */ @@ -1832,7 +1883,7 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, H5L_trav_cr_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(link_loc); @@ -1842,7 +1893,7 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, /* Get normalized link name */ if((norm_link_name = H5G_normalize(link_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Check for flags present in creation property list */ if(lcpl_id != H5P_DEFAULT) { @@ -1864,7 +1915,6 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, * FILE is used to make sure that hard links don't cross files, and * should be NULL for other link types. * LC_PLIST is a pointer to the link creation property list. - * DXPL_ID is the dxpl ID that needs to be used during writes and reads. * PATH is a pointer to the path of the object being inserted if this is * a hard link; this is used to set the paths to objects when they are * created. For other link types, this is NULL. @@ -1875,14 +1925,13 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, */ udata.file = obj_file; udata.lc_plist = lc_plist; - udata.dxpl_id = dxpl_id; udata.path = obj_path; udata.ocrt_info = ocrt_info; udata.lnk = lnk; /* Traverse the destination path & create new link */ - if(H5G_traverse(link_loc, link_name, target_flags, H5L_link_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert link") + if(H5G_traverse(link_loc, link_name, target_flags, H5L__link_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert link") done: /* Free the normalized path name */ @@ -1890,7 +1939,7 @@ done: H5MM_xfree(norm_link_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_real() */ +} /* end H5L__create_real() */ /*------------------------------------------------------------------------- @@ -1907,8 +1956,7 @@ done: */ herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id) + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) { char *norm_cur_name = NULL; /* Pointer to normalized current name */ H5F_t *link_file = NULL; /* Pointer to file to link to */ @@ -1929,7 +1977,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, /* Get normalized copy of the current name */ if((norm_cur_name = H5G_normalize(cur_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up link data specific to hard links */ lnk.type = H5L_TYPE_HARD; @@ -1938,8 +1986,8 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, obj_loc.path = &path; obj_loc.oloc = &oloc; H5G_loc_reset(&obj_loc); - if(H5G_loc_find(cur_loc, norm_cur_name, &obj_loc, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found") + if(H5G_loc_find(cur_loc, norm_cur_name, &obj_loc) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "source object not found") loc_valid = TRUE; /* Construct link information for eventual insertion */ @@ -1950,14 +1998,14 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, /* Create actual link to the object. Pass in NULL for the path, since this * function shouldn't change an object's user path. */ - if(H5L_create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, link_file, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: /* Free the object header location */ if(loc_valid) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to free location") /* Free the normalized path name */ if(norm_cur_name) @@ -1968,6 +2016,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5L__create_hard + * + * Purpose: Internal routine to create a hard link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(cur_loc); + HDassert(cur_name); + HDassert(link_loc); + HDassert(link_name); + + /* Create the link */ + if(H5L_create_hard(cur_loc, cur_name, link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_hard() */ + + +/*------------------------------------------------------------------------- * Function: H5L_create_soft * * Purpose: Creates a soft link from LINK_NAME to TARGET_PATH. @@ -1981,7 +2068,7 @@ done: */ herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, - const char *link_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id) + const char *link_name, hid_t lcpl_id) { char *norm_target = NULL; /* Pointer to normalized current name */ H5O_link_t lnk; /* Link to insert */ @@ -1996,14 +2083,14 @@ H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, /* Get normalized copy of the link target */ if((norm_target = H5G_normalize(target_path)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up link data specific to soft links */ lnk.type = H5L_TYPE_SOFT; lnk.u.soft.name = norm_target; /* Create actual link to the object */ - if(H5L_create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") done: @@ -2016,7 +2103,45 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_create_ud + * Function: H5L__create_soft + * + * Purpose: Internal routine to create a soft link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, + const char *link_name, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(target_path); + HDassert(link_loc); + HDassert(link_name); + + /* Create the link */ + if(H5L_create_soft(target_path, link_loc, link_name, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_soft() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__create_ud * * Purpose: Creates a user-defined link. See H5Lcreate_ud for * full documentation. @@ -2029,14 +2154,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, - const void *ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id) +H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, + const void *ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id) { H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX); @@ -2063,19 +2187,19 @@ H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, lnk.type = type; /* Create actual link to the object */ - if(H5L_create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_real(link_loc, link_name, NULL, NULL, &lnk, NULL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to register new name for object") done: /* Free the link's udata buffer if it's been allocated */ H5MM_xfree(lnk.u.ud.udata); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_create_ud() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__create_ud() */ /*------------------------------------------------------------------------- - * Function: H5L_get_val_real + * Function: H5L__get_val_real * * Purpose: Retrieve link value from a link object * @@ -2087,11 +2211,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size) +H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(lnk); @@ -2127,11 +2251,11 @@ H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_real() */ +} /* end H5L__get_val_real() */ /*------------------------------------------------------------------------- - * Function: H5L_get_val_cb + * Function: H5L__get_val_cb * * Purpose: Callback for retrieving link value or udata. * @@ -2143,20 +2267,20 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5L__get_val_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "'%s' doesn't exist", name) /* Retrieve the value for the link */ - if(H5L_get_val_real(lnk, udata->buf, udata->size) < 0) + if(H5L__get_val_real(lnk, udata->buf, udata->size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value") done: @@ -2165,7 +2289,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_cb() */ +} /* end H5L__get_val_cb() */ /*------------------------------------------------------------------------- @@ -2188,8 +2312,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size, - hid_t lapl_id, hid_t dxpl_id) +H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) { H5L_trav_gv_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2205,8 +2328,8 @@ H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size, udata.buf = buf; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L_get_val_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2214,7 +2337,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_val_by_idx_cb + * Function: H5L__get_val + * + * Purpose: Internal routine to query a link value + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Get the link value */ + if(H5L_get_val(loc, name, buf, size) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link value for '%s'", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_val() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_val_by_idx_cb * * Purpose: Callback for retrieving a link's value according to an * index's order. @@ -2227,7 +2386,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -2236,20 +2395,19 @@ H5L_get_val_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATT hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; /* Retrieve the value for the link */ - if(H5L_get_val_real(&fnd_lnk, udata->buf, udata->size) < 0) + if(H5L__get_val_real(&fnd_lnk, udata->buf, udata->size) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't retrieve link value") done: @@ -2262,11 +2420,57 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_val_by_idx_cb() */ +} /* end H5L__get_val_by_idx_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_val_by_idx + * + * Purpose: Internal routine to query a link value according to the + * index within a group + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, void *buf/*out*/, size_t size) +{ + H5L_trav_gvbi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Set up user data for retrieving information */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.buf = buf; + udata.size = size; + + /* Traverse the group hierarchy to locate the object to get info about */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_val_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get link info for index: %llu", (unsigned long long)n) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_val_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5L_delete_cb + * Function: H5L__delete_cb * * Purpose: Callback for deleting a link. This routine * actually deletes the link @@ -2279,31 +2483,31 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, - H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) +H5L__delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, + H5G_loc_t H5_ATTR_UNUSED *obj_loc, void H5_ATTR_UNUSED *_udata/*in,out*/, + H5G_own_loc_t *own_loc/*out*/) { - H5L_trav_rm_t *udata = (H5L_trav_rm_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the group resolved to a valid link */ if(grp_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Check if the name in this group resolved to a valid link */ if(name == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for non-existent (NULL) link. * Note that this can also occur when attempting to remove '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") /* Remove the link from the group */ - if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to remove link from group") + if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to remove link from group") done: /* Indicate that this callback didn't take ownership of the group * @@ -2311,7 +2515,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_delete_cb() */ +} /* end H5L__delete_cb() */ /*------------------------------------------------------------------------- @@ -2327,9 +2531,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L_delete(const H5G_loc_t *loc, const char *name) { - H5L_trav_rm_t udata; /* User data for callback */ char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2341,12 +2544,11 @@ H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) /* Get normalized copy of the name */ if((norm_name = H5G_normalize(name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize name") /* Set up user data for unlink operation */ - udata.dxpl_id = dxpl_id; - if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, H5L_delete_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "can't unlink object") + if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_cb, NULL) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTREMOVE, FAIL, "can't unlink object") done: /* Free the normalized path name */ @@ -2358,7 +2560,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_delete_by_idx_cb + * Function: H5L__delete + * + * Purpose: Internal routine to delete a link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__delete(const H5G_loc_t *loc, const char *name) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Delete the link */ + if(H5L_delete(loc, name) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "unable to delete link: %s", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__delete_by_idx_cb * * Purpose: Callback for removing a link according to an index's order. * @@ -2370,39 +2608,82 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__delete_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, (obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF, FAIL) + FUNC_ENTER_STATIC_TAG((obj_loc) ? (obj_loc->oloc->addr) : HADDR_UNDEF) /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Delete link */ - if(H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, - udata->idx_type, udata->order, udata->n, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_remove_by_idx(obj_loc->oloc, obj_loc->path->full_path_r, udata->idx_type, udata->order, udata->n) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") done: /* Indicate that this callback didn't take ownership of the group * * location for the object */ *own_loc = H5G_OWN_NONE; - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5L_delete_by_idx_cb() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5L__delete_by_idx_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_move_dest_cb + * Function: H5L__delete_by_idx + * + * Purpose: Internal routine to delete a link according to its index + * within a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5L_trav_rmbi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Set up user data for unlink operation */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + + /* Traverse the group hierarchy to remove the link */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK | H5G_TARGET_MOUNT, H5L__delete_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTDELETE, FAIL, "link doesn't exist") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__delete() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__move_dest_cb * * Purpose: Second callback for moving and renaming an object. This routine * inserts a new link into the group returned by the traversal. - * It is called by H5L_move_cb. + * It is called by H5L__move_cb. * * Return: Non-negative on success/Negative on failure * @@ -2412,7 +2693,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, +H5L__move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -2423,18 +2704,17 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, hbool_t temp_loc_init = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Make sure an object with this name doesn't already exist */ if(obj_loc != NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "an object with that name already exists") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "an object with that name already exists") /* Check for crossing file boundaries with a new hard link */ - if(udata->lnk->type == H5L_TYPE_HARD) { + if(udata->lnk->type == H5L_TYPE_HARD) /* Check that both objects are in same file */ if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") - } /* end if */ + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") /* Give the object its new name */ /* Casting away const okay -JML */ @@ -2442,8 +2722,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, udata->lnk->name = (char *)name; /* Insert the link into the group */ - if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, - NULL, udata->dxpl_id) < 0) + if(H5G_obj_insert(grp_loc->oloc, name, udata->lnk, TRUE, H5O_TYPE_UNKNOWN, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create new link to object") /* If the link was a user-defined link, call its move callback if it has one */ @@ -2463,17 +2742,17 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, */ H5G_name_reset(&temp_path); if(H5O_loc_copy(&temp_oloc, grp_loc->oloc, H5_COPY_DEEP) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object location") temp_loc.oloc = &temp_oloc; temp_loc.path = &temp_path; temp_loc_init = TRUE; /* Set up location for user-defined callback */ - if((grp = H5G_open(&temp_loc, udata->dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if(NULL == (grp = H5G_open(&temp_loc))) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open group") if((grp_id = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group ID") + HGOTO_ERROR(H5E_LINK, H5E_CANTREGISTER, FAIL, "unable to register group ID") if(udata->copy) { if((link_class->copy_func)(udata->lnk->name, grp_id, udata->lnk->u.ud.udata, udata->lnk->u.ud.size) < 0) @@ -2490,11 +2769,11 @@ done: /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { if(H5I_dec_app_ref(grp_id) < 0) - HDONE_ERROR(H5E_ATOM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") } /* end if */ else if(grp != NULL) { if(H5G_close(grp) < 0) - HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") + HDONE_ERROR(H5E_LINK, H5E_CANTRELEASE, FAIL, "unable to close group given to UD callback") } /* end if */ else if(temp_loc_init) H5G_loc_free(&temp_loc); @@ -2508,11 +2787,11 @@ done: udata->lnk->name = NULL; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move_dest_cb() */ +} /* end H5L__move_dest_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_move_cb + * Function: H5L__move_cb * * Purpose: Callback for moving and renaming an object. This routine * replaces the names of open objects with the moved object @@ -2526,24 +2805,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, +H5L__move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_mv_t *udata = (H5L_trav_mv_t *)_udata; /* User data passed in */ - H5L_trav_mv2_t udata_out; /* User data for H5L_move_dest_cb traversal */ + H5L_trav_mv2_t udata_out; /* User data for H5L__move_dest_cb traversal */ char * orig_name = NULL; /* The name of the link in this group */ hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Check for operations on '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "the name of a link must be supplied to move or copy") /* Set up user data for move_dest_cb */ if(NULL == (udata_out.lnk = (H5O_link_t *)H5O_msg_copy(H5O_LINK_ID, lnk, NULL))) @@ -2558,15 +2837,19 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, udata_out.lnk->cset = udata->cset; udata_out.file = grp_loc->oloc->file; udata_out.copy = udata->copy; - udata_out.dxpl_id = udata->dxpl_id; /* Keep a copy of link's name (it's "owned" by the H5G_traverse() routine) */ orig_name = H5MM_xstrdup(name); + /* Reset the # of soft / UD links that can be traversed, so that the second + * (destination) traversal has the correct value + */ + if(H5CX_set_nlinks(udata->orig_nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't reset # of soft / UD links to traverse") + /* Insert the link into its new location */ - if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, - H5L_move_dest_cb, &udata_out, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") + if(H5G_traverse(udata->dst_loc, udata->dst_name, udata->dst_target_flags, H5L__move_dest_cb, &udata_out) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to follow symbolic link") /* If this is a move and not a copy operation, change the object's name and remove the old link */ if(!udata->copy) { @@ -2579,7 +2862,7 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, /* Create reference counted string for full dst path */ if((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r, udata->dst_name)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_PATH, FAIL, "can't build destination path name") + HGOTO_ERROR(H5E_LINK, H5E_PATH, FAIL, "can't build destination path name") } /* end if */ else dst_name_r = H5RS_wrap(udata->dst_name); @@ -2587,15 +2870,15 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, /* Fix names up */ if(H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r, - udata->dst_loc->oloc->file, dst_name_r, udata->dxpl_id) < 0) { + udata->dst_loc->oloc->file, dst_name_r) < 0) { H5RS_decr(dst_name_r); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to replace name") + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to replace name") } /* end if */ /* Remove the old link */ - if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name, udata->dxpl_id) < 0) { + if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, orig_name) < 0) { H5RS_decr(dst_name_r); - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to remove old name") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to remove old name") } /* end if */ H5RS_decr(dst_name_r); @@ -2607,7 +2890,7 @@ done: H5MM_xfree(orig_name); /* If udata_out.lnk was copied, free any memory allocated - * In this special case, the H5L_move_dest_cb callback resets the name + * In this special case, the H5L__move_dest_cb callback resets the name * so H5O_msg_free shouldn't try to free it */ if(link_copied) @@ -2618,7 +2901,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_move_cb() */ +} /* end H5L__move_cb() */ /*------------------------------------------------------------------------- @@ -2642,19 +2925,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, - const char *dst_name, hbool_t copy_flag, hid_t lcpl_id, hid_t lapl_id, - hid_t dxpl_id) +H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, + const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) { unsigned dst_target_flags = H5G_TARGET_NORMAL; H5T_cset_t char_encoding = H5F_DEFAULT_CSET; /* Character encoding for link */ H5P_genplist_t* lc_plist; /* Link creation property list */ - H5P_genplist_t* la_plist; /* Link access property list */ H5L_trav_mv_t udata; /* User data for traversal */ - hid_t lapl_copy; /* Copy of lapl for this function */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(src_loc); @@ -2682,31 +2962,22 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get property value for character encoding") } /* end if */ - /* Copy the link access property list because traversing UD links will - * decrease the NLINKS property. HDF5 should have NLINKS traversals to - * get to the source and NLINKS more to get to the destination. */ - if(lapl_id == H5P_DEFAULT) - lapl_copy = lapl_id; - else { - if(NULL == (la_plist = (H5P_genplist_t *)H5I_object(lapl_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid access PL") - if((lapl_copy = H5P_copy_plist(la_plist, FALSE)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy access properties") - } /* end else */ - /* Set up user data */ udata.dst_loc = dst_loc; udata.dst_name= dst_name; udata.dst_target_flags = dst_target_flags; udata.cset = char_encoding; udata.copy = copy_flag; - udata.lapl_id = lapl_copy; - udata.dxpl_id = dxpl_id; + + /* Retrieve the original # of soft / UD links that can be traversed, so + * that the countdown can be reset after the first path is traversed. + */ + if(H5CX_get_nlinks(&udata.orig_nlinks) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve # of soft / UD links to traverse") /* Do the move */ - if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, - H5L_move_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to find link") + if(H5G_traverse(src_loc, src_name, H5G_TARGET_MOUNT | H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__move_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "unable to find link") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2714,6 +2985,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5L__move + * + * Purpose: Internal routine to move / copy a link + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 25, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__move(const H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, + const char *dst_name, hbool_t copy_flag, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(src_loc); + HDassert(src_name); + HDassert(dst_loc); + HDassert(dst_name); + + /* Move the link */ + if(H5L_move(src_loc, src_name, dst_loc, dst_name, copy_flag, lcpl_id) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTMOVE, FAIL, "unable to move link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__move() */ + + +/*------------------------------------------------------------------------- * Function: H5L__exists_final_cb * * Purpose: Callback for checking whether a link exists, as the final @@ -2788,8 +3098,8 @@ H5L__exists_inter_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR } while('/' == *udata->sep); cb_func = H5L__exists_inter_cb; } /* end else */ - if(H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine if link exists") + if(H5G_traverse(obj_loc, next, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists") } /* end if */ else udata->exists = TRUE; @@ -2822,7 +3132,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L_exists_tolerant(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ H5G_traverse_t cb_func; /* Callback function for tranversal */ @@ -2846,8 +3156,6 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t HGOTO_DONE(TRUE) /* Set up user data & correct callback */ - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.exists = FALSE; if(NULL == (udata.sep = HDstrchr(name_trav, '/'))) cb_func = H5L__exists_final_cb; @@ -2861,8 +3169,8 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t } /* end else */ /* Traverse the group hierarchy to locate the link to check */ - if(H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't determine if link exists") + if(H5G_traverse(loc, name_trav, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, cb_func, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't determine if link exists") /* Set return value */ ret_value = (htri_t)udata.exists; @@ -2876,7 +3184,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_exists + * Function: H5L__exists * * Purpose: Returns whether a link exists in a group * @@ -2891,12 +3199,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +H5L__exists(const H5G_loc_t *loc, const char *name) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_VOL /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) @@ -2904,19 +3212,19 @@ H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) /* Traverse the group hierarchy to locate the object to get info about */ udata.exists = FALSE; - if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "path doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__exists_final_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "path doesn't exist") /* Set return value */ ret_value = (htri_t)udata.exists; done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_exists() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5L__exists() */ /*------------------------------------------------------------------------- - * Function: H5L_get_info_cb + * Function: H5L__get_info_cb * * Purpose: Callback for retrieving a link's metadata * @@ -2928,18 +3236,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_info_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t *lnk, H5G_loc_t H5_ATTR_UNUSED *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "name doesn't exist") /* Get information from the link */ if(H5G_link_to_info(lnk, udata->linfo) < 0) @@ -2951,7 +3259,7 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_cb() */ +} /* end H5L__get_info_cb() */ /*------------------------------------------------------------------------- @@ -2967,8 +3275,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_get_info(const H5G_loc_t *loc, const char *name, - H5L_info_t *linfo/*out*/, hid_t lapl_id, hid_t dxpl_id) +H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linfo/*out*/) { H5L_trav_gi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2976,11 +3283,10 @@ H5L_get_info(const H5G_loc_t *loc, const char *name, FUNC_ENTER_NOAPI(FAIL) udata.linfo = linfo; - udata.dxpl_id = dxpl_id; /* Traverse the group hierarchy to locate the object to get info about */ - if(H5G_traverse(loc, name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_get_info_cb, &udata, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist") + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_EXISTS, FAIL, "name doesn't exist") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2988,7 +3294,43 @@ done: /*------------------------------------------------------------------------- - * Function: H5L_get_info_by_idx_cb + * Function: H5L__get_info + * + * Purpose: Internal routine to retrieve link info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linfo/*out*/) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Get the link information */ + if(H5L_get_info(loc, name, linfo) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info for: '%s'", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_info() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_info_by_idx_cb * * Purpose: Callback for retrieving a link's metadata according to an * index's order. @@ -3001,7 +3343,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { @@ -3010,16 +3352,15 @@ H5L_get_info_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_AT hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, &fnd_lnk, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if(H5G_obj_lookup_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, &fnd_lnk) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") lnk_copied = TRUE; /* Get information from the link */ @@ -3036,39 +3377,57 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_info_by_idx_cb() */ +} /* end H5L__get_info_by_idx_cb() */ /*------------------------------------------------------------------------- - * Function: H5L_get_default_lcpl + * Function: H5L__get_info_by_idx * - * Purpose: Accessor for the default Link Creation Property List + * Purpose: Internal routine to retrieve link info according to an + * index's order. * - * Return: Success: ID of the deafult lcpl + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). * - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: James Laird - * Tuesday, July 4, 2006 + * Programmer: Quincey Koziol + * December 27, 2017 * *------------------------------------------------------------------------- */ -hid_t -H5L_get_default_lcpl(void) +static herr_t +H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5L_info_t *linfo /*out*/) { - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5L_trav_gibi_t udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + HDassert(linfo); + + /* Set up user data for callback */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.linfo = linfo; - ret_value = H5P_LINK_CREATE_DEFAULT; + /* Traverse the group hierarchy to locate the object to get info about */ + if(H5G_traverse(loc, name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_info_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to get link info") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_get_default_lcpl */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_info_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5L_get_name_by_idx_cb + * Function: H5L__get_name_by_idx_cb * * Purpose: Callback for retrieving a link's name according to an * index's order. @@ -3081,23 +3440,22 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5L_get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, +H5L__get_name_by_idx_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc/*in*/, const char H5_ATTR_UNUSED *name, const H5O_link_t H5_ATTR_UNUSED *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/) { H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group doesn't exist") + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "group doesn't exist") /* Query link */ - if((udata->name_len = H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, - udata->n, udata->name, udata->size, udata->dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "link not found") + if((udata->name_len = H5G_obj_get_name_by_idx(obj_loc->oloc, udata->idx_type, udata->order, udata->n, udata->name, udata->size)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_NOTFOUND, FAIL, "link not found") done: /* Indicate that this callback didn't take ownership of the group * @@ -3105,11 +3463,151 @@ done: *own_loc = H5G_OWN_NONE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_get_name_by_idx_cb() */ +} /* end H5L__get_name_by_idx_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__get_name_by_idx + * + * Purpose: Internal routine to retrieve link name according to an + * index's order. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static ssize_t +H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name /*out*/, + size_t size) +{ + H5L_trav_gnbi_t udata; /* User data for callback */ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(group_name && *group_name); + + /* Set up user data for callback */ + udata.idx_type = idx_type; + udata.order = order; + udata.n = n; + udata.name = name; + udata.size = size; + udata.name_len = -1; + + /* Traverse the group hierarchy to locate the link to get name of */ + if(H5G_traverse(loc, group_name, H5G_TARGET_SLINK | H5G_TARGET_UDLINK, H5L__get_name_by_idx_cb, &udata) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't get name") + + /* Set the return value */ + ret_value = udata.name_len; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__get_name_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__iterate + * + * Purpose: Internal routine to iterate over links + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 27, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__iterate(hid_t grp_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) +{ + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_lnk; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(group_name); + HDassert(op); + + /* Set up iteration beginning/end info */ + idx = (idx_p == NULL ? 0 : *idx_p); + last_lnk = 0; + + /* Build link operator info */ + lnk_op.op_type = H5G_LINK_OP_NEW; + lnk_op.op_func.op_new = op; + + /* Iterate over the links */ + if((ret_value = H5G_iterate(grp_id, group_name, idx_type, order, idx, &last_lnk, &lnk_op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link iteration failed") + + /* Set the index we stopped at */ + if(idx_p) + *idx_p = last_lnk; + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__iterate() */ + + +/*------------------------------------------------------------------------- + * Function: H5L__visit + * + * Purpose: Internal routine to visit links + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5L__visit(hid_t grp_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, H5L_iterate_t op, void *op_data) +{ + herr_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(group_name); + HDassert(op); + + /* Call internal group visitation routine */ + if((ret_value = H5G_visit(grp_id, group_name, idx_type, order, op, op_data)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_BADITER, FAIL, "link visitation failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5L__visit() */ /*------------------------------------------------------------------------- - * Function: H5L_link_copy_file + * Function: H5L__link_copy_file * * Purpose: Copy a link and the object it points to from one file to * another. @@ -3123,7 +3621,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, +H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info) { H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */ @@ -3135,7 +3633,7 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, H5O_loc_t tmp_src_oloc; /* Object location for target object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(dst_file); @@ -3157,27 +3655,25 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */ /* Check if the target object exists */ - if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name, H5P_DEFAULT, - dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to check if target object exists") + if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to check if target object exists") if(tar_exists) { /* Make a temporary copy of the link, so that it will not change the * info in the cache when we change it to a hard link */ if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message") /* Set up group location for target object. Let H5G_traverse expand * the link. */ tmp_src_loc.path = &tmp_src_path; tmp_src_loc.oloc = &tmp_src_oloc; if(H5G_loc_reset(&tmp_src_loc) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to reset location") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to reset location") /* Find the target object */ - if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc, - H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to find target object") + if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to find target object") expanded_link_open = TRUE; /* Convert symbolic link to hard link */ @@ -3194,7 +3690,7 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, /* Copy src link information to dst link information */ if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy message") dst_lnk_init = TRUE; /* Check if object in source group is a hard link & copy it */ @@ -3216,9 +3712,8 @@ H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, /* Copy the shared object from source to destination */ /* Don't care about obj_type or udata because those are only important * for old style groups */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, - TRUE, NULL, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, cpy_info, TRUE, NULL, NULL) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTCOPY, FAIL, "unable to copy object") /* Copy new destination object's information for eventual insertion */ dst_lnk->u.hard.addr = new_dst_oloc.addr; @@ -3236,8 +3731,8 @@ done: /* Check if we need to free the temp source oloc */ if(expanded_link_open) if(H5G_loc_free(&tmp_src_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object") + HDONE_ERROR(H5E_LINK, H5E_CANTFREE, FAIL, "unable to free object") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_link_copy_file() */ +} /* end H5L__link_copy_file() */ diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index b4a173f..6c132ab 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -24,6 +24,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -55,10 +56,12 @@ /********************/ /* Local Prototypes */ /********************/ - -static hid_t H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id); -static ssize_t H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *udata, +static char *H5L__getenv_prefix_name(char **env_prefix/*in,out*/); +static herr_t H5L__build_name(const char *prefix, const char *file_name, + char **full_name/*out*/); +static hid_t H5L__extern_traverse(const char *link_name, hid_t cur_group, + const void *udata, size_t udata_size, hid_t lapl_id, hid_t dxpl_id); +static ssize_t H5L__extern_query(const char *link_name, const void *udata, size_t udata_size, void * buf /*out*/, size_t buf_size); @@ -84,15 +87,15 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ NULL, /* Creation callback */ NULL, /* Move callback */ NULL, /* Copy callback */ - H5L_extern_traverse, /* The actual traversal function */ + H5L__extern_traverse, /* The actual traversal function */ NULL, /* Deletion callback */ - H5L_extern_query /* Query callback */ + H5L__extern_query /* Query callback */ }}; /*-------------------------------------------------------------------------- - * Function: H5L_getenv_prefix_name -- + * Function: H5L__getenv_prefix_name * * Purpose: Get the first pathname in the list of pathnames stored in ENV_PREFIX, * which is separated by the environment delimiter. @@ -105,29 +108,30 @@ static const H5L_class_t H5L_EXTERN_LINK_CLASS[1] = {{ * --------------------------------------------------------------------------*/ static char * -H5L_getenv_prefix_name(char **env_prefix/*in,out*/) +H5L__getenv_prefix_name(char **env_prefix/*in,out*/) { - char *retptr=NULL; - char *strret=NULL; + char *retptr = NULL; + char *strret = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR strret = HDstrchr(*env_prefix, H5_COLON_SEPC); - if (strret == NULL) { + if(strret == NULL) { retptr = *env_prefix; *env_prefix = strret; - } else { + } /* end if */ + else { retptr = *env_prefix; *env_prefix = strret + 1; *strret = '\0'; - } + } /* end else */ FUNC_LEAVE_NOAPI(retptr) -} /* end H5L_getenv_prefix_name() */ +} /* end H5L__getenv_prefix_name() */ /*-------------------------------------------------------------------------- - * Function: H5L_build_name + * Function: H5L__build_name * * Purpose: Prepend PREFIX to FILE_NAME and store in FULL_NAME * @@ -137,13 +141,13 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) * --------------------------------------------------------------------------*/ static herr_t -H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) +H5L__build_name(const char *prefix, const char *file_name, char **full_name/*out*/) { size_t prefix_len; /* length of prefix */ size_t fname_len; /* Length of external link file name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC prefix_len = HDstrlen(prefix); fname_len = HDstrlen(file_name); @@ -158,11 +162,11 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L_build_name() */ +} /* H5L__build_name() */ /*------------------------------------------------------------------------- - * Function: H5L_extern_traverse + * Function: H5L__extern_traverse * * Purpose: Default traversal function for external links. This can * be overridden using H5Lregister(). @@ -177,27 +181,13 @@ done: * * Programmer: James Laird * Monday, July 10, 2006 - * Modifications: - * Vailin Choi, April 2, 2008 - * Add handling to search for the target file - * See description in RM: H5Lcreate_external - * - * Vailin Choi; Sept. 12th, 2008; bug #1247 - * Retrieve the file access property list identifer that is set - * for link access property via H5Pget_elink_fapl(). - * If the return value is H5P_DEFAULT, the parent's file access - * property is used to H5F_open() the target file; - * Otherwise, the file access property retrieved from H5Pget_elink_fapl() - * is used to H5F_open() the target file. - * - * Vailin Choi; Nov 2010 - * Free memory pointed to by tmp_env_prefix for HDF5_EXT_PREFIX case. * *------------------------------------------------------------------------- */ static hid_t -H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) +H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, + const void *_udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { H5P_genplist_t *plist; /* Property list pointer */ char *my_prefix; /* Library's copy of the prefix */ @@ -220,10 +210,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(p); @@ -244,10 +233,6 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, if(NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, cur_group, FALSE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* Get the fapl_id set for lapl_id if any */ if(H5P_get(plist, H5L_ACS_ELINK_FAPL_NAME, &fapl_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fapl for links") @@ -285,7 +270,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_file_name = H5F_OPEN_NAME(loc.oloc->file); /* Query length of parent group name */ - if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL, lapl_id, dxpl_id)) < 0) + if((group_name_len = H5G_get_name(&loc, NULL, (size_t) 0, NULL)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve length of group name") /* Account for null terminator */ @@ -300,7 +285,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, parent_group_name = local_group_name; /* Get parent group name */ - if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL, lapl_id, dxpl_id) < 0) + if(H5G_get_name(&loc, parent_group_name, (size_t) group_name_len, NULL) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "unable to retrieve group name") /* Make callback */ @@ -331,7 +316,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* target file_name is an absolute pathname: see RM for detailed description */ if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) { char *ptr; H5E_clear_stack(NULL); @@ -350,7 +335,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, } /* end if */ else if(H5_CHECK_ABS_DRIVE(file_name)) { /* Try opening file */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) { + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) { H5E_clear_stack(NULL); @@ -373,14 +358,14 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, while((tmp_env_prefix) && (*tmp_env_prefix)) { char *out_prefix_name; - out_prefix_name = H5L_getenv_prefix_name(&tmp_env_prefix/*in,out*/); + out_prefix_name = H5L__getenv_prefix_name(&tmp_env_prefix/*in,out*/); if(out_prefix_name && (*out_prefix_name)) { - if(H5L_build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { + if(H5L__build_name(out_prefix_name, temp_file_name, &full_name/*out*/) < 0) { saved_env = (char *)H5MM_xfree(saved_env); HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") } /* end if */ - ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id); + ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id); full_name = (char *)H5MM_xfree(full_name); if(ext_file != NULL) break; @@ -396,9 +381,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, if(H5P_peek(plist, H5L_ACS_ELINK_PREFIX_NAME, &my_prefix) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external link prefix") if(my_prefix) { - if(H5L_build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(my_prefix, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); full_name = (char *)H5MM_xfree(full_name); } /* end if */ @@ -409,9 +394,9 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, char *extpath; if(NULL != (extpath = H5F_EXTPATH(loc.oloc->file))) { - if(H5L_build_name(extpath, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(extpath, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); full_name = (char *)H5MM_xfree(full_name); } /* end if */ @@ -419,7 +404,7 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, /* try the relative file_name stored in temp_file_name */ if(ext_file == NULL) { - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, temp_file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) H5E_clear_stack(NULL); } /* end if */ @@ -442,23 +427,22 @@ H5L_extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, *ptr = '\0'; /* Build new file name for the external file */ - if(H5L_build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) + if(H5L__build_name(actual_file_name, temp_file_name, &full_name/*out*/) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTGET, FAIL, "can't prepend prefix to filename") /* Try opening with the resolved name */ - if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, dxpl_id))) + if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, full_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id))) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) full_name = (char *)H5MM_xfree(full_name); } /* end if */ - /* Retrieve the "group location" for the file's root group */ if(H5G_root_loc(ext_file, &root_loc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unable to create location for file") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "unable to create location for file") /* Open the object referenced in the external file */ - if((ext_obj = H5O_open_name(&root_loc, obj_name, lapl_id, dxpl_id, FALSE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ext_obj = H5O_open_name(&root_loc, obj_name, FALSE)) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Set return value */ ret_value = ext_obj; @@ -482,11 +466,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_extern_traverse() */ +} /* end H5L__extern_traverse() */ /*------------------------------------------------------------------------- - * Function: H5L_extern_query + * Function: H5L__extern_query * * Purpose: Default query function for external links. This can * be overridden using H5Lregister(). @@ -503,7 +487,7 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size_t udata_size, +H5L__extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size_t udata_size, void *buf /*out*/, size_t buf_size) { const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ @@ -532,7 +516,7 @@ H5L_extern_query(const char H5_ATTR_UNUSED * link_name, const void *_udata, size done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5L_extern_query() */ +} /* end H5L__extern_query() */ /*------------------------------------------------------------------------- @@ -566,7 +550,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, size_t file_name_len; /* Length of file name string */ size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -585,7 +569,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Get normalized copy of the link target */ if(NULL == (norm_obj_name = H5G_normalize(obj_name))) - HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize object name") + HGOTO_ERROR(H5E_LINK, H5E_BADVALUE, FAIL, "can't normalize object name") /* Combine the filename and link name into a single buffer to give to the UD link */ file_name_len = HDstrlen(file_name) + 1; @@ -601,18 +585,24 @@ H5Lcreate_external(const char *file_name, const char *obj_name, p += file_name_len; HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* External link's object */ - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, link_loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, link_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access property list info") /* Create an external link */ - if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, dxpl_id) < 0) + if(H5L__create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: H5MM_xfree(ext_link_buf); H5MM_xfree(norm_obj_name); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Lcreate_external() */ diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index 39e3197..f0e9cfc 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -51,12 +51,11 @@ /* Package Private Prototypes */ /******************************/ -H5_DLL herr_t H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, +H5_DLL herr_t H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void * ud_data, size_t ud_data_size, H5L_type_t type, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, - const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, - H5O_copy_t *cpy_info); + hid_t lcpl_id); +H5_DLL herr_t H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, + const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info); #endif /* _H5Lpkg_H */ diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index 8a2bd34..3bbb6b6 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -54,7 +54,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ size_t size; /* Size of user buffer */ /* Out */ @@ -67,7 +66,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ /* Out */ H5L_info_t *linfo; /* Buffer to return to user */ @@ -80,7 +78,6 @@ typedef struct { H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ size_t size; /* Size of name buffer */ - hid_t dxpl_id; /* DXPL to use in callback */ /* Out */ char *name; /* Buffer to return name to user */ @@ -93,7 +90,6 @@ typedef struct { H5_index_t idx_type; /* Index to use */ H5_iter_order_t order; /* Order to iterate in index */ hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_rmbi_t; /* Structure for external link traversal callback property */ @@ -115,27 +111,22 @@ typedef struct H5L_elink_cb_t { /* General operations on links */ H5_DLL herr_t H5L_init(void); H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, - H5G_loc_t *obj_loc, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); + H5G_loc_t *obj_loc, hid_t lcpl_id); H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, - H5O_obj_create_t *ocrt_info, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); + H5O_obj_create_t *ocrt_info, hid_t lcpl_id); H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, - const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id, - hid_t lapl_id, hid_t dxpl_id); + const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id); H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc, - const char *cur_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL hid_t H5L_get_default_lcpl(void); -H5_DLL herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name, - H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, - hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); -H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); + const char *cur_name, hid_t lcpl_id); +H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name, + const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, + hid_t lcpl_id); +H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, - H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); -H5_DLL herr_t H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, - size_t size, hid_t lapl_id, hid_t dxpl_id); + H5L_info_t *linkbuf/*out*/); +H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/, + size_t size); H5_DLL herr_t H5L_register_external(void); /* User-defined link functions */ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 9d1643e..e6fd37c 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -41,7 +41,10 @@ #define H5L_SAME_LOC (hid_t)0 /* Current version of the H5L_class_t struct */ -#define H5L_LINK_CLASS_T_VERS 0 +#define H5L_LINK_CLASS_T_VERS 1 + +/* Previous versions of the H5L_class_t struct */ +#define H5L_LINK_CLASS_T_VERS_0 0 #ifdef __cplusplus extern "C" { @@ -99,8 +102,10 @@ typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size); /* Callback during link traversal */ -typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, +typedef hid_t (*H5L_traverse_0_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id); +typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group, + const void *lnkdata, size_t lnkdata_size, hid_t lapl_id, hid_t dxpl_id); /* Callback for when the link is deleted */ typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file, @@ -119,6 +124,18 @@ typedef struct { H5L_create_func_t create_func; /* Callback during link creation */ H5L_move_func_t move_func; /* Callback after moving link */ H5L_copy_func_t copy_func; /* Callback after copying link */ + H5L_traverse_0_func_t trav_func; /* Callback during link traversal */ + H5L_delete_func_t del_func; /* Callback for link deletion */ + H5L_query_func_t query_func; /* Callback for queries */ +} H5L_class_0_t; + +typedef struct { + int version; /* Version number of this struct */ + H5L_type_t id; /* Link type ID */ + const char *comment; /* Comment for debugging */ + H5L_create_func_t create_func; /* Callback during link creation */ + H5L_move_func_t move_func; /* Callback after moving link */ + H5L_copy_func_t copy_func; /* Callback after copying link */ H5L_traverse_func_t trav_func; /* Callback during link traversal */ H5L_delete_func_t del_func; /* Callback for link deletion */ H5L_query_func_t query_func; /* Callback for queries */ diff --git a/src/H5MF.c b/src/H5MF.c index 7e06654..250a242 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -79,23 +79,23 @@ typedef struct { /********************/ /* Allocator routines */ -static haddr_t H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size); +static haddr_t H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size); /* "File closing" routines */ -static herr_t H5MF__close_aggrfs(H5F_t *f, hid_t dxpl_id); -static herr_t H5MF__close_pagefs(H5F_t *f, hid_t dxpl_id); -static herr_t H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id); +static herr_t H5MF__close_aggrfs(H5F_t *f); +static herr_t H5MF__close_pagefs(H5F_t *f); +static herr_t H5MF__close_shrink_eoa(H5F_t *f); /* General routines */ -static herr_t H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); +static herr_t H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums); static hbool_t H5MF__fsm_type_is_self_referential(H5F_t *f, H5F_mem_page_t fsm_type); static hbool_t H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace); /* Free-space type manager routines */ -static herr_t H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__close_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -static herr_t H5MF__close_delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); +static herr_t H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type); +static herr_t H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type); /*********************/ @@ -275,7 +275,7 @@ H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_pag /*------------------------------------------------------------------------- - * Function: H5MF_open_fstype + * Function: H5MF__open_fstype * * Purpose: Open an existing free space manager of TYPE for file by * creating a free-space structure. @@ -291,7 +291,7 @@ H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_pag *------------------------------------------------------------------------- */ herr_t -H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for file */ H5MF_FSPACE_SECT_CLS_SIMPLE, @@ -299,13 +299,11 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) H5MF_FSPACE_SECT_CLS_LARGE }; hsize_t alignment; /* Alignment to use */ hsize_t threshold; /* Threshold to use */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -331,17 +329,15 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) threshold = f->shared->threshold; } /* end else */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Open an existing free space structure for the file */ - if(NULL == (f->shared->fs_man[type] = H5FS_open(f, dxpl_id, f->shared->fs_addr[type], + if(NULL == (f->shared->fs_man[type] = H5FS_open(f, f->shared->fs_addr[type], NELMTS(classes), classes, f, alignment, threshold))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") @@ -350,13 +346,12 @@ H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) f->shared->fs_state[type] = H5F_FS_STATE_OPEN; done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_open_fstype() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__open_fstype() */ /*------------------------------------------------------------------------- @@ -376,7 +371,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) { const H5FS_section_class_t *classes[] = { /* Free space section classes implemented for file */ H5MF_FSPACE_SECT_CLS_SIMPLE, @@ -384,14 +379,12 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) H5MF_FSPACE_SECT_CLS_LARGE }; H5FS_create_t fs_create; /* Free space creation parameters */ hsize_t alignment; /* Alignment to use */ - hsize_t threshold; /* Threshold to use */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ + hsize_t threshold; /* Threshold to use */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -424,16 +417,14 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) threshold = f->shared->threshold; } /* end else */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); - if(NULL == (f->shared->fs_man[type] = H5FS_create(f, dxpl_id, NULL, + if(NULL == (f->shared->fs_man[type] = H5FS_create(f, NULL, &fs_create, NELMTS(classes), classes, f, alignment, threshold))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info") @@ -442,17 +433,16 @@ H5MF__create_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) f->shared->fs_state[type] = H5F_FS_STATE_OPEN; done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__create_fstype() */ /*------------------------------------------------------------------------- - * Function: H5MF_start_fstype + * Function: H5MF__start_fstype * * Purpose: Open or create a free space manager of a given TYPE. * Note that TYPE can be H5F_mem_page_t or H5FD_mem_t enum types. @@ -467,11 +457,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -488,18 +478,18 @@ H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) /* Check if the free space manager exists already */ if(H5F_addr_defined(f->shared->fs_addr[type])) { /* Open existing free space manager */ - if(H5MF_open_fstype(f, dxpl_id, type) < 0) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space") } /* end if */ else { /* Create new free space manager */ - if(H5MF__create_fstype(f, dxpl_id, type) < 0) + if(H5MF__create_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCREATE, FAIL, "can't initialize file free space") } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_start_fstype() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__start_fstype() */ /*------------------------------------------------------------------------- @@ -516,16 +506,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ haddr_t tmp_fs_addr; /* Temporary holder for free space manager address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* check args */ HDassert(f); @@ -545,21 +533,19 @@ H5MF__delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) */ f->shared->fs_state[type] = H5F_FS_STATE_DELETING; - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Delete free space manager for this type */ - if(H5FS_delete(f, dxpl_id, tmp_fs_addr) < 0) + if(H5FS_delete(f, tmp_fs_addr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ @@ -570,12 +556,11 @@ HDfprintf(stderr, "%s: Before deleting free space manager\n", FUNC); HDassert(!H5F_addr_defined(f->shared->fs_addr[type])); done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__delete_fstype() */ @@ -593,11 +578,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__close_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* * Check arguments. @@ -616,19 +601,19 @@ HDfprintf(stderr, "%s: Before closing free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Close an existing free space structure for the file */ - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + if(H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free space info") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_fstype() */ /*------------------------------------------------------------------------- - * Function: H5MF_add_sect + * Function: H5MF__add_sect * * Purpose: To add a section to the specified free-space manager. * @@ -640,17 +625,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5MF_free_section_t *node) +H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ - H5MF_sect_ud_t udata; /* User data for callback */ - H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ - - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + H5MF_sect_ud_t udata; /* User data for callback */ + H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) HDassert(f); HDassert(fspace); @@ -660,36 +643,35 @@ H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5 /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = TRUE; udata.allow_eoa_shrink_only = FALSE; - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_is_self_referential(f, fspace)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(fsm_ring, &orig_ring); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: adding node, node->sect_info.addr = %a, node->sect_info.size = %Hu\n", FUNC, node->sect_info.addr, node->sect_info.size); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add the section */ - if(H5FS_sect_add(f, dxpl_id, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) + if(H5FS_sect_add(f, fspace, (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_add_sect() */ + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__add_sect() */ /*------------------------------------------------------------------------- - * Function: H5MF_find_sect + * Function: H5MF__find_sect * * Purpose: To find a section from the specified free-space manager to fulfill the request. * If found, re-add the left-over space back to the manager. @@ -702,31 +684,28 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_find_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size, H5FS_t *fspace, haddr_t *addr) +H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, + haddr_t *addr) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ H5MF_free_section_t *node; /* Free space section pointer */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ htri_t ret_value = FAIL; /* Whether an existing free list node was found */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__FREESPACE_TAG) HDassert(f); HDassert(fspace); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_is_self_referential(f, fspace)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Try to get a section from the free space manager */ - if((ret_value = H5FS_sect_find(f, dxpl_id, fspace, size, (H5FS_section_info_t **)&node)) < 0) + if((ret_value = H5FS_sect_find(f, fspace, size, (H5FS_section_info_t **)&node)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "error locating free space in file") #ifdef H5MF_ALLOC_DEBUG_MORE @@ -762,19 +741,18 @@ HDfprintf(stderr, "%s: re-adding node, node->sect_info.size = %Hu\n", FUNC, node #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Re-add the section to the free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, fspace, node) < 0) + if(H5MF__add_sect(f, alloc_type, fspace, node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") } /* end else */ } /* end if */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5MF_find_sect() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5MF__find_sect() */ /*------------------------------------------------------------------------- @@ -795,16 +773,14 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t fsm_ring = H5AC_RING_INV; /* free space manager ring */ - H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t orig_ring; /* Original ring value */ H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, HADDR_UNDEF) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -817,7 +793,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ if(f->shared->first_alloc_dealloc) { HDassert(! H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "tidy of self referential fsm hack failed") } /* end if */ @@ -827,14 +803,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HDfprintf(stderr, "%s: Check 1.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Check if we are using the free space manager for this file */ if(H5F_HAVE_FREE_SPACE_MANAGER(f)) { @@ -848,14 +822,14 @@ HDfprintf(stderr, "%s: Check 1.0\n", FUNC); /* Check if the free space manager for the file has been initialized */ if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type])) { /* Open the free-space manager */ - if(H5MF_open_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space") HDassert(f->shared->fs_man[fs_type]); } /* end if */ /* Search for large enough space in the free space manager */ if(f->shared->fs_man[fs_type]) - if(H5MF_find_sect(f, alloc_type, dxpl_id, size, f->shared->fs_man[fs_type], &ret_value) < 0) + if(H5MF__find_sect(f, alloc_type, size, f->shared->fs_man[fs_type], &ret_value) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "error locating a node") } /* end if */ @@ -866,11 +840,11 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) { HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); - if(HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, dxpl_id, size))) + if(HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from paged aggregation") } /* end if */ else { /* For non-paged aggregation, continue further action */ - if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, dxpl_id, size))) + if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") } /* end else */ } /* end if */ @@ -880,19 +854,18 @@ HDfprintf(stderr, "%s: Check 3.0\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_alloc() */ @@ -918,13 +891,13 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ static haddr_t -H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { H5F_mem_page_t ptype; /* Free-space mananger type */ H5MF_free_section_t *node = NULL; /* Free space section pointer */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); @@ -951,7 +924,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ H5MF_EOA_MISALIGN(f, (eoa+size), f->shared->fs_page_size, frag_size); /* Allocate from VFD */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, alloc_type, size + frag_size, NULL, NULL))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size + frag_size, NULL, NULL))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* If there is a mis-aligned fragment at EOA */ @@ -959,7 +932,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Start up the free-space manager */ if(!(f->shared->fs_man[ptype])) - if(H5MF_start_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") /* Create free space section for the fragment */ @@ -967,7 +940,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section") /* Add the fragment to the large free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[ptype], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space") node = NULL; @@ -985,12 +958,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ haddr_t new_page; /* The address for the new file size page */ /* Allocate one file space page */ - if(HADDR_UNDEF == (new_page = H5MF_alloc(f, alloc_type, dxpl_id, f->shared->fs_page_size))) + if(HADDR_UNDEF == (new_page = H5MF_alloc(f, alloc_type, f->shared->fs_page_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Start up the free-space manager */ if(!(f->shared->fs_man[ptype])) - if(H5MF_start_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") HDassert(f->shared->fs_man[ptype]); @@ -998,7 +971,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize free space section") /* Add the remaining space in the page to the manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[ptype], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[ptype], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space") node = NULL; @@ -1024,7 +997,7 @@ done: HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ /* Release section node, if allocated and not added to section list or merged */ @@ -1032,7 +1005,7 @@ H5MF_sects_dump(f, dxpl_id, stderr); if(H5MF_sect_free((H5FS_section_info_t *)node) < 0) HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free section node") - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__alloc_pagefs() */ @@ -1111,20 +1084,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, - hsize_t size) +H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) { - H5F_io_info2_t fio_info; /* I/O info for operation */ H5F_mem_page_t fs_type; /* Free space type (mapped from allocation type) */ H5MF_free_section_t *node = NULL; /* Free space section pointer */ unsigned ctype; /* section class type */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -1137,20 +1106,18 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN if(f->shared->first_alloc_dealloc) { HDassert(!H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* we are about to change the contents of the free space manager -- * notify metadata cache that the associated fsm ring is @@ -1165,24 +1132,14 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN if(H5F_addr_le(f->shared->tmp_addr, addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, FAIL, "attempting to free temporary file space") - /* Set up I/O info for operation */ - fio_info.f = f; - if(H5FD_MEM_DRAW == alloc_type) { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + /* If it's metadata, check if the space to free intersects with the file's + * metadata accumulator + */ + if(H5FD_MEM_DRAW != alloc_type) { + /* Check if the space to free intersects with the file's metadata accumulator */ + if(H5F__accum_free(f, alloc_type, addr, size) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator") } /* end if */ - else { - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - } /* end else */ - - /* Check if the space to free intersects with the file's metadata accumulator */ - if(H5F__accum_free(&fio_info, alloc_type, addr, size) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator") /* Check if the free space manager for the file has been initialized */ if(!f->shared->fs_man[fs_type]) { @@ -1200,7 +1157,7 @@ HDfprintf(stderr, "%s: fs_addr = %a\n", FUNC, f->shared->fs_addr[fs_type]); HDfprintf(stderr, "%s: Trying to avoid starting up free space manager\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Try to shrink the file or absorb the block into a block aggregator */ - if((status = H5MF_try_shrink(f, alloc_type, dxpl_id, addr, size)) < 0) + if((status = H5MF_try_shrink(f, alloc_type, addr, size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check for absorbing block") else if(status > 0) /* Indicate success */ @@ -1234,7 +1191,7 @@ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, a * space isn't at the end of the file, so start up (or create) * the file space manager */ - if(H5MF_start_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__start_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") } /* end if */ @@ -1252,7 +1209,7 @@ HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", FUNC); #endif /* H5MF_ALLOC_DEBUG_MORE */ /* Add to the free space for the file */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[fs_type], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't add section to file free space") node = NULL; @@ -1266,13 +1223,12 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = TRUE; udata.allow_eoa_shrink_only = FALSE; /* Try to merge the section that is smaller than threshold */ - if((merged = H5FS_sect_try_merge(f, dxpl_id, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) + if((merged = H5FS_sect_try_merge(f, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't merge section to file free space") else if(merged == TRUE) /* successfully merged */ /* Indicate that the node was used */ @@ -1280,10 +1236,9 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC); } /* end else */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release section node, if allocated and not added to section list or merged */ if(node) @@ -1294,9 +1249,9 @@ done: HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_xfree() */ @@ -1323,21 +1278,19 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ htri_t -H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, - hsize_t size, hsize_t extra_requested) +H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, + hsize_t extra_requested) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* ring of fsm */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ haddr_t end; /* End of block to extend */ H5FD_mem_t map_type; /* Mapped type */ H5F_mem_page_t fs_type; /* free space type */ htri_t allow_extend = TRUE; /* Possible to extend the block */ hsize_t frag_size = 0; /* Size of mis-aligned fragment */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_requested = %Hu\n", FUNC, (unsigned)alloc_type, addr, size, extra_requested); #endif /* H5MF_ALLOC_DEBUG */ @@ -1348,7 +1301,7 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r if(f->shared->first_alloc_dealloc) { HDassert(! H5AC_cache_image_pending(f)); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ @@ -1383,18 +1336,16 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r /* Get free space type from allocation type */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); if(allow_extend) { /* Try extending the block at EOA */ - if((ret_value = H5F_try_extend(f, dxpl_id, map_type, end, extra_requested + frag_size)) < 0) + if((ret_value = H5F__try_extend(f, map_type, end, extra_requested + frag_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); @@ -1410,7 +1361,7 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); /* Start up the free-space manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_start_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__start_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") /* Create free space section for the fragment */ @@ -1418,7 +1369,7 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section") /* Add the fragment to the large-sized free-space manager */ - if(H5MF_add_sect(f, alloc_type, dxpl_id, f->shared->fs_man[fs_type], node) < 0) + if(H5MF__add_sect(f, alloc_type, f->shared->fs_man[fs_type], node) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't re-add section to file free space") node = NULL; @@ -1431,11 +1382,11 @@ HDfprintf(stderr, "%s: extended = %t\n", FUNC, ret_value); /* Check if the block is able to extend into aggregation block */ aggr = (map_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr); - if((ret_value = H5MF_aggr_try_extend(f, dxpl_id, aggr, map_type, end, extra_requested)) < 0) + if((ret_value = H5MF__aggr_try_extend(f, aggr, map_type, end, extra_requested)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block") #ifdef H5MF_ALLOC_DEBUG_MORE -HDfprintf(stderr, "%s: H5MF_aggr_try_extend = %t\n", FUNC, ret_value); +HDfprintf(stderr, "%s: H5MF__aggr_try_extend = %t\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG_MORE */ } /* end if */ @@ -1446,18 +1397,17 @@ HDfprintf(stderr, "%s: H5MF_aggr_try_extend = %t\n", FUNC, ret_value); /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; /* Check if the free space for the file has been initialized */ if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type])) /* Open the free-space manager */ - if(H5MF_open_fstype(f, dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") /* Try to extend the block into a free-space section */ if(f->shared->fs_man[fs_type]) { - if((ret_value = H5FS_sect_try_extend(f, dxpl_id, f->shared->fs_man[fs_type], addr, size, extra_requested, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) + if((ret_value = H5FS_sect_try_extend(f, f->shared->fs_man[fs_type], addr, size, extra_requested, H5FS_ADD_RETURNED_SPACE, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending block in free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Try to H5FS_sect_try_extend = %t\n", FUNC, ret_value); @@ -1478,19 +1428,18 @@ HDfprintf(stderr, "%s: Try to extend into the page end threshold = %t\n", FUNC, } /* allow_extend */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ #ifdef H5MF_ALLOC_DEBUG_DUMP -H5MF_sects_dump(f, dxpl_id, stderr); +H5MF_sects_dump(f, stderr); #endif /* H5MF_ALLOC_DEBUG_DUMP */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_try_extend() */ @@ -1509,20 +1458,17 @@ H5MF_sects_dump(f, dxpl_id, stderr); *------------------------------------------------------------------------- */ htri_t -H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, - hsize_t size) +H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) { H5MF_free_section_t *node = NULL; /* Free space section pointer */ H5MF_sect_ud_t udata; /* User data for callback */ H5FS_section_class_t *sect_cls; /* Section class */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t fsm_ring = H5AC_RING_INV; /* Ring of fsm */ - H5F_mem_page_t fs_type; /* Free space type */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - htri_t ret_value = FALSE; /* Return value */ + H5AC_ring_t fsm_ring; /* Ring of FSM */ + H5F_mem_page_t fs_type; /* Free space type */ + htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -1541,14 +1487,12 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* Get free space type from allocation type */ H5MF_alloc_to_fs_type(f, alloc_type, size, &fs_type); - /* Set the ring type in the DXPL */ + /* Set the ring type in the API context */ if(H5MF__fsm_type_is_self_referential(f, fs_type)) fsm_ring = H5AC_RING_MDFSM; else fsm_ring = H5AC_RING_RDFSM; - if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(fsm_ring, &orig_ring); /* Create free-space section for block */ if(NULL == (node = H5MF_sect_new(sect_cls->type, addr, size))) @@ -1556,7 +1500,6 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.alloc_type = alloc_type; udata.allow_sect_absorb = FALSE; /* Force section to be absorbed into aggregator */ udata.allow_eoa_shrink_only = FALSE; @@ -1574,10 +1517,9 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN } /* end if */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Free section node allocated */ if(node && H5MF_sect_free((H5FS_section_info_t *)node) < 0) @@ -1586,7 +1528,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_try_shrink() */ @@ -1603,11 +1545,11 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ herr_t -H5MF_close(H5F_t *f, hid_t dxpl_id) +H5MF_close(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1617,11 +1559,11 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared); if(H5F_PAGED_AGGR(f)) { - if((ret_value = H5MF__close_pagefs(f, dxpl_id)) < 0) + if((ret_value = H5MF__close_pagefs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'page' file space") } /* end if */ else { - if((ret_value = H5MF__close_aggrfs(f, dxpl_id)) < 0) + if((ret_value = H5MF__close_aggrfs(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't close free-space managers for 'aggr' file space") } /* end else */ @@ -1630,7 +1572,7 @@ done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_close() */ @@ -1649,11 +1591,11 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_delete_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type) +H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1672,7 +1614,7 @@ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add /* If the free space manager for this type is open, close it */ if(f->shared->fs_man[type]) - if(H5MF__close_fstype(f, dxpl_id, type) < 0) + if(H5MF__close_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") #ifdef H5MF_ALLOC_DEBUG_MORE @@ -1681,14 +1623,14 @@ HDfprintf(stderr, "%s: Check 2.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add /* If there is free space manager info for this type, delete it */ if(H5F_addr_defined(f->shared->fs_addr[type])) - if(H5MF__delete_fstype(f, dxpl_id, type) < 0) + if(H5MF__delete_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't delete the free space manager") done: #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF__close_delete() */ @@ -1707,16 +1649,14 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ herr_t -H5MF_try_close(H5F_t *f, hid_t dxpl_id) +H5MF_try_close(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1740,23 +1680,20 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); */ if(f->shared->first_alloc_dealloc) { if(H5AC_cache_image_pending(f)) { - if(H5AC_force_cache_image_load(f, dxpl_id) < 0) + if(H5AC_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "forced cache image load failed") } /* end if */ else { - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end else */ } /* end if */ - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; if(H5F_PAGED_AGGR(f)) { @@ -1771,14 +1708,12 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring ) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ - if(H5MF__close_delete_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__close_delete_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") } /* end for */ } /* end if */ @@ -1789,33 +1724,30 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * get each free list's space */ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { - /* test to see if we need to switch rings -- do so if required */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ - if(H5MF__close_delete_fstype(f, dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__close_delete_fstype(f, (H5F_mem_page_t)type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") } /* end for */ } /* end else */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_try_close() */ @@ -1832,17 +1764,15 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_aggrfs(H5F_t *f, hid_t dxpl_id) +H5MF__close_aggrfs(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5FD_mem_t type; /* Memory type for iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ + H5FD_mem_t type; /* Memory type for iteration */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1853,23 +1783,20 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->lf); HDassert(f->shared->sblock); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Free the space in aggregators */ /* (for space not at EOA, it may be put into free space managers) */ - if(H5MF_free_aggrs(f, dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* Making free-space managers persistent for superblock version >= 2 */ @@ -1906,29 +1833,25 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_pre_fsm_fsalloc; /* Write the free space manager message -- message must already exist */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Close the free space managers */ for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { if(f->shared->fs_man[type]) { - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + if(H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") f->shared->fs_man[type] = NULL; f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; @@ -1952,7 +1875,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* get the eoa, and verify that it has the expected value */ @@ -1967,30 +1890,29 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); } /* end if */ else { /* super_vers can be 0, 1, 2 */ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) - if(H5MF__close_delete_fstype(f, dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__close_delete_fstype(f, (H5F_mem_page_t)type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") } /* end else */ /* Free the space in aggregators (again) */ /* (in case any free space information re-started them) */ - if(H5MF_free_aggrs(f, dxpl_id) < 0) + if(H5MF_free_aggrs(f) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_aggrfs() */ @@ -2006,20 +1928,16 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_pagefs(H5F_t *f, hid_t dxpl_id) +H5MF__close_pagefs(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* ring value needed for this - * iteration. - */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ H5F_mem_page_t ptype; /* Memory type for iteration */ H5O_fsinfo_t fsinfo; /* File space info message */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -2032,18 +1950,15 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f->shared->fs_page_size); HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Trying shrinking the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* Set up file space info message */ @@ -2080,30 +1995,26 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); fsinfo.eoa_pre_fsm_fsalloc = f->shared->eoa_pre_fsm_fsalloc; /* Write the free space manager message -- message must already exist */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") /* Close the free space managers */ /* use H5MF__close_fstype() for this? */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) { if(f->shared->fs_man[ptype]) { - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, ptype)) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ HDassert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); - if(H5FS_close(f, dxpl_id, f->shared->fs_man[ptype]) < 0) + if(H5FS_close(f, f->shared->fs_man[ptype]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") f->shared->fs_man[ptype] = NULL; f->shared->fs_state[ptype] = H5F_FS_STATE_CLOSED; @@ -2118,7 +2029,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* get the eoa, and verify that it has the expected value */ @@ -2151,30 +2062,29 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); * and get each free list's space */ for(ptype = H5F_MEM_PAGE_META; ptype < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, ptype)) - if(H5MF__close_delete_fstype(f, dxpl_id, ptype) < 0) + if(H5MF__close_delete_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close the free space manager") /* Write file space info message to superblock extension object header */ /* Create the superblock extension object header in advance if needed */ - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension") } /* end else */ /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Leaving\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_pagefs() */ @@ -2191,21 +2101,19 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) +H5MF__close_shrink_eoa(H5F_t *f) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ H5F_mem_t type; - H5F_mem_page_t ptype; /* Memory type for iteration */ + H5F_mem_page_t ptype; /* Memory type for iteration */ hbool_t eoa_shrank; /* Whether an EOA shrink occurs */ htri_t status; /* Status value */ H5MF_sect_ud_t udata; /* User data for callback */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_STATIC_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__FREESPACE_TAG) /* check args */ HDassert(f); @@ -2213,14 +2121,11 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) /* Construct user data for callbacks */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.allow_sect_absorb = FALSE; udata.allow_eoa_shrink_only = TRUE; - /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(1)") - reset_ring = TRUE; + /* Set the ring type in the API context */ + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Iterate until no more EOA shrinking occurs */ @@ -2236,16 +2141,14 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ udata.alloc_type = (H5FD_mem_t)((H5FD_mem_t)ptype < H5FD_MEM_NTYPES ? ptype : ((ptype % H5FD_MEM_NTYPES) + 1)); - if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[ptype], &udata)) < 0) + if((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[ptype], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2261,16 +2164,14 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ udata.alloc_type = type; - if((status = H5FS_sect_try_shrink_eoa(f, dxpl_id, f->shared->fs_man[type], &udata)) < 0) + if((status = H5FS_sect_try_shrink_eoa(f, f->shared->fs_man[type], &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2278,7 +2179,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) } /* end for */ /* check the two aggregators */ - if((status = H5MF_aggrs_try_shrink_eoa(f, dxpl_id)) < 0) + if((status = H5MF_aggrs_try_shrink_eoa(f)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") else if(status > 0) eoa_shrank = TRUE; @@ -2286,12 +2187,11 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id) } while(eoa_shrank); done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF__close_shrink_eoa() */ @@ -2309,7 +2209,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size) +H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) { haddr_t ma_addr = HADDR_UNDEF; /* Base "metadata aggregator" address */ hsize_t ma_size = 0; /* Size of "metadata aggregator" */ @@ -2323,28 +2223,23 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si H5F_mem_page_t end_type; /* Memory type for iteration */ htri_t fs_started[H5F_MEM_PAGE_NTYPES]; /* Indicate whether the free-space manager has been started */ haddr_t fs_eoa[H5FD_MEM_NTYPES]; /* EAO for each free-space manager */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ - herr_t ret_value = SUCCEED; /* Return value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); HDassert(f->shared); HDassert(f->shared->lf); - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Determine start/end points for loop */ @@ -2377,23 +2272,19 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si /* Check if the free space for the file has been initialized */ if(!f->shared->fs_man[type] && H5F_addr_defined(f->shared->fs_addr[type])) { - if(H5MF_open_fstype(f, dxpl_id, type) < 0) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") HDassert(f->shared->fs_man[type]); fs_started[type] = TRUE; } /* end if */ - /* test to see if we need to switch rings -- do - * so if required - */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, (H5F_mem_page_t)type)) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -2421,15 +2312,13 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(needed_ring, &curr_ring); curr_ring = needed_ring; } /* end if */ if(fs_started[type]) - if(H5MF__close_fstype(f, dxpl_id, type) < 0) + if(H5MF__close_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space") } /* end for */ @@ -2441,12 +2330,11 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si *meta_size = tot_meta_size; done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_get_freespace() */ @@ -2463,20 +2351,18 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info) +H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t *sect_info) { - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration. */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ size_t total_sects = 0; /* Total number of sections */ H5MF_sect_iter_ud_t sect_udata; /* User data for callback */ H5F_mem_page_t start_type, end_type; /* Memory types to iterate over */ H5F_mem_page_t ty; /* Memory type for iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, -1) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); @@ -2497,11 +2383,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, */ if(f->shared->first_alloc_dealloc) { if(H5AC_cache_image_pending(f)) { - if(H5AC_force_cache_image_load(f, dxpl_id) < 0) + if(H5AC_force_cache_image_load(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "forced cache image load failed") } /* end if */ else { - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end else */ } /* end if */ @@ -2523,14 +2409,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, sect_udata.sect_count = nsects; sect_udata.sect_idx = 0; - /* Set the ring type in the DXPL. In most cases, we will + /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initialy set the ring in - * the DXPL to that value. We will alter this later if - * needed. + * the DXPL to that value. We will alter this later if needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(0)") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_RDFSM, &orig_ring); curr_ring = H5AC_RING_RDFSM; /* Iterate over memory types, retrieving the number of sections of each type */ @@ -2543,15 +2426,13 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (1)") + H5AC_set_ring(needed_ring, &curr_ring); curr_ring = needed_ring; } /* end if */ if(!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) { - if(H5MF_open_fstype(f, dxpl_id, ty) < 0) + if(H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") HDassert(f->shared->fs_man[ty]); fs_started = TRUE; @@ -2559,7 +2440,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, /* Check if there's free space sections of this type */ if(f->shared->fs_man[ty]) - if(H5MF__get_free_sects(f, dxpl_id, f->shared->fs_man[ty], §_udata, &nums) < 0) + if(H5MF__get_free_sects(f, f->shared->fs_man[ty], §_udata, &nums) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get section info for the free space manager") /* Increment total # of sections */ @@ -2567,7 +2448,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, /* Close the free space manager of this type, if we started it here */ if(fs_started) - if(H5MF__close_fstype(f, dxpl_id, ty) < 0) + if(H5MF__close_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space") if((H5F_PAGED_AGGR(f)) && (type != H5FD_MEM_DEFAULT)) ty = (H5F_mem_page_t)(ty + H5FD_MEM_NTYPES - 2); @@ -2577,12 +2458,11 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, ret_value = (ssize_t)total_sects; done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, -1) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_get_free_sections() */ @@ -2630,7 +2510,7 @@ H5MF_sects_cb(H5FS_section_info_t *_sect, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums) +H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, size_t *nums) { hsize_t hnums = 0; /* # of sections */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2651,7 +2531,7 @@ H5MF__get_free_sects(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5MF_sect_iter_ud_ /* Check if we should retrieve the section info */ if(sect_udata->sects && *nums > 0) /* Iterate over all the free space sections of this type, adding them to the user's section info */ - if(H5FS_sect_iterate(f, dxpl_id, fspace, H5MF_sects_cb, sect_udata) < 0) + if(H5FS_sect_iterate(f, fspace, H5MF_sects_cb, sect_udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_BADITER, FAIL, "can't iterate over sections") done: @@ -2761,7 +2641,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) +H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) { int pass_count; hsize_t alloc_size; @@ -2769,14 +2649,12 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) H5F_mem_page_t fsm_type; /* FSM type for iteration */ H5O_fsinfo_t fsinfo; /* Free space manager info message */ H5FS_stat_t fs_stat; /* Information for free-space manager */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - H5AC_ring_t curr_ring = H5AC_RING_INV; /* Current ring value */ - H5AC_ring_t needed_ring = H5AC_RING_INV; /* Ring value needed for this iteration */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ + H5AC_ring_t curr_ring; /* Current ring value */ + H5AC_ring_t needed_ring; /* Ring value needed for this iteration. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ HDassert(f); @@ -2821,7 +2699,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * is enabled -- skip this if so. */ /* Vailin -- is this correct? */ - if(!H5F_PAGED_AGGR(f) && (H5MF_free_aggrs(f, dxpl_id) < 0)) + if(!H5F_PAGED_AGGR(f) && (H5MF_free_aggrs(f) < 0)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Set the ring type in the DXPL. In most cases, we will @@ -2829,9 +2707,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * the DXPL to that value. We will alter this later if * needed. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(0)") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); curr_ring = H5AC_RING_MDFSM; /* b) Free the file space (if any) allocated to each free space manager. @@ -2895,7 +2771,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Sanity check */ HDassert(fsm_opened[fsm_type] == FALSE); - if(H5MF_open_fstype(f, dxpl_id, fsm_type) < 0) + if(H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") fsm_opened[fsm_type] = TRUE; } /* end if */ @@ -2907,10 +2783,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -2924,7 +2798,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * reallocate later if the free space manager contains * any free space. */ - if(H5FS_free(f, f->shared->fs_man[fsm_type], dxpl_id, TRUE) < 0) + if(H5FS_free(f, f->shared->fs_man[fsm_type], TRUE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[fsm_type] = HADDR_UNDEF; } /* end if */ @@ -2950,11 +2824,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * Leave it in for now, but consider removing it. */ if(H5F_addr_defined(f->shared->sblock->ext_addr)) - if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_FSINFO_ID) < 0) + if(H5F__super_ext_remove_msg(f, H5O_FSINFO_ID) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "error in removing message from superblock extension") /* As the final element in 1), shrink the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") @@ -2980,7 +2854,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) fsinfo.pgend_meta_thres = f->shared->pgend_meta_thres; fsinfo.eoa_pre_fsm_fsalloc = HADDR_UNDEF; - if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) + if(H5F__super_ext_write_msg(f, H5O_FSINFO_ID, &fsinfo, TRUE, H5O_MSG_FLAG_MARK_IF_UNKNOWN) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing fsinfo message to superblock extension") @@ -3029,15 +2903,13 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) else /* paged allocation disabled -- should be unreachable */ HDassert(FALSE); - /* test to see if we need to switch rings -- do so if required */ + /* Test to see if we need to switch rings -- do so if required */ if(H5MF__fsm_type_is_self_referential(f, fsm_type)) needed_ring = H5AC_RING_MDFSM; else needed_ring = H5AC_RING_RDFSM; - if(needed_ring != curr_ring) { - if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring)< 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(needed_ring, NULL); curr_ring = needed_ring; } /* end if */ @@ -3072,13 +2944,13 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(!H5F_addr_defined(fs_stat.addr)); /* Allocate FSM header */ - if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type], dxpl_id) < 0) + if(H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], &f->shared->fs_addr[fsm_type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocated free-space header") /* Allocate FSM section info */ HDassert(!H5F_addr_defined(fs_stat.sect_addr)); HDassert(fs_stat.alloc_sect_size == 0); - if(H5FS_alloc_sect(f, f->shared->fs_man[fsm_type], dxpl_id) < 0 ) + if(H5FS_alloc_sect(f, f->shared->fs_man[fsm_type]) < 0 ) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") #ifndef NDEBUG @@ -3104,7 +2976,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* Close any opened FSMs */ if(fsm_opened[fsm_type]) { - if(H5MF__close_fstype(f, dxpl_id, fsm_type) < 0) + if(H5MF__close_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space manager") fsm_opened[fsm_type] = FALSE; } /* end if */ @@ -3121,12 +2993,11 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_settle_raw_data_fsm() */ @@ -3233,7 +3104,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) +H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) { H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ @@ -3247,12 +3118,10 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - hbool_t reset_ring = FALSE; /* Whether we set the ring */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ HDassert(f); @@ -3303,10 +3172,8 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) lg_sinfo_fspace = f->shared->fs_man[lg_fssinfo_fs_type]; } /* end if */ - /* Set the ring in the dxpl appropriately for subsequent calls */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + /* Set the ring in the API context appropriately for subsequent calls */ + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); #ifndef NDEBUG { @@ -3371,11 +3238,11 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) */ /* Vailin -- is this correct? */ /* (for space not at EOF, it may be put into free space managers) */ - if((!H5F_PAGED_AGGR(f)) && (H5MF_free_aggrs(f, dxpl_id) < 0)) + if((!H5F_PAGED_AGGR(f)) && (H5MF_free_aggrs(f) < 0)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregators") /* Trying shrinking the EOA for the file */ - if(H5MF__close_shrink_eoa(f, dxpl_id) < 0) + if(H5MF__close_shrink_eoa(f) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa") /* At this point, the EOA should be set to a value that contains @@ -3465,20 +3332,20 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) * the fragment on the floor for now. */ if(sm_hdr_fspace) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, sm_hdr_fspace, &(f->shared->fs_addr[sm_fshdr_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, sm_hdr_fspace, &(f->shared->fs_addr[sm_fshdr_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sm hdr FSM file space") if(sm_sinfo_fspace && (sm_sinfo_fspace != sm_hdr_fspace)) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, sm_sinfo_fspace, &(f->shared->fs_addr[sm_fssinfo_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, sm_sinfo_fspace, &(f->shared->fs_addr[sm_fssinfo_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate sm sinfo FSM file space") if(H5F_PAGED_AGGR(f)) { if(lg_hdr_fspace) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, lg_hdr_fspace, &(f->shared->fs_addr[lg_fshdr_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, lg_hdr_fspace, &(f->shared->fs_addr[lg_fshdr_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate lg hdr FSM file space") if(lg_sinfo_fspace && (lg_sinfo_fspace != lg_hdr_fspace)) - if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, dxpl_id, lg_sinfo_fspace, &(f->shared->fs_addr[lg_fssinfo_fs_type])) < 0) + if(H5FS_vfd_alloc_hdr_and_section_info_if_needed(f, lg_sinfo_fspace, &(f->shared->fs_addr[lg_fssinfo_fs_type])) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't vfd allocate lg sinfo FSM file space") } /* end if */ @@ -3503,11 +3370,11 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) } /* end if */ done: - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_settle_meta_data_fsm() */ @@ -3686,11 +3553,10 @@ H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace) *------------------------------------------------------------------------- */ herr_t -H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) +H5MF_tidy_self_referential_fsm_hack(H5F_t *f) { haddr_t eoa; /* EOA of file */ hsize_t tail_size = 0; /* Size of chunk to free */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t first_srfsm_hdr = HADDR_UNDEF; /* Addr of first self referential */ /* fsm header in file */ @@ -3699,10 +3565,9 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) H5F_mem_page_t sm_fssinfo_fs_type; /* Small fs sinfo fsm */ H5F_mem_page_t lg_fshdr_fs_type; /* Large fs hdr fsm */ H5F_mem_page_t lg_fssinfo_fs_type; /* Large fs sinfo fsm */ - hbool_t reset_ring = FALSE; /* Whether the ring was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ HDassert(f); @@ -3710,12 +3575,10 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(f->shared->fs_persist); HDassert(f->shared->first_alloc_dealloc); - /* Set the ring type in the DXPL. Since we are only dealing with + /* Set the ring type in the API context. Since we are only dealing with * self referential FSMs, we will only need H5AC_RING_MDFSM. */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_MDFSM, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value") - reset_ring = TRUE; + H5AC_set_ring(H5AC_RING_MDFSM, &orig_ring); /* 1) Verify that f->shared->first_alloc_dealloc is TRUE, * and then set it to FALSE. @@ -3763,7 +3626,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) first_srfsm_hdr = f->shared->fs_addr[sm_fshdr_fs_type]; /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, sm_fshdr_fs_type) < 0) + if(H5MF__open_fstype(f, sm_fshdr_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[sm_fshdr_fs_type]); @@ -3780,7 +3643,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[sm_fssinfo_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, sm_fssinfo_fs_type) < 0) + if(H5MF__open_fstype(f, sm_fssinfo_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[sm_fssinfo_fs_type]); @@ -3808,7 +3671,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[lg_fshdr_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, lg_fshdr_fs_type) < 0) + if(H5MF__open_fstype(f, lg_fshdr_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[lg_fshdr_fs_type]); } /* end if */ @@ -3822,7 +3685,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(NULL == f->shared->fs_man[lg_fssinfo_fs_type]); /* open the FSM */ - if(H5MF_open_fstype(f, dxpl_id, lg_fssinfo_fs_type) < 0) + if(H5MF__open_fstype(f, lg_fssinfo_fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space manager") HDassert(f->shared->fs_man[lg_fssinfo_fs_type]); } /* end if */ @@ -3837,7 +3700,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[sm_fshdr_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[sm_fshdr_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[sm_fshdr_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3849,7 +3712,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[sm_fssinfo_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[sm_fssinfo_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't release free-space headers") f->shared->fs_addr[sm_fssinfo_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3862,7 +3725,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[lg_fshdr_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[lg_fshdr_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't float free-space headers") f->shared->fs_addr[lg_fshdr_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3874,7 +3737,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert(H5F_addr_defined(fs_stat.addr)); HDassert(H5F_addr_defined(fs_stat.sect_addr)); - if(H5FS_free(f, f->shared->fs_man[lg_fssinfo_fs_type], dxpl_id, FALSE) < 0) + if(H5FS_free(f, f->shared->fs_man[lg_fssinfo_fs_type], FALSE) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't float free-space headers") f->shared->fs_addr[lg_fssinfo_fs_type] = HADDR_UNDEF; } /* end if */ @@ -3902,7 +3765,7 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) tail_size = (hsize_t)(eoa - f->shared->eoa_pre_fsm_fsalloc); /* Release file space allocated to self referential FSMs */ - if(H5F_free(f, dxpl_id, H5FD_MEM_DEFAULT, f->shared->eoa_pre_fsm_fsalloc, tail_size) < 0) + if(H5F__free(f, H5FD_MEM_DEFAULT, f->shared->eoa_pre_fsm_fsalloc, tail_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get EOA") @@ -3913,11 +3776,10 @@ H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id) HDassert((!H5F_PAGED_AGGR(f)) || (0 == (eoa % f->shared->fs_page_size))); done: - /* Reset the ring in the DXPL */ - if(reset_ring) - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_tidy_self_referential_fsm_hack() */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 7c05e0d..cd80a10 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -55,9 +55,9 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, +static herr_t H5MF__aggr_free(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr); -static haddr_t H5MF__aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +static haddr_t H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size); @@ -95,7 +95,7 @@ static haddr_t H5MF__aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, *------------------------------------------------------------------------- */ haddr_t -H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) +H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; /* Return value */ @@ -113,12 +113,12 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ /* Couldn't find anything from the free space manager, go allocate some */ if(alloc_type != H5FD_MEM_DRAW && alloc_type != H5FD_MEM_GHEAP) { /* Handle metadata differently from "raw" data */ - if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, dxpl_id, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size))) + if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata") } /* end if */ else { /* Allocate "raw" data: H5FD_MEM_DRAW and H5FD_MEM_GHEAP */ - if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size))) + if(HADDR_UNDEF == (ret_value = H5MF__aggr_alloc(f, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data") } /* end else */ @@ -149,8 +149,8 @@ HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, *------------------------------------------------------------------------- */ static haddr_t -H5MF__aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, - H5F_blk_aggr_t *other_aggr, H5FD_mem_t type, hsize_t size) +H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, + H5FD_mem_t type, hsize_t size) { haddr_t eoa_frag_addr = HADDR_UNDEF; /* Address of fragment at EOA */ hsize_t eoa_frag_size = 0; /* Size of fragment at EOA */ @@ -218,7 +218,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space") - if((aggr->addr > 0) && (extended = H5F_try_extend(f, dxpl_id, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) + if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space") else if (extended) { /* aggr->size is unchanged */ @@ -232,12 +232,12 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz */ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) && (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) { - if(H5MF__aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0) + if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") } /* end if */ /* Allocate space from the VFD (i.e. at the end of the file) */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, alloc_type, size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, alloc_type, size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") } /* end else */ } /* end if */ @@ -256,7 +256,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); if(H5F_addr_gt((aggr->addr + aggr->size + ext_size), f->shared->tmp_addr)) HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, HADDR_UNDEF, "'normal' file space allocation request will overlap into 'temporary' file space") - if((aggr->addr > 0) && (extended = H5F_try_extend(f, dxpl_id, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) + if((aggr->addr > 0) && (extended = H5F__try_extend(f, alloc_type, (aggr->addr + aggr->size), ext_size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't extending space") else if(extended) { aggr->addr += aggr_frag_size; @@ -272,17 +272,17 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); */ if((other_aggr->size > 0) && (H5F_addr_eq((other_aggr->addr + other_aggr->size), eoa)) && (other_aggr->tot_size > other_aggr->size) && ((other_aggr->tot_size - other_aggr->size) >= other_aggr->alloc_size)) { - if(H5MF__aggr_free(f, dxpl_id, other_alloc_type, other_aggr) < 0) + if(H5MF__aggr_free(f, other_alloc_type, other_aggr) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") } /* end if */ /* Allocate space from the VFD (i.e. at the end of the file) */ - if(HADDR_UNDEF == (new_space = H5F_alloc(f, dxpl_id, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (new_space = H5F__alloc(f, alloc_type, aggr->alloc_size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Return the unused portion of the block to a free list */ if(aggr->size > 0) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr->addr, aggr->size) < 0) + if(H5MF_xfree(f, alloc_type, aggr->addr, aggr->size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation block") /* If the block is not to be aligned, fold the eoa fragment @@ -315,12 +315,12 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* Freeing any possible fragment due to file allocation */ if(eoa_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, eoa_frag_addr, eoa_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment") /* Freeing any possible fragment due to alignment in the block after extension */ if(extended && aggr_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end if */ else { @@ -331,19 +331,19 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* free any possible fragment */ if(aggr_frag_size) - if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end else */ } /* end if */ else { /* Allocate data from the file */ - if(HADDR_UNDEF == (ret_value = H5F_alloc(f, dxpl_id, type, size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (ret_value = H5F__alloc(f, type, size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate file space") /* Check if fragment was generated */ if(eoa_frag_size) /* Put fragment on the free list */ - if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) + if(H5MF_xfree(f, type, eoa_frag_addr, eoa_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment") } /* end else */ @@ -363,7 +363,7 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); /*------------------------------------------------------------------------- - * Function: H5MF_aggr_try_extend + * Function: H5MF__aggr_try_extend * * Purpose: Check if a block is inside an aggregator block and extend it * if possible. @@ -388,12 +388,12 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); *------------------------------------------------------------------------- */ htri_t -H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_requested) { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -431,7 +431,7 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, else { hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested; - if((ret_value = H5F_try_extend(f, dxpl_id, type, (aggr->addr + aggr->size), extra)) < 0) + if((ret_value = H5F__try_extend(f, type, (aggr->addr + aggr->size), extra)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") else if(ret_value == TRUE) { /* Shift the aggregator block by the extra requested */ @@ -467,7 +467,7 @@ H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggr_try_extend() */ +} /* end H5MF__aggr_try_extend() */ /*------------------------------------------------------------------------- @@ -648,7 +648,7 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, /*------------------------------------------------------------------------- - * Function: H5MF_aggr_reset + * Function: H5MF__aggr_reset * * Purpose: Reset a block aggregator, returning any space back to file * @@ -661,12 +661,12 @@ H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, *------------------------------------------------------------------------- */ static herr_t -H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr) +H5MF__aggr_reset(H5F_t *f, H5F_blk_aggr_t *aggr) { H5FD_mem_t alloc_type; /* Type of file memory to work with */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -695,13 +695,13 @@ HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", FUNC, tmp_addr, tmp_siz /* Return the unused portion of the metadata block to the file */ if(tmp_size > 0 && (H5F_INTENT(f) & H5F_ACC_RDWR)) - if(H5MF_xfree(f, alloc_type, dxpl_id, tmp_addr, tmp_size) < 0) + if(H5MF_xfree(f, alloc_type, tmp_addr, tmp_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't release aggregator's free space") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5MF_aggr_reset() */ +} /* end H5MF__aggr_reset() */ /*------------------------------------------------------------------------- @@ -719,7 +719,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id) +H5MF_free_aggrs(H5F_t *f) { H5F_blk_aggr_t *first_aggr; /* First aggregator to reset */ H5F_blk_aggr_t *second_aggr; /* Second aggregator to reset */ @@ -764,9 +764,9 @@ H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id) /* Release the unused portion of the metadata and "small data" blocks back * to the free lists in the file. */ - if(H5MF_aggr_reset(f, dxpl_id, first_aggr) < 0) + if(H5MF__aggr_reset(f, first_aggr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset metadata block") - if(H5MF_aggr_reset(f, dxpl_id, second_aggr) < 0) + if(H5MF__aggr_reset(f, second_aggr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't reset 'small data' block") done: FUNC_LEAVE_NOAPI(ret_value) @@ -826,7 +826,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5F_blk_aggr_t *aggr) +H5MF__aggr_free(H5F_t *f, H5FD_mem_t type, H5F_blk_aggr_t *aggr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -843,7 +843,7 @@ H5MF__aggr_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, H5F_blk_aggr_t *aggr) HDassert(f->shared->feature_flags & aggr->feature_flag); /* Free the remaining space at EOA in the aggregator */ - if(H5F_free(f, dxpl_id, type, aggr->addr, aggr->size) < 0) + if(H5F__free(f, type, aggr->addr, aggr->size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free aggregation block") /* Reset the aggregator */ @@ -870,7 +870,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id) +H5MF_aggrs_try_shrink_eoa(H5F_t *f) { htri_t ma_status; /* Whether the metadata aggregator can shrink the EOA */ htri_t sda_status; /* Whether the small data aggregator can shrink the EOA */ @@ -885,13 +885,13 @@ H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id) if((ma_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats") if(ma_status > 0) - if(H5MF__aggr_free(f, dxpl_id, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0) + if(H5MF__aggr_free(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") if((sda_status = H5MF_aggr_can_shrink_eoa(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr))) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats") if(sda_status > 0) - if(H5MF__aggr_free(f, dxpl_id, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0) + if(H5MF__aggr_free(f, H5FD_MEM_DRAW, &(f->shared->sdata_aggr)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa") ret_value = (ma_status || sda_status); diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 0b300ba..592ca87 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -153,12 +153,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int indent, int fwidth) +H5MF_sects_debug(H5F_t *f, haddr_t fs_addr, FILE *stream, int indent, int fwidth) { H5F_mem_page_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* * Check arguments. @@ -171,7 +171,7 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind for(type = H5F_MEM_PAGE_DEFAULT; type < H5F_MEM_PAGE_NTYPES; H5_INC_ENUM(H5F_mem_page_t, type)) if(H5F_addr_eq(f->shared->fs_addr[type], fs_addr)) { if(!f->shared->fs_man[type]) - if(H5MF_open_fstype(f, dxpl_id, type) < 0) + if(H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") if(f->shared->fs_man[type]) { @@ -184,18 +184,18 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind udata.fwidth = fwidth; /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") /* Close the free space information */ - if(H5FS_close(f, dxpl_id, f->shared->fs_man[type]) < 0) + if(H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't release free space info") } /* end if */ break; } /* end if */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* H5MF_sects_debug() */ #ifdef H5MF_ALLOC_DEBUG_DUMP @@ -214,14 +214,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream) +H5MF_sects_dump(H5F_t *f, FILE *stream) { haddr_t eoa; /* End of allocated space in the file */ int indent = 0; /* Amount to indent */ int fwidth = 50; /* Field width */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -260,7 +260,7 @@ HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); udata.fwidth = MAX(0, fwidth - 6); /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[ptype], H5MF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, f->shared->fs_man[ptype], H5MF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") } /* end if */ else @@ -313,7 +313,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, udata.fwidth = MAX(0, fwidth - 6); /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[atype], H5MF_sects_debug_cb, &udata) < 0) + if(H5FS_sect_iterate(f, f->shared->fs_man[atype], H5MF_sects_debug_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") } /* end if */ else /* No sections of this type */ @@ -326,7 +326,7 @@ HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, done: HDfprintf(stderr, "%s: Done dumping file free space sections\n", FUNC); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5MF_sects_dump() */ #endif /* H5MF_ALLOC_DEBUG_DUMP */ diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index b95a6db..fbf9ee8 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -146,7 +146,6 @@ typedef enum { typedef struct H5MF_sect_ud_t { /* Down */ H5F_t *f; /* Pointer to file to operate on */ - hid_t dxpl_id; /* DXPL for VFD operations */ H5FD_mem_t alloc_type; /* Type of memory being allocated */ hbool_t allow_sect_absorb; /* Whether sections are allowed to absorb a block aggregator */ hbool_t allow_eoa_shrink_only; /* Whether shrinking eoa is allowed only for the section */ @@ -181,13 +180,13 @@ H5_DLLVAR H5FS_section_class_t H5MF_FSPACE_SECT_CLS_LARGE[1]; /******************************/ /* Allocator routines */ -H5_DLL herr_t H5MF_open_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); -H5_DLL herr_t H5MF_start_fstype(H5F_t *f, hid_t dxpl_id, H5F_mem_page_t type); +H5_DLL herr_t H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type); +H5_DLL herr_t H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type); -H5_DLL htri_t H5MF_find_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size, H5FS_t *fspace, haddr_t *addr); -H5_DLL herr_t H5MF_add_sect(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, H5FS_t *fspace, H5MF_free_section_t *node); +H5_DLL htri_t H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, haddr_t *addr); +H5_DLL herr_t H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_section_t *node); -H5_DLL herr_t H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream); +H5_DLL herr_t H5MF_sects_dump(H5F_t *f, FILE *stream); H5_DLL void H5MF_alloc_to_fs_type(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5F_mem_page_t *fs_type); @@ -198,7 +197,7 @@ H5_DLL herr_t H5MF_sect_free(H5FS_section_info_t *sect); /* Block aggregator routines */ -H5_DLL htri_t H5MF_aggr_try_extend(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, +H5_DLL htri_t H5MF__aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, haddr_t abs_blk_end, hsize_t extra_requested); H5_DLL htri_t H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, const H5MF_free_section_t *sect, H5MF_shrink_type_t *shrink); diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h index bfeaa33..58e5054 100644 --- a/src/H5MFprivate.h +++ b/src/H5MFprivate.h @@ -49,32 +49,32 @@ /* File space manager routines */ H5_DLL herr_t H5MF_init_merge_flags(H5F_t *f); -H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_size); -H5_DLL herr_t H5MF_close(H5F_t *f, hid_t dxpl_id); -H5_DLL herr_t H5MF_try_close(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size); +H5_DLL herr_t H5MF_close(H5F_t *f); +H5_DLL herr_t H5MF_try_close(H5F_t *f); /* File space allocation routines */ -H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); -H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, +H5_DLL haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hsize_t size); +H5_DLL haddr_t H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t type, hsize_t size); +H5_DLL herr_t H5MF_xfree(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size); -H5_DLL herr_t H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - haddr_t addr, hsize_t size, hsize_t extra_requested); -H5_DLL htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, - haddr_t addr, hsize_t size); -H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, - size_t nsects, H5F_sect_info_t *sect_info); +H5_DLL herr_t H5MF_try_extend(H5F_t *f, H5FD_mem_t type, haddr_t addr, + hsize_t size, hsize_t extra_requested); +H5_DLL htri_t H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, + hsize_t size); +H5_DLL ssize_t H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, + H5F_sect_info_t *sect_info); /* File 'temporary' space allocation routines */ H5_DLL haddr_t H5MF_alloc_tmp(H5F_t *f, hsize_t size); /* 'block aggregator' routines */ -H5_DLL herr_t H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id); -H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5MF_free_aggrs(H5F_t *f); +H5_DLL htri_t H5MF_aggrs_try_shrink_eoa(H5F_t *f); /* Free space manager settling routines */ -H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); -H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled); +H5_DLL herr_t H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled); +H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled); /* This function has to be declared in H5MFprivate.h as it is needed * in our test code to allow us to manually start a self referential @@ -82,12 +82,12 @@ H5_DLL herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_se * deallocation without causing assertion failures on the first * file space allocation / deallocation. */ -H5_DLL herr_t H5MF_tidy_self_referential_fsm_hack(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5MF_tidy_self_referential_fsm_hack(H5F_t *f); /* Debugging routines */ #ifdef H5MF_DEBUGGING -H5_DLL herr_t H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, - FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5MF_sects_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, + int fwidth); #endif /* H5MF_DEBUGGING */ #endif /* end _H5MFprivate_H */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 02e3218..4c021b2 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -57,10 +57,9 @@ /* 'simple/small/large' section callbacks */ static H5FS_section_info_t *H5MF_sect_deserialize(const H5FS_section_class_t *cls, - hid_t dxpl_id, const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, - unsigned *des_flags); + const uint8_t *buf, haddr_t sect_addr, hsize_t sect_size, unsigned *des_flags); static herr_t H5MF_sect_valid(const H5FS_section_class_t *cls, - const H5FS_section_info_t *sect, hid_t dxpl_id); + const H5FS_section_info_t *sect); static H5FS_section_info_t *H5MF_sect_split(H5FS_section_info_t *sect, hsize_t frag_size); @@ -145,8 +144,8 @@ H5FS_section_class_t H5MF_FSPACE_SECT_CLS_SMALL[1] = {{ H5MF_sect_deserialize, /* Deserialize section */ H5MF_sect_small_can_merge, /* Can sections merge? */ H5MF_sect_small_merge, /* Merge sections */ - NULL, /* Can section shrink container?*/ - NULL, /* Shrink container w/section */ + H5MF_sect_small_can_shrink, /* Can section shrink container?*/ + H5MF_sect_small_shrink, /* Shrink container w/section */ H5MF_sect_free, /* Free section */ H5MF_sect_valid, /* Check validity of section */ H5MF_sect_split, /* Split section node for alignment */ @@ -285,7 +284,7 @@ H5MF_sect_free(H5FS_section_info_t *_sect) */ static H5FS_section_info_t * H5MF_sect_deserialize(const H5FS_section_class_t *cls, - hid_t H5_ATTR_UNUSED dxpl_id, const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, + const uint8_t H5_ATTR_UNUSED *buf, haddr_t sect_addr, hsize_t sect_size, unsigned H5_ATTR_UNUSED *des_flags) { H5MF_free_section_t *sect; /* New section */ @@ -329,7 +328,7 @@ H5MF_sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, #ifdef NDEBUG H5_ATTR_UNUSED #endif /* NDEBUG */ - *_sect, hid_t H5_ATTR_UNUSED dxpl_id) + *_sect) { #ifndef NDEBUG const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */ @@ -594,7 +593,7 @@ H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); /* Release section's space at EOA */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") } /* end if */ else { @@ -772,7 +771,7 @@ H5MF_sect_small_shrink(H5FS_section_info_t **_sect, void *_udata) HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); /* Release section's space at EOA */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") /* Free section */ @@ -872,7 +871,7 @@ H5MF_sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, (*sect1)->sect_info.size += sect2->sect_info.size; if((*sect1)->sect_info.size == udata->f->shared->fs_page_size) { - if(H5MF_xfree(udata->f, udata->alloc_type, udata->dxpl_id, (*sect1)->sect_info.addr, (*sect1)->sect_info.size) < 0) + if(H5MF_xfree(udata->f, udata->alloc_type, (*sect1)->sect_info.addr, (*sect1)->sect_info.size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section") /* Need to free possible metadata page in the PB cache */ @@ -1073,7 +1072,7 @@ H5MF_sect_large_shrink(H5FS_section_info_t **_sect, void *_udata) /* Free full pages from EOA */ /* Retain partial page in the free-space manager so as to keep EOA at page boundary */ - if(H5F_free(udata->f, udata->dxpl_id, udata->alloc_type, (*sect)->sect_info.addr+frag_size, (*sect)->sect_info.size-frag_size) < 0) + if(H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr+frag_size, (*sect)->sect_info.size-frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed") if(frag_size) /* Adjust section size for the partial page */ diff --git a/src/H5O.c b/src/H5O.c index cf84b47..1795b71 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -31,6 +31,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ @@ -99,8 +100,8 @@ hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { - H5G_loc_t loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -112,15 +113,21 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ - if((ret_value = H5O_open_name(&loc, name, lapl_id, dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ @@ -152,12 +159,8 @@ hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - H5G_loc_t loc; - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ + H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -173,30 +176,21 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info") /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_by_idx(&loc, group_name, idx_type, order, n)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: - /* Release the object location if we failed after copying it */ - if(ret_value < 0 && loc_found) - if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -239,36 +233,31 @@ done: hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { - H5G_loc_t loc; - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hid_t lapl_id = H5P_LINK_ACCESS_DEFAULT; /* lapl to use to open this object */ - hid_t ret_value = FAIL; + H5G_loc_t loc; /* Location within file */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!H5F_addr_defined(addr)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no address supplied") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no address supplied") - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - obj_loc.oloc->addr = addr; - obj_loc.oloc->file = loc.oloc->file; - H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, H5AC_ind_read_dxpl_id, TRUE)) < 0) + if((ret_value = H5O__open_by_addr(&loc, addr)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") done: - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ @@ -298,9 +287,9 @@ herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id) { - H5G_loc_t new_loc; - H5G_loc_t obj_loc; - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + H5G_loc_t new_loc; /* Location of group to link from */ + H5G_loc_t obj_loc; /* Location of object to link to */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -323,15 +312,21 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, if(lcpl_id != H5P_DEFAULT && (TRUE != H5P_isa_class(lcpl_id, H5P_LINK_CREATE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a link creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, obj_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") - /* Link to the object */ - if(H5L_link(&new_loc, new_name, &obj_loc, lcpl_id, lapl_id, dxpl_id) < 0) + /* Create a link to the object */ + if(H5O__create_link(&new_loc, new_name, &obj_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create link") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Olink() */ @@ -359,8 +354,9 @@ done: herr_t H5Oincr_refcount(hid_t object_id) { - H5O_loc_t *oloc; - herr_t ret_value = SUCCEED; + H5O_loc_t *oloc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -369,10 +365,21 @@ H5Oincr_refcount(hid_t object_id) if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") - if(H5O_link(oloc, 1, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Change the object's refcount */ + if(H5O__link(oloc, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5O_incr_refcount() */ @@ -400,8 +407,9 @@ done: herr_t H5Odecr_refcount(hid_t object_id) { - H5O_loc_t *oloc; - herr_t ret_value = SUCCEED; + H5O_loc_t *oloc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); @@ -410,10 +418,21 @@ H5Odecr_refcount(hid_t object_id) if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") - if(H5O_link(oloc, -1, H5AC_ind_read_dxpl_id) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(object_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Change the object's refcount */ + if(H5O__link(oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Odecr_refcount() */ @@ -435,7 +454,7 @@ htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) { H5G_loc_t loc; /* Location info */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) @@ -447,15 +466,21 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Check if the object exists */ - if((ret_value = H5G_loc_exists(&loc, name, lapl_id, dxpl_id)) < 0) + if((ret_value = H5O__exists_by_name(&loc, name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oexists_by_name() */ @@ -477,6 +502,7 @@ herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -488,11 +514,18 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the object's information */ - if(H5G_loc_info(&loc, ".", TRUE, oinfo/*out*/, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__get_info_by_name(&loc, ".", oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info() */ @@ -514,7 +547,7 @@ herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -528,15 +561,21 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ - if(H5G_loc_info(&loc, name, TRUE, oinfo/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__get_info_by_name(&loc, name, oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_name() */ @@ -560,11 +599,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - H5G_loc_t obj_loc; /* Location used to open group */ - H5G_name_t obj_path; /* Opened object group hier. path */ - H5O_loc_t obj_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -583,29 +618,21 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(!oinfo) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object's location, according to the order in the index */ - if(H5G_loc_find_by_idx(&loc, group_name, idx_type, order, n, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "group not found") - loc_found = TRUE; +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's information */ - if(H5O_get_info(obj_loc.oloc, dxpl_id, TRUE, oinfo) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + if(H5O__get_info_by_idx(&loc, group_name, idx_type, order, n, oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get info for object") done: - /* Release the object location */ - if(loc_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_info_by_idx() */ @@ -631,6 +658,7 @@ herr_t H5Oset_comment(hid_t obj_id, const char *comment) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -640,11 +668,21 @@ H5Oset_comment(hid_t obj_id, const char *comment) if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + /* (Re)set the object's comment */ - if(H5G_loc_set_comment(&loc, ".", comment, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__set_comment_by_name(&loc, ".", comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment() */ @@ -671,7 +709,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -683,15 +721,21 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* (Re)set the object's comment */ - if(H5G_loc_set_comment(&loc, name, comment, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5O__set_comment_by_name(&loc, name, comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oset_comment_by_name() */ @@ -716,6 +760,7 @@ ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) { H5G_loc_t loc; /* Location of group */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -725,11 +770,18 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Retrieve the object's comment */ - if((ret_value = H5G_loc_get_comment(&loc, ".", comment/*out*/, bufsize, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if((ret_value = H5O__get_comment_by_name(&loc, ".", comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment() */ @@ -755,7 +807,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf hid_t lapl_id) { H5G_loc_t loc; /* Location of group */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -767,15 +819,21 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Retrieve the object's comment */ - if((ret_value = H5G_loc_get_comment(&loc, name, comment/*out*/, bufsize, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if((ret_value = H5O__get_comment_by_name(&loc, name, comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object: '%s'", name) done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name() */ @@ -816,6 +874,7 @@ herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -829,11 +888,18 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Call internal object visitation routine */ - if((ret_value = H5O_visit(obj_id, ".", idx_type, order, op, op_data, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + if((ret_value = H5O__visit(obj_id, ".", idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit() */ @@ -874,7 +940,7 @@ herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id) { - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -891,15 +957,21 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, if(!op) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no callback operator specified") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set access property list info") /* Call internal object visitation routine */ - if((ret_value = H5O_visit(loc_id, obj_name, idx_type, order, op, op_data, lapl_id, dxpl_id)) < 0) + if((ret_value = H5O__visit(loc_id, obj_name, idx_type, order, op, op_data)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Ovisit_by_name() */ @@ -925,6 +997,7 @@ done: herr_t H5Oclose(hid_t object_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) @@ -937,6 +1010,10 @@ H5Oclose(hid_t object_id) case H5I_DATASET: if(H5I_object(object_id) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid object") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; if(H5I_dec_app_ref(object_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close object") break; @@ -960,6 +1037,8 @@ H5Oclose(hid_t object_id) } /* end switch */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oclose() */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index d8298a4..dc5bc47 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -34,24 +34,23 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ainfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__ainfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_ainfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ainfo_copy(const void *_mesg, void *_dest); static size_t H5O_ainfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_ainfo_free(void *_mesg); -static herr_t H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +static herr_t H5O__ainfo_free(void *_mesg); +static herr_t H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, +static void *H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_ainfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__ainfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ @@ -59,22 +58,22 @@ const H5O_msg_class_t H5O_MSG_AINFO[1] = {{ "ainfo", /*message name for debugging */ sizeof(H5O_ainfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_ainfo_decode, /*decode message */ + H5O__ainfo_decode, /*decode message */ H5O_ainfo_encode, /*encode message */ H5O_ainfo_copy, /*copy the native value */ H5O_ainfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_ainfo_free, /* free method */ - H5O_ainfo_delete, /* file delete method */ + H5O__ainfo_free, /* free method */ + H5O__ainfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_ainfo_pre_copy_file, /* pre copy native value to file */ - H5O_ainfo_copy_file, /* copy native value to file */ - H5O_ainfo_post_copy_file, /* post copy native value to file */ + H5O__ainfo_copy_file, /* copy native value to file */ + H5O__ainfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_ainfo_debug /*debug the message */ + H5O__ainfo_debug /*debug the message */ }}; /* Current version of attribute info information */ @@ -90,7 +89,7 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); /*------------------------------------------------------------------------- - * Function: H5O_ainfo_decode + * Function: H5O__ainfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -104,14 +103,14 @@ H5FL_DEFINE_STATIC(H5O_ainfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ainfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_ainfo_t *ainfo = NULL; /* Attribute info */ unsigned char flags; /* Flags for encoding attribute info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -161,7 +160,7 @@ done: ainfo = H5FL_FREE(H5O_ainfo_t, ainfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_decode() */ +} /* end H5O__ainfo_decode() */ /*------------------------------------------------------------------------- @@ -295,9 +294,9 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_ainfo_free + * Function: H5O__ainfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -307,20 +306,20 @@ H5O_ainfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_free(void *mesg) +H5O__ainfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_ainfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_free() */ +} /* end H5O__ainfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_delete + * Function: H5O__ainfo_delete * * Purpose: Free file space referenced by message. Note that open_oh * *must* be non-NULL - this means that calls to @@ -334,12 +333,12 @@ H5O_ainfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -347,15 +346,14 @@ H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) HDassert(open_oh); /* If the object is using "dense" attribute storage, delete it */ - if(H5F_addr_defined(ainfo->fheap_addr)) { + if(H5F_addr_defined(ainfo->fheap_addr)) /* Delete the attribute */ - if(H5A_dense_delete(f, dxpl_id, ainfo) < 0) + if(H5A__dense_delete(f, ainfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense attribute storage") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_ainfo_delete() */ +} /* end H5O__ainfo_delete() */ /*------------------------------------------------------------------------- @@ -393,7 +391,7 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE /*------------------------------------------------------------------------- - * Function: H5O_ainfo_copy_file + * Function: H5O__ainfo_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -406,15 +404,15 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, +H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(file_src); @@ -434,13 +432,13 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Prepare to copy dense attributes - actual copy in post_copy */ /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); - if(H5A_dense_create(file_dst, dxpl_id, ainfo_dst) < 0) + if(H5A__dense_create(file_dst, ainfo_dst) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes") /* Reset metadata tag */ - H5_END_TAG(NULL); + H5_END_TAG } /* end if */ /* Set return value */ @@ -452,11 +450,11 @@ done: ainfo_dst = H5FL_FREE(H5O_ainfo_t, ainfo_dst); FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_ainfo_copy_file() */ +} /* H5O__ainfo_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_post_copy_file + * Function: H5O__ainfo_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -472,30 +470,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(ainfo_src); - if(H5F_addr_defined(ainfo_src->fheap_addr)) { - if(H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, - (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") - } /* end if */ + if(H5F_addr_defined(ainfo_src->fheap_addr)) + if(H5A__dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, (H5O_ainfo_t *)mesg_dst, cpy_info) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_ainfo_post_copy_file() */ +} /* H5O__ainfo_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_ainfo_debug + * Function: H5O__ainfo_debug * * Purpose: Prints debugging info for a message. * @@ -508,12 +504,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_ainfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__ainfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -539,5 +535,5 @@ H5O_ainfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ainfo_debug() */ +} /* end H5O__ainfo_debug() */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 478d950..8e6a5f3 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -61,21 +61,20 @@ static herr_t H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, size_t idx, uint8_t *new_gap_loc, size_t new_gap_size); static herr_t H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *new_gap_loc, size_t new_gap_size); -static herr_t H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, +static herr_t H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size); -static htri_t H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +static htri_t H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size_t *msg_idx); static herr_t H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_msg_alloc_info_t *found_msg); -static herr_t H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, +static herr_t H5O__alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t *new_idx); static herr_t H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx); -static htri_t H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u); -static htri_t H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static htri_t H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static htri_t H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static herr_t H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned chunkno); +static htri_t H5O_move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u); +static htri_t H5O_move_msgs_forward(H5F_t *f, H5O_t *oh); +static htri_t H5O_merge_null(H5F_t *f, H5O_t *oh); +static htri_t H5O_remove_empty_chunks(H5F_t *f, H5O_t *oh); +static herr_t H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno); /*********************/ @@ -325,7 +324,7 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, /*------------------------------------------------------------------------- * - * Function: H5O_alloc_null + * Function: H5O__alloc_null * * Purpose: Allocate room for a new message from a null message * @@ -338,7 +337,7 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, +H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new_type, void *new_native, size_t new_size) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ @@ -346,7 +345,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -357,7 +356,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, alloc_msg = &oh->mesg[null_idx]; /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, alloc_msg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, alloc_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Check if there's a need to split the null message */ @@ -424,11 +423,11 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t null_idx, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_null() */ +} /* H5O__alloc_null() */ /*------------------------------------------------------------------------- @@ -480,7 +479,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5O_alloc_extend_chunk + * Function: H5O__alloc_extend_chunk * * Purpose: Attempt to extend a chunk that is allocated on disk. * @@ -507,8 +506,8 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, - size_t size, size_t *msg_idx) +H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, + size_t *msg_idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -525,7 +524,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f != NULL); @@ -590,12 +589,11 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Determine whether the chunk can be extended */ - was_extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, - (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, oh->chunk[chunkno].addr, (hsize_t)(oh->chunk[chunkno].size), (hsize_t)(delta + extra_prfx_size)); if(was_extended < 0) /* error */ HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't tell if we can extend chunk") else if(was_extended == FALSE) /* can't extend -- we are done */ @@ -674,7 +672,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ - if(NULL == (chk_proxy2 = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) + if(NULL == (chk_proxy2 = H5O__chunk_protect(f, oh, cont_chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Adjust size in continuation message */ @@ -686,7 +684,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, chk_dirtied2 = TRUE; /* Release chunk containing continuation message */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy2, chk_dirtied2) < 0) + if(H5O__chunk_unprotect(f, chk_proxy2, chk_dirtied2) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -700,11 +698,11 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_extend_chunk() */ +} /* H5O__alloc_extend_chunk() */ /*------------------------------------------------------------------------- @@ -885,8 +883,8 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, *------------------------------------------------------------------------- */ herr_t -H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, - size_t found_null, const H5O_msg_alloc_info_t *found_msg, size_t *new_idx) +H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, + const H5O_msg_alloc_info_t *found_msg, size_t *new_idx) { H5O_mesg_t *curr_msg; /* Pointer to current message to operate on */ H5O_chunk_proxy_t *chk_proxy; /* Chunk that message is in */ @@ -923,7 +921,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size += H5O_SIZEOF_CHKHDR_OH(oh); /* Allocate space in file to hold the new chunk */ - new_chunk_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)size); + new_chunk_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)size); if(!H5F_addr_defined(new_chunk_addr)) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "unable to allocate space for new chunk") @@ -974,7 +972,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, H5O_mesg_t *null_msg; /* Pointer to new null message */ /* Protect last chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno - 1))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno - 1))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Copy each message to the new location */ @@ -1023,7 +1021,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, oh->chunk[chunkno - 1].gap = 0; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ else { @@ -1033,7 +1031,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, H5O_mesg_t *null_msg; /* Pointer to new null message */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[found_msg->msgno].chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, oh->mesg[found_msg->msgno].chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Create null message for space that message to copy currently occupies */ @@ -1072,7 +1070,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, null_msg->raw_size += found_msg->null_size; /* Release any information/memory for message */ - H5O_msg_free_mesg(old_null_msg); + H5O__msg_free_mesg(old_null_msg); /* Remove null message from list of messages */ if(found_msg->null_msgno < (oh->nmesgs - 1)) @@ -1090,7 +1088,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, null_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end if */ @@ -1106,7 +1104,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, oh->mesg[idx].chunkno = chunkno; /* Insert the new chunk into the cache */ - if(H5O_chunk_add(f, dxpl_id, oh, chunkno, oh->mesg[found_null].chunkno) < 0) + if(H5O__chunk_add(f, oh, chunkno, oh->mesg[found_null].chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't add new chunk to cache") /* Initialize the continuation information */ @@ -1117,7 +1115,7 @@ H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, cont->chunkno = chunkno; /* Split the null message and point at continuation message */ - if(H5O_alloc_null(f, dxpl_id, oh, found_null, H5O_MSG_CONT, cont, cont_size) < 0) + if(H5O__alloc_null(f, oh, found_null, H5O_MSG_CONT, cont, cont_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't split null message") /* Set new message index value */ @@ -1129,7 +1127,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_alloc_new_chunk + * Function: H5O__alloc_new_chunk * * Purpose: Allocates a new chunk for the object header, including * file space. @@ -1164,14 +1162,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new_idx) +H5O__alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t *new_idx) { size_t cont_size; /*continuation message size */ size_t idx; /* Message number */ H5O_msg_alloc_info_t found_msg; /* Best fit non-null message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(oh); @@ -1192,12 +1190,12 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new } /* end if */ /* Allocate and initialize new chunk in the file */ - if(H5O__alloc_chunk(f, dxpl_id, oh, size, idx, &found_msg, new_idx) < 0) + if(H5O__alloc_chunk(f, oh, size, idx, &found_msg, new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate new object header chunk") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_new_chunk() */ +} /* H5O__alloc_new_chunk() */ /*------------------------------------------------------------------------- @@ -1277,7 +1275,7 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) /*------------------------------------------------------------------------- - * Function: H5O_alloc + * Function: H5O__alloc * * Purpose: Allocate enough space in the object header for this message. * @@ -1290,7 +1288,7 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) *------------------------------------------------------------------------- */ herr_t -H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx) { size_t raw_size; /* Raw size of message */ @@ -1298,7 +1296,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, size_t idx; /* Index of message which fits allocation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -1332,7 +1330,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, for(chunkno = 0; chunkno < oh->nchunks; chunkno++) { htri_t tri_result; /* Status from attempting to extend chunk */ - if((tri_result = H5O_alloc_extend_chunk(f, dxpl_id, oh, chunkno, raw_size, &idx)) < 0) + if((tri_result = H5O__alloc_extend_chunk(f, oh, chunkno, raw_size, &idx)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTEXTEND, FAIL, "can't extend existing chunk") if(tri_result == TRUE) break; @@ -1340,13 +1338,13 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, /* If we were not able to extend a chunk, create a new one */ if(idx >= oh->nmesgs) - if(H5O_alloc_new_chunk(f, dxpl_id, oh, raw_size, &idx) < 0) + if(H5O__alloc_new_chunk(f, oh, raw_size, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create a new object header data chunk") } /* end if */ HDassert(idx < oh->nmesgs); /* Split the null message and point at continuation message */ - if(H5O_alloc_null(f, dxpl_id, oh, idx, type, NULL, aligned_size) < 0) + if(H5O__alloc_null(f, oh, idx, type, NULL, aligned_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't split null message") /* Mark object header as dirty in cache */ @@ -1358,7 +1356,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc() */ +} /* H5O__alloc() */ /*------------------------------------------------------------------------- @@ -1376,8 +1374,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, - hbool_t adj_link) +H5O_release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -1391,18 +1388,17 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, HDassert(mesg); /* Check if we should operate on the message */ - if(adj_link) { + if(adj_link) /* Free any space referred to in the file from this message */ - if(H5O_delete_mesg(f, dxpl_id, oh, mesg) < 0) + if(H5O__delete_mesg(f, oh, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") - } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Free any native information */ - H5O_msg_free_mesg(mesg); + H5O__msg_free_mesg(mesg); /* Change message type to nil and zero it */ mesg->type = H5O_MSG_NULL; @@ -1427,7 +1423,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1448,7 +1444,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) +H5O_move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that continuation message is in */ H5O_mesg_t *cont_msg; /* Pointer to the continuation message */ @@ -1464,7 +1460,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Get initial information */ cont_msg = &oh->mesg[cont_u]; - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, cont_msg, FAIL) deleted_chunkno = ((H5O_cont_t *)(cont_msg->native))->chunkno; /* Check if continuation message is pointing to the last chunk */ @@ -1504,11 +1500,11 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Convert continuation message into a null message. Do not delete * the target chunk yet, so we can still copy messages from it. */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0) + if(H5O_release_mesg(f, oh, cont_msg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, cont_chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Move message(s) forward into continuation message */ @@ -1534,7 +1530,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end if */ /* Delete the target chunk */ - if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0) + if(H5O__chunk_delete(f, oh, deleted_chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") HDassert(move_start <= (move_end + gap_size)); @@ -1558,7 +1554,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end if */ /* Release any information/memory for continuation message */ - H5O_msg_free_mesg(cont_msg); + H5O__msg_free_mesg(cont_msg); if(cont_u < (oh->nmesgs - 1)) HDmemmove(&oh->mesg[cont_u], &oh->mesg[cont_u + 1], ((oh->nmesgs - 1) - cont_u) * sizeof(H5O_mesg_t)); oh->nmesgs--; @@ -1572,7 +1568,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) /* Remove all null messages in deleted chunk from list of messages */ if(curr_msg->type->id == H5O_NULL_ID) { /* Release any information/memory for message */ - H5O_msg_free_mesg(curr_msg); + H5O__msg_free_mesg(curr_msg); chk_dirtied = TRUE; /* Remove from message list */ @@ -1594,7 +1590,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1616,7 +1612,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_move_msgs_forward(H5F_t *f, H5O_t *oh) { H5O_chunk_proxy_t *null_chk_proxy = NULL; /* Chunk that null message is in */ H5O_chunk_proxy_t *curr_chk_proxy = NULL; /* Chunk that message is in */ @@ -1664,7 +1660,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* (We'll merge them together later, in another routine) */ if(H5O_NULL_ID != nonnull_msg->type->id) { /* Protect chunk */ - if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (null_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Copy raw data for non-null message to new location */ @@ -1683,7 +1679,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; @@ -1710,7 +1706,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) if(H5O_CONT_ID == curr_msg->type->id) { htri_t status; /* Status from moving messages */ - if((status = H5O_move_cont(f, dxpl_id, oh, u)) < 0) + if((status = H5O_move_cont(f, oh, u)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "Error in moving messages into cont message") else if(status > 0) { /* Message(s) got moved into "continuation" message */ packed_msg = TRUE; @@ -1730,9 +1726,9 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) old_raw = curr_msg->raw; /* Protect chunks */ - if(NULL == (null_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, null_msg->chunkno))) + if(NULL == (null_chk_proxy = H5O__chunk_protect(f, oh, null_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (curr_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* If the message being moved is a continuation @@ -1754,20 +1750,20 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) HDassert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); /* Protect continuation message target chunk */ - if(NULL == (cont_targ_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, ((H5O_cont_t *)(curr_msg->native))->chunkno))) + if(NULL == (cont_targ_chk_proxy = H5O__chunk_protect(f, oh, ((H5O_cont_t *)(curr_msg->native))->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Remove flush dependency on old continuation * message chunk */ HDassert(cont_targ_chk_proxy); - HDassert(cont_targ_chk_proxy->parent); + HDassert(cont_targ_chk_proxy->fd_parent); HDassert(curr_chk_proxy); - HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->parent); + HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->fd_parent); if(H5AC_destroy_flush_dependency(curr_chk_proxy, cont_targ_chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - cont_targ_chk_proxy->parent = NULL; + cont_targ_chk_proxy->fd_parent = NULL; /* Create flush dependency on new continuation * message chunk */ @@ -1780,11 +1776,11 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) HDassert((((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_CHK_ID)); - cont_targ_chk_proxy->parent = null_chk_mdc_obj; + cont_targ_chk_proxy->fd_parent = null_chk_mdc_obj; /* Unprotect continuation message target chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, cont_targ_chk_proxy, FALSE) < 0) + if(H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") cont_targ_chk_proxy = NULL; } /* end if */ @@ -1809,7 +1805,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) null_chk_dirtied = TRUE; /* Release current chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") curr_chk_proxy = NULL; curr_chk_dirtied = FALSE; @@ -1824,7 +1820,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release null chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; null_chk_dirtied = FALSE; @@ -1873,7 +1869,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end else */ /* Release null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") null_chk_proxy = NULL; null_chk_dirtied = FALSE; @@ -1899,7 +1895,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) } /* end if */ /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") curr_chk_proxy = NULL; curr_chk_dirtied = FALSE; @@ -1933,11 +1929,11 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) done: if(ret_value < 0) { - if(null_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, null_chk_proxy, null_chk_dirtied) < 0) + if(null_chk_proxy && H5O__chunk_unprotect(f, null_chk_proxy, null_chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect null object header chunk") - if(curr_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, curr_chk_dirtied) < 0) + if(curr_chk_proxy && H5O__chunk_unprotect(f, curr_chk_proxy, curr_chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect current object header chunk") - if(cont_targ_chk_proxy && H5O_chunk_unprotect(f, dxpl_id, cont_targ_chk_proxy, FALSE) < 0) + if(cont_targ_chk_proxy && H5O__chunk_unprotect(f, cont_targ_chk_proxy, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect continuation message target object header chunk") } /* end if */ else @@ -1962,7 +1958,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_merge_null(H5F_t *f, H5O_t *oh) { hbool_t merged_msg; /* Flag to indicate that messages were merged */ hbool_t did_merging = FALSE; /* Whether any messages were merged */ @@ -2024,10 +2020,10 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) htri_t result; /* Release any information/memory for second message */ - H5O_msg_free_mesg(curr_msg2); + H5O__msg_free_mesg(curr_msg2); /* Protect chunk */ - if(NULL == (curr_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (curr_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Adjust first message address and extend length to cover second message */ @@ -2038,7 +2034,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) curr_msg->dirty = TRUE; /* Release new null message's chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, curr_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, curr_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") /* Remove second message from list of messages */ @@ -2050,7 +2046,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) oh->nmesgs--; /* The merge null message might span the entire chunk: scan for empty chunk to remove */ - if((result = H5O_remove_empty_chunks(f, dxpl_id, oh)) < 0) + if((result = H5O_remove_empty_chunks(f, oh)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk") else if(result > 0) /* Get out of loop */ @@ -2058,7 +2054,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* If the merged message is too large, shrink the chunk */ if(curr_msg->raw_size >= H5O_MESG_MAX_SIZE) - if(H5O_alloc_shrink_chunk(f, dxpl_id, oh, curr_msg->chunkno) < 0) + if(H5O__alloc_shrink_chunk(f, oh, curr_msg->chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "unable to shrink chunk") /* Get out of loop */ @@ -2105,7 +2101,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O_remove_empty_chunks(H5F_t *f, H5O_t *oh) { hbool_t deleted_chunk; /* Whether to a chunk was deleted */ hbool_t did_deleting = FALSE; /* Whether any chunks were deleted */ @@ -2141,7 +2137,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) for(v = 0, cont_msg = &oh->mesg[0]; v < oh->nmesgs; v++, cont_msg++) { if(H5O_CONT_ID == cont_msg->type->id) { /* Decode current continuation message if necessary */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, cont_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, cont_msg, FAIL) /* Check if the chunkno needs to be set */ /* (should only occur when the continuation message is first decoded) */ @@ -2172,7 +2168,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) deleted_chunkno = null_msg->chunkno; /* Convert continuation message into a null message */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0) + if(H5O_release_mesg(f, oh, cont_msg, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* @@ -2196,7 +2192,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* If the entry is in the cache, update its chunk index */ if(chk_proxy_status & H5AC_ES__IN_CACHE) { - if(H5O_chunk_update_idx(f, dxpl_id, oh, u) < 0) + if(H5O__chunk_update_idx(f, oh, u) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update index for chunk proxy") } /* end if */ } /* end for */ @@ -2211,7 +2207,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) */ /* Release any information/memory for message */ - H5O_msg_free_mesg(null_msg); + H5O__msg_free_mesg(null_msg); /* Remove null message from list of messages */ if(null_msg_no < (oh->nmesgs - 1)) @@ -2233,7 +2229,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) /* Check for continuation message */ if(H5O_CONT_ID == curr_msg->type->id) { /* Decode current continuation message if necessary */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, curr_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, curr_msg, FAIL) /* Check if the chunkno needs to be set */ /* (should only occur when the continuation message is first decoded) */ @@ -2287,15 +2283,10 @@ done: * koziol@ncsa.uiuc.edu * Oct 4 2005 * - * Modifications: - * Feb. 2009: Vailin Choi - * Add 2 more parameters to H5O_move_msgs_forward() for moving - * messages forward into "continuation" message - * *------------------------------------------------------------------------- */ herr_t -H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) +H5O_condense_header(H5F_t *f, H5O_t *oh) { hbool_t rescan_header; /* Whether to rescan header */ htri_t result; /* Result from packing/merging/etc */ @@ -2312,21 +2303,21 @@ H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) rescan_header = FALSE; /* Scan for messages that can be moved earlier in chunks */ - result = H5O_move_msgs_forward(f, dxpl_id, oh); + result = H5O_move_msgs_forward(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't move header messages forward") if(result > 0) rescan_header = TRUE; /* Scan for adjacent null messages & merge them */ - result = H5O_merge_null(f, dxpl_id, oh); + result = H5O_merge_null(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack null header messages") if(result > 0) rescan_header = TRUE; /* Scan for empty chunks to remove */ - result = H5O_remove_empty_chunks(f, dxpl_id, oh); + result = H5O_remove_empty_chunks(f, oh); if(result < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't remove empty chunk") if(result > 0) @@ -2343,7 +2334,7 @@ done: /*------------------------------------------------------------------------- * - * Function: H5O_alloc_shrink_chunk + * Function: H5O__alloc_shrink_chunk * * Purpose: Shrinks a chunk, removing all null messages and any gap. * @@ -2356,7 +2347,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) +H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) { H5O_chunk_t *chunk = &oh->chunk[chunkno]; /* Chunk to shrink */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Metadata cache proxy for chunk to shrink */ @@ -2374,14 +2365,14 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) size_t u; /* Index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); HDassert(oh); /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Loop backwards to increase the chance of seeing more null messages at the @@ -2415,7 +2406,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) new_size -= shrink_size; /* Release any information/memory for the message */ - H5O_msg_free_mesg(curr_msg); + H5O__msg_free_mesg(curr_msg); /* Remove the deleted null message from list of messages */ if(u < (oh->nmesgs - 1)) @@ -2508,7 +2499,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) H5O_chunk_proxy_t *cont_chk_proxy; /* Chunk that message is in */ /* Protect chunk */ - if(NULL == (cont_chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, curr_msg->chunkno))) + if(NULL == (cont_chk_proxy = H5O__chunk_protect(f, oh, curr_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Adjust size of continuation message */ @@ -2519,7 +2510,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) curr_msg->dirty = TRUE; /* Release chunk, marking it dirty */ - if(H5O_chunk_unprotect(f, dxpl_id, cont_chk_proxy, TRUE) < 0) + if(H5O__chunk_unprotect(f, cont_chk_proxy, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") } /* end if */ } /* end for */ @@ -2531,14 +2522,14 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) HGOTO_ERROR(H5E_OHDR, H5E_CANTRESIZE, FAIL, "unable to resize object header chunk") /* Free the unused space in the file */ - if(H5MF_xfree(f, H5FD_MEM_OHDR, dxpl_id, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) + if(H5MF_xfree(f, H5FD_MEM_OHDR, chunk->addr + new_size, (hsize_t)(old_size - new_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to shrink object header chunk") done: /* Release chunk, marking it dirty */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, TRUE) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, TRUE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_alloc_shrink_chunk() */ +} /* H5O__alloc_shrink_chunk() */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index cb802ea..441a938 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -25,23 +25,23 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_attr_copy(const void *_mesg, void *_dest); static size_t H5O_attr_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_attr_free(void *mesg); +static herr_t H5O__attr_free(void *mesg); static herr_t H5O_attr_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, +static void *H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_attr_post_copy_file(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); static herr_t H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx); static herr_t H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx); -static herr_t H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_ATTR @@ -51,17 +51,17 @@ static herr_t H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_ENCODE_REAL H5O_attr_encode #define H5O_SHARED_SIZE H5O_attr_shared_size #define H5O_SHARED_SIZE_REAL H5O_attr_size -#define H5O_SHARED_DELETE H5O_attr_shared_delete -#define H5O_SHARED_DELETE_REAL H5O_attr_delete -#define H5O_SHARED_LINK H5O_attr_shared_link -#define H5O_SHARED_LINK_REAL H5O_attr_link -#define H5O_SHARED_COPY_FILE H5O_attr_shared_copy_file -#define H5O_SHARED_COPY_FILE_REAL H5O_attr_copy_file +#define H5O_SHARED_DELETE H5O__attr_shared_delete +#define H5O_SHARED_DELETE_REAL H5O__attr_delete +#define H5O_SHARED_LINK H5O__attr_shared_link +#define H5O_SHARED_LINK_REAL H5O__attr_link +#define H5O_SHARED_COPY_FILE H5O__attr_shared_copy_file +#define H5O_SHARED_COPY_FILE_REAL H5O__attr_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file -#define H5O_SHARED_POST_COPY_FILE_REAL H5O_attr_post_copy_file +#define H5O_SHARED_POST_COPY_FILE_REAL H5O__attr_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_attr_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_attr_debug +#define H5O_SHARED_DEBUG_REAL H5O__attr_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -74,14 +74,14 @@ const H5O_msg_class_t H5O_MSG_ATTR[1] = {{ H5O_attr_shared_encode, /* encode message */ H5O_attr_copy, /* copy the native value */ H5O_attr_shared_size, /* size of raw message */ - H5O_attr_reset, /* reset method */ - H5O_attr_free, /* free method */ - H5O_attr_shared_delete, /* file delete method */ - H5O_attr_shared_link, /* link method */ + H5O__attr_reset, /* reset method */ + H5O__attr_free, /* free method */ + H5O__attr_shared_delete, /* file delete method */ + H5O__attr_shared_link, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_attr_pre_copy_file, /* pre copy native value to file */ - H5O_attr_shared_copy_file, /* copy native value to file */ + H5O__attr_shared_copy_file, /* copy native value to file */ H5O_attr_shared_post_copy_file, /* post copy native value to file */ H5O_attr_get_crt_index, /* get creation index */ H5O_attr_set_crt_index, /* set creation index */ @@ -107,9 +107,8 @@ H5FL_EXTERN(H5S_extent_t); Decode a attribute message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_attr_decode(f, dxpl_id, mesg_flags, p) + void *H5O_attr_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8_t *p; IN: the raw information buffer RETURNS @@ -120,7 +119,7 @@ H5FL_EXTERN(H5S_extent_t); function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, +H5O_attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags, const uint8_t *p) { H5A_t *attr = NULL; @@ -184,8 +183,8 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED p += name_len; /* advance the memory pointer */ /* Decode the attribute's datatype */ - if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, dxpl_id, open_oh, - ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) + if(NULL == (attr->shared->dt = (H5T_t *)(H5O_MSG_DTYPE->decode)(f, open_oh, + ((flags & H5O_ATTR_FLAG_TYPE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p))) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute datatype") if(attr->shared->version < H5O_ATTR_VERSION_2) p += H5O_ALIGN_OLD(attr->shared->dt_size); @@ -199,7 +198,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned H5_ATTR_UNUSED HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Decode attribute's dataspace extent */ - if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, dxpl_id, open_oh, + if((extent = (H5S_extent_t *)(H5O_MSG_SDSPACE->decode)(f, open_oh, ((flags & H5O_ATTR_FLAG_SPACE_SHARED) ? H5O_MSG_FLAG_SHARED : 0), ioflags, p)) == NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace") @@ -251,7 +250,7 @@ done: if(attr) { if(attr->shared) { /* Free any dynamicly allocated items */ - if(H5A_free(attr) < 0) + if(H5A__free(attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTRELEASE, NULL, "can't release attribute info") /* Destroy shared attribute struct */ @@ -400,7 +399,7 @@ H5O_attr_copy(const void *_src, void *_dst) HDassert(_src); /* copy */ - if(NULL == (ret_value = (H5A_t *)H5A_copy((H5A_t *)_dst, (const H5A_t *)_src))) + if(NULL == (ret_value = (H5A_t *)H5A__copy((H5A_t *)_dst, (const H5A_t *)_src))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "can't copy attribute") done: @@ -470,7 +469,7 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_attr_reset + * Function: H5O__attr_reset * * Purpose: Frees resources within a attribute message, but doesn't free * the message itself. @@ -480,28 +479,21 @@ H5O_attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) * Programmer: Robb Matzke * Tuesday, December 9, 1997 * - * Modification:Raymond Lu - * 25 June 2008 - * Made this function empty. The freeing action is actually - * done in H5O_attr_free (see H5O_msg_free_real). But this - * empty reset function needs to be here. Otherwise, the - * caller function H5O_msg_reset_real will zero-set the whole - * message. *------------------------------------------------------------------------- */ herr_t -H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) +H5O__attr_reset(void H5_ATTR_UNUSED *_mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_attr_reset() */ +} /* end H5O__attr_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_free + * Function: H5O__attr_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -511,25 +503,25 @@ H5O_attr_reset(void H5_ATTR_UNUSED *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_attr_free(void *mesg) +H5O__attr_free(void *mesg) { H5A_t *attr = (H5A_t *)mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(mesg); - if(H5A_close(attr) < 0) + if(H5A__close(attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close attribute object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_free() */ +} /* end H5O__attr_free() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_delete + * Function: H5O__attr_delete * * Purpose: Free file space referenced by message * @@ -541,7 +533,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) +H5O__attr_delete(H5F_t *f, H5O_t *oh, void *_mesg) { H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -553,20 +545,20 @@ H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) HDassert(attr); /* Decrement reference count on datatype in file */ - if((H5O_MSG_DTYPE->del)(f, dxpl_id, oh, attr->shared->dt) < 0) + if((H5O_MSG_DTYPE->del)(f, oh, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust datatype link count") /* Decrement reference count on dataspace in file */ - if((H5O_MSG_SDSPACE->del)(f, dxpl_id, oh, attr->shared->ds) < 0) + if((H5O_MSG_SDSPACE->del)(f, oh, attr->shared->ds) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust dataspace link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_delete() */ +} /* end H5O__attr_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_link + * Function: H5O__attr_link * * Purpose: Increment reference count on any objects referenced by * message @@ -579,12 +571,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) +H5O__attr_link(H5F_t *f, H5O_t *oh, void *_mesg) { H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -596,14 +588,14 @@ H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) * message is deleted. */ /* Increment reference count on datatype & dataspace in file */ - if((H5O_MSG_DTYPE->link)(f, dxpl_id, oh, attr->shared->dt) < 0) + if((H5O_MSG_DTYPE->link)(f, oh, attr->shared->dt) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust datatype link count") - if((H5O_MSG_SDSPACE->link)(f, dxpl_id, oh, attr->shared->ds) < 0) + if((H5O_MSG_SDSPACE->link)(f, oh, attr->shared->ds) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust dataspace link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_link() */ +} /* end H5O__attr_link() */ /*------------------------------------------------------------------------- @@ -642,7 +634,7 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED /*------------------------------------------------------------------------- - * Function: H5O_attr_copy_file + * Function: H5O__attr_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -656,13 +648,13 @@ H5O_attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static void * -H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, +H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(native_src); @@ -676,16 +668,16 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_t if(H5T_set_loc(((H5A_t *)native_src)->shared->dt, file_src, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "invalid datatype location") - if(NULL == (ret_value = H5A_attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info, dxpl_id))) + if(NULL == (ret_value = H5A__attr_copy_file((H5A_t *)native_src, file_dst, recompute_size, cpy_info))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_copy_file() */ +} /* H5O__attr_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_post_copy_file + * Function: H5O__attr_post_copy_file * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the @@ -701,21 +693,19 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, + H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_STATIC - FUNC_ENTER_NOAPI_NOINIT - - if ( H5A_attr_post_copy_file(src_oloc, (const H5A_t *)mesg_src, - dst_oloc, (H5A_t *)mesg_dst, dxpl_id, cpy_info) < 0) + if(H5A__attr_post_copy_file(src_oloc, (const H5A_t *)mesg_src, dst_oloc, (H5A_t *)mesg_dst, cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_post_copy_file() */ +} /* H5O__attr_post_copy_file() */ /*------------------------------------------------------------------------- @@ -779,11 +769,11 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) /*-------------------------------------------------------------------------- NAME - H5O_attr_debug + H5O__attr_debug PURPOSE Prints debugging information for an attribute message USAGE - void *H5O_attr_debug(f, mesg, stream, indent, fwidth) + void *H5O__attr_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source attribute struct FILE *stream; IN: Pointer to the stream for output data @@ -796,15 +786,14 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, - int fwidth) +H5O__attr_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth) { const H5A_t *mesg = (const H5A_t *)_mesg; const char *s; /* Temporary string pointer */ char buf[128]; /* Temporary string buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -868,17 +857,17 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0,fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->dt_size)); - if((H5O_MSG_DTYPE->debug)(f, dxpl_id, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if((H5O_MSG_DTYPE->debug)(f, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display datatype message info") HDfprintf(stream, "%*sDataspace...\n", indent, ""); HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->ds_size)); - if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) + if(H5S_debug(f, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display dataspace message info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_debug() */ +} /* end H5O__attr_debug() */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 2223564..9d125e8 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -55,7 +55,6 @@ /* User data for iteration when converting attributes to dense storage */ typedef struct { H5F_t *f; /* Pointer to file for insertion */ - hid_t dxpl_id; /* DXPL during iteration */ H5O_ainfo_t *ainfo; /* Attribute info struct */ } H5O_iter_cvt_t; @@ -72,7 +71,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ H5A_t *attr; /* Attribute data to update object header with */ /* up */ @@ -83,7 +81,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *old_name; /* Old name of attribute */ const char *new_name; /* New name of attribute */ @@ -95,7 +92,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ hid_t loc_id; /* ID of object being iterated over */ unsigned skip; /* # of attributes to skip over */ H5A_operator_t op; /* Callback routine for each attribute */ @@ -109,7 +105,6 @@ typedef struct { typedef struct { /* down */ H5F_t *f; /* Pointer to file attribute is in */ - hid_t dxpl_id; /* DXPL for operation */ const char *name; /* Name of attribute to open */ /* up */ @@ -186,12 +181,12 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HDassert(attr); /* Insert attribute into dense storage */ - if(H5A_dense_insert(udata->f, udata->dxpl_id, udata->ainfo, attr) < 0) + if(H5A__dense_insert(udata->f, udata->ainfo, attr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to add to dense storage") /* Convert message into a null message in the header */ /* (don't delete attribute's space in the file though) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -203,7 +198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_create + * Function: H5O__attr_create * * Purpose: Create a new attribute in the object header. * @@ -215,7 +210,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) +H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -229,7 +224,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) HDassert(attr); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check if this object already has attribute information */ @@ -238,7 +233,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) htri_t ainfo_exists; /* Whether the attribute info was retrieved */ /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") if(!ainfo_exists) { /* Initialize attribute information */ @@ -266,7 +261,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) size_t raw_size = 0; /* Raw size of message */ /* Check for attribute being sharable */ - if((sharable = H5SM_can_share(loc->file, dxpl_id, NULL, NULL, H5O_ATTR_ID, attr)) < 0) + if((sharable = H5SM_can_share(loc->file, NULL, NULL, H5O_ATTR_ID, attr)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't determine attribute sharing status") else if(sharable == FALSE) { /* Compute the size needed to encode the attribute */ @@ -279,18 +274,17 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) H5O_mesg_operator_t op; /* Wrapper for operator */ /* Create dense storage for attributes */ - if(H5A_dense_create(loc->file, dxpl_id, &ainfo) < 0) + if(H5A__dense_create(loc->file, &ainfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to create dense storage for attributes") /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.ainfo = &ainfo; /* Iterate over existing attributes, moving them to dense storage */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_to_dense_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "error converting attributes to dense storage") } /* end if */ } /* end if */ @@ -313,14 +307,13 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Add the attribute information message, if one is needed */ if(new_ainfo) { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute info message") } /* end if */ /* Otherwise, update existing message */ - else { - if(H5O_msg_write_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) + else + if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") - } /* end else */ } /* end if */ else { /* Set "bogus" creation index for attribute */ @@ -333,19 +326,18 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Check for storing attribute with dense storage */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Insert attribute into dense storage */ - if(H5A_dense_insert(loc->file, dxpl_id, &ainfo, attr) < 0) + if(H5A__dense_insert(loc->file, &ainfo, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to add to dense storage") } /* end if */ - else { + else /* Append new message to object header */ - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute in header") - } /* end else */ /* Increment reference count for shared attribute object for the - * object handle created by the caller function H5A_create. The count + * object handle created by the caller function H5A__create. The count * for the cached object header has been incremented in the step above - * (in H5O_msg_append_real). The dense storage doesn't need a count. */ + * (in H5O__msg_append_real). The dense storage doesn't need a count. */ attr->shared->nrefs += 1; /* Was new attribute shared? */ @@ -353,7 +345,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) hsize_t attr_rc; /* Attribute's ref count in shared message storage */ /* Retrieve ref count for shared attribute */ - if(H5SM_get_refcount(loc->file, dxpl_id, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(loc->file, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If this is not the first copy of the attribute in the shared message @@ -380,7 +372,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) * *ick* -QAK, 2007/01/08 */ if(attr_rc > 1) { - if(H5O_attr_delete(loc->file, dxpl_id, oh, attr) < 0) + if(H5O__attr_delete(loc->file, oh, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute") } /* end if */ } /* end if */ @@ -388,7 +380,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: @@ -396,7 +388,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_create() */ +} /* end H5O__attr_create() */ /*------------------------------------------------------------------------- @@ -430,7 +422,7 @@ H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, /* Check for correct attribute message to modify */ if(HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Make a copy of the attribute to return */ - if(NULL == (udata->attr = H5A_copy(NULL, (H5A_t *)mesg->native))) + if(NULL == (udata->attr = H5A__copy(NULL, (H5A_t *)mesg->native))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy attribute") /* Assign [somewhat arbitrary] creation order value, for older versions @@ -449,7 +441,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_by_name + * Function: H5O__attr_open_by_name * * Purpose: Open an existing attribute in an object header. * @@ -458,15 +450,10 @@ done: * Programmer: Quincey Koziol * Monday, December 11, 2006 * - * Modification:Raymond Lu - * 23 June 2008 - * If the attribute is in dense storage and has already been - * opened, make a copy of already opened object to share some - * object information. *------------------------------------------------------------------------- */ H5A_t * -H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -475,21 +462,21 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't check for attribute info message") } /* end if */ @@ -499,14 +486,14 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) if((found_open_attr = H5O_attr_find_opened_attr(loc, &exist_attr, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "failed in finding opened attribute") else if(found_open_attr == TRUE) { - if(NULL == (opened_attr = H5A_copy(NULL, exist_attr))) + if(NULL == (opened_attr = H5A__copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") } /* end else if */ else { /* Check for attributes in dense storage */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Open attribute with dense storage */ - if(NULL == (opened_attr = H5A_dense_open(loc->file, dxpl_id, &ainfo, name))) + if(NULL == (opened_attr = H5A__dense_open(loc->file, &ainfo, name))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "can't open attribute") } /* end if */ else { @@ -520,7 +507,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Iterate over attributes, to locate correct one to open */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_open_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute") /* Check that we found the attribute */ @@ -541,16 +528,16 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) ret_value = opened_attr; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, NULL, "unable to release object header") /* Release any resources, on error */ if(NULL == ret_value && opened_attr) - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_attr_open_by_name() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_open_by_name() */ /*------------------------------------------------------------------------- @@ -580,7 +567,7 @@ H5O_attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) HDassert(ret_attr); /* Copy attribute information. Shared some attribute information. */ - if(NULL == (*ret_attr = H5A_copy(NULL, attr))) + if(NULL == (*ret_attr = H5A__copy(NULL, attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") done: @@ -589,7 +576,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_open_by_idx + * Function: H5O__attr_open_by_idx * * Purpose: Open an existing attribute in an object header according to * an index. @@ -599,25 +586,19 @@ done: * Programmer: Quincey Koziol * Monday, December 18, 2006 * - * Modification:Raymond Lu - * 23 June 2008 - * After opening the attribute, check whether it's in dense - * storage and has already been opened. If it has, close the - * opened object and make a copy of already opened object. *------------------------------------------------------------------------- */ H5A_t * -H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id) +H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { - H5O_t *oh = NULL; /* Object header */ H5A_attr_iter_op_t attr_op; /* Attribute operator */ H5A_t *exist_attr = NULL; /* Existing opened attribute object */ H5A_t *opened_attr = NULL; /* Newly opened attribute object */ htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -627,13 +608,9 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, attr_op.u.lib_op = H5O_attr_open_by_idx_cb; /* Iterate over attributes to locate correct one */ - if(H5O_attr_iterate_real((hid_t)-1, loc, dxpl_id, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) + if(H5O_attr_iterate_real((hid_t)-1, loc, idx_type, order, n, NULL, &attr_op, &opened_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, NULL, "can't locate attribute") - /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, NULL, "unable to load object header") - /* Find out whether it has already been opened. If it has, close the object * and make a copy of the already opened object to share the object info. */ @@ -645,9 +622,9 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, * and close the object just opened. */ if(found_open_attr && exist_attr) { - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") - if(NULL == (opened_attr = H5A_copy(NULL, exist_attr))) + if(NULL == (opened_attr = H5A__copy(NULL, exist_attr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, NULL, "can't copy existing attribute") } else { /* Mark datatype as being on disk now */ @@ -660,16 +637,13 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, ret_value = opened_attr; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - /* Release any resources, on error */ if(NULL == ret_value && opened_attr) - if(H5A_close(opened_attr) < 0) + if(H5A__close(opened_attr) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_open_by_idx() */ +} /* end H5O__attr_open_by_idx() */ /*------------------------------------------------------------------------- @@ -754,7 +728,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_update_shared + * Function: H5O__attr_update_shared * * Purpose: Update a shared attribute. * @@ -767,15 +741,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, - H5O_shared_t *update_sh_mesg) +H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, H5O_shared_t *update_sh_mesg) { H5O_shared_t sh_mesg; /* Shared object header message */ hsize_t attr_rc; /* Attribute's ref count in shared message storage */ htri_t shared_mesg; /* Whether the message should be shared */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -791,13 +764,13 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, /* Store new version of message as a SOHM */ /* (should always work, since we're not changing the size of the attribute) */ - if((shared_mesg = H5SM_try_share(f, dxpl_id, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) + if((shared_mesg = H5SM_try_share(f, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "attribute changed sharing status") else if(shared_mesg < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't share attribute") /* Retrieve shared message storage ref count for new shared attribute */ - if(H5SM_get_refcount(f, dxpl_id, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) + if(H5SM_get_refcount(f, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count") /* If the newly shared attribute needs to share "ownership" of the shared @@ -809,14 +782,13 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, * * *ick* -QAK, 2007/01/08 */ - if(attr_rc == 1) { + if(attr_rc == 1) /* Increment reference count on attribute components */ - if(H5O_attr_link(f, dxpl_id, oh, attr) < 0) + if(H5O__attr_link(f, oh, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") - } /* end if */ /* Remove the old attribute from the SOHM storage */ - if(H5SM_delete(f, dxpl_id, oh, &sh_mesg) < 0) + if(H5SM_delete(f, oh, &sh_mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to delete shared attribute in shared storage") /* Extract updated shared message info from modified attribute, if requested */ @@ -826,7 +798,7 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_update_shared() */ +} /* end H5O__attr_update_shared() */ /*------------------------------------------------------------------------- @@ -866,7 +838,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Check for correct attribute message to modify */ if(0 == HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->attr->shared->name)) { /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Because the attribute structure is shared now. The only situation that requires @@ -888,13 +860,13 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; /* Update the shared attribute in the SOHM storage */ if(mesg->flags & H5O_MSG_FLAG_SHARED) - if(H5O_attr_update_shared(udata->f, udata->dxpl_id, oh, udata->attr, (H5O_shared_t *)mesg->native) < 0) + if(H5O__attr_update_shared(udata->f, oh, udata->attr, (H5O_shared_t *)mesg->native) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, "unable to update attribute in shared storage") /* Indicate that the object header was modified */ @@ -909,7 +881,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -917,7 +889,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_write + * Function: H5O__attr_write * * Purpose: Write a new value to an attribute. * @@ -929,34 +901,34 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) +H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); HDassert(attr); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Modify the attribute data in dense storage */ - if(H5A_dense_write(loc->file, dxpl_id, &ainfo, attr) < 0) + if(H5A__dense_write(loc->file, &ainfo, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") } /* end if */ else { @@ -965,14 +937,13 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.attr = attr; udata.found = FALSE; /* Iterate over attributes, to locate correct one to update */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_write_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute */ @@ -981,7 +952,7 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: @@ -989,7 +960,7 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_write */ +} /* end H5O__attr_write */ /*------------------------------------------------------------------------- @@ -1073,7 +1044,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned old_version = ((H5A_t *)mesg->native)->shared->version; /* Old version of the attribute */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(udata->f, udata->dxpl_id, oh, mesg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(udata->f, oh, mesg->chunkno))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, H5_ITER_ERROR, "unable to load object header chunk") /* Change the name for the attribute */ @@ -1081,7 +1052,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, ((H5A_t *)mesg->native)->shared->name = H5MM_xstrdup(udata->new_name); /* Recompute the version to encode the attribute with */ - if(H5A_set_version(udata->f, ((H5A_t *)mesg->native)) < 0) + if(H5A__set_version(udata->f, ((H5A_t *)mesg->native)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5_ITER_ERROR, "unable to update attribute version") /* Mark the message as modified */ @@ -1089,14 +1060,14 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") chk_proxy = NULL; /* Check for shared message */ if(mesg->flags & H5O_MSG_FLAG_SHARED) { /* Update the shared attribute in the SOHM storage */ - if(H5O_attr_update_shared(udata->f, udata->dxpl_id, oh, (H5A_t *)mesg->native, NULL) < 0) + if(H5O__attr_update_shared(udata->f, oh, (H5A_t *)mesg->native, NULL) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, "unable to update attribute in shared storage") } /* end if */ else { @@ -1125,21 +1096,21 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* (doesn't decrement the link count on shared components becuase * the "native" pointer has been reset) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release previous attribute") *oh_modified = H5O_MODIFY_CONDENSE; /* Append renamed attribute to object header */ /* (Don't let it become shared) */ - if(H5O_msg_append_real(udata->f, udata->dxpl_id, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) + if(H5O__msg_append_real(udata->f, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to relocate renamed attribute in header") /* Sanity check */ HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); /* Close the local copy of the attribute */ - H5A_close(attr); + H5A__close(attr); } /* end if */ } /* end else */ @@ -1155,7 +1126,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, done: /* Release chunk, if not already done */ - if(chk_proxy && H5O_chunk_unprotect(udata->f, udata->dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(udata->f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1163,7 +1134,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_rename + * Function: H5O__attr_rename * * Purpose: Rename an attribute. * @@ -1175,14 +1146,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, +H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); @@ -1190,21 +1161,21 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, HDassert(new_name); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Rename the attribute data in dense storage */ - if(H5A_dense_rename(loc->file, dxpl_id, &ainfo, old_name, new_name) < 0) + if(H5A__dense_rename(loc->file, &ainfo, old_name, new_name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") } /* end if */ else { @@ -1213,7 +1184,6 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.old_name = old_name; udata.new_name = new_name; udata.found = FALSE; @@ -1221,7 +1191,7 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Iterate over attributes, to check if "new name" exists already */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_rename_chk_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* If the new name was found, indicate an error */ @@ -1231,7 +1201,7 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, /* Iterate over attributes again, to actually rename attribute with old name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_rename_mod_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute to rename */ @@ -1240,15 +1210,15 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_rename */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_rename */ /*------------------------------------------------------------------------- @@ -1264,16 +1234,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, - hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) +H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *attr_op, void *op_data) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(loc->addr) /* Check arguments */ HDassert(loc); @@ -1282,14 +1252,14 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HDassert(attr_op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -1300,21 +1270,21 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") oh = NULL; /* Iterate over attributes in dense storage */ - if((ret_value = H5A_dense_iterate(loc->file, dxpl_id, loc_id, &ainfo, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) + if((ret_value = H5A__dense_iterate(loc->file, loc_id, &ainfo, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); } /* end if */ else { /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) + if(H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") oh = NULL; @@ -1323,23 +1293,23 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") /* Iterate over attributes in table */ - if((ret_value = H5A_attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) + if((ret_value = H5A__attr_iterate_table(&atable, skip, last_attr, loc_id, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ done: /* Release resources */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_attr_iterate_real() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_iterate + * Function: H5O__attr_iterate * * Purpose: Iterate over attributes for an object. * @@ -1351,14 +1321,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, - hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) +H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, + hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, + void *op_data) { H5G_loc_t loc; /* Object location */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(attr_op); @@ -1368,12 +1338,12 @@ H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Iterate over attributes to locate correct one */ - if((ret_value = H5O_attr_iterate_real(loc_id, loc.oloc, dxpl_id, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) + if((ret_value = H5O_attr_iterate_real(loc_id, loc.oloc, idx_type, order, skip, last_attr, attr_op, op_data)) < 0) HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes"); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_iterate() */ +} /* end H5O__attr_iterate() */ /*------------------------------------------------------------------------- @@ -1397,8 +1367,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, - hid_t dxpl_id) +H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) { H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1419,7 +1388,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, size_t u; /* Local index */ /* Build the table of attributes for this object */ - if(H5A_dense_build_table(loc->file, dxpl_id, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) + if(H5A__dense_build_table(loc->file, ainfo, H5_INDEX_NAME, H5_ITER_NATIVE, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Inspect attributes in table for ones that can't be converted back @@ -1447,7 +1416,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, else if(shared_mesg == 0) { /* Increment reference count on attribute components */ /* (so that they aren't deleted when the dense attribute storage is deleted) */ - if(H5O_attr_link(loc->file, dxpl_id, oh, (atable.attrs[u])) < 0) + if(H5O__attr_link(loc->file, oh, (atable.attrs[u])) < 0) HGOTO_ERROR(H5E_ATTR, H5E_LINKCOUNT, FAIL, "unable to adjust attribute link count") } /* end if */ else { @@ -1464,17 +1433,17 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, /* If found the attribute is already opened, use the opened message to insert. If not, still use the message in the attribute table. */ if(found_open_attr && exist_attr) { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, exist_attr) < 0) + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, exist_attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") - } else { - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, (atable.attrs[u])) < 0) + } /* end if */ + else + if(H5O__msg_append_real(loc->file, oh, H5O_MSG_ATTR, 0, 0, (atable.attrs[u])) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") - } } /* end for */ /* Remove the dense storage */ - if(H5A_dense_delete(loc->file, dxpl_id, ainfo) < 0) + if(H5A__dense_delete(loc->file, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage") } /* end if */ } /* end if */ @@ -1483,17 +1452,16 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, * message should be deleted itself. */ if(ainfo->nattrs == 0) { - if(H5O_msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + if(H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info") } /* end if */ - else { - if(H5O_msg_write_real(loc->file, dxpl_id, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) + else + if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message") - } /* end else */ done: /* Release resources */ - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") FUNC_LEAVE_NOAPI(ret_value) @@ -1531,7 +1499,7 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Check for correct attribute message to modify */ if(HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { /* Convert message into a null message (i.e. delete it) */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, TRUE) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ @@ -1550,7 +1518,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_attr_remove + * Function: H5O__attr_remove * * Purpose: Delete an attribute on an object. * @@ -1562,35 +1530,35 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_remove(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ - if(H5A_dense_remove(loc->file, dxpl_id, &ainfo, name) < 0) + if(H5A__dense_remove(loc->file, &ainfo, name) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end if */ else { @@ -1599,14 +1567,13 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = name; udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1616,23 +1583,23 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_remove() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_remove() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_remove_by_idx + * Function: H5O__attr_remove_by_idx * * Purpose: Delete an attribute on an object, according to an order within * an index. @@ -1645,8 +1612,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, hid_t dxpl_id) +H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ @@ -1654,27 +1621,27 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Delete attribute from dense storage */ - if(H5A_dense_remove_by_idx(loc->file, dxpl_id, &ainfo, idx_type, order, n) < 0) + if(H5A__dense_remove_by_idx(loc->file, &ainfo, idx_type, order, n) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute in dense storage") } /* end if */ else { @@ -1682,7 +1649,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5O_mesg_operator_t op; /* Wrapper for operator */ /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) + if(H5A__compact_build_table(loc->file, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Check for skipping too many attributes */ @@ -1691,14 +1658,13 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Set up user data for callback, to remove the attribute by name */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = ((atable.attrs[n])->shared)->name; udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1708,21 +1674,21 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, /* Update the attribute information after removing an attribute */ if(ainfo_exists) - if(H5O_attr_remove_update(loc, oh, &ainfo, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(loc->file, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - if(atable.attrs && H5A_attr_release_table(&atable) < 0) + if(atable.attrs && H5A__attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_remove_by_idx() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_remove_by_idx() */ /*------------------------------------------------------------------------- @@ -1738,11 +1704,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) +H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(oh->cache_info.addr) /* Check arguments */ HDassert(f); @@ -1755,7 +1721,7 @@ H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ /* Attempt to get the attribute information from the object header */ - if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") else if(ainfo_exists > 0) *nattrs = ainfo.nattrs; @@ -1775,7 +1741,7 @@ H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) } /* end else */ done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_attr_count_real */ @@ -1820,7 +1786,7 @@ H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, /*------------------------------------------------------------------------- - * Function: H5O_attr_exists + * Function: H5O__attr_exists * * Purpose: Determine if an attribute with a particular name exists on an object * @@ -1832,34 +1798,34 @@ H5O_attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, *------------------------------------------------------------------------- */ htri_t -H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) +H5O__attr_exists(const H5O_loc_t *loc, const char *name) { H5O_t *oh = NULL; /* Pointer to actual object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ HDassert(loc); HDassert(name); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for attributes stored densely */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Check if attribute exists in dense storage */ - if((ret_value = H5A_dense_exists(loc->file, dxpl_id, &ainfo, name)) < 0) + if((ret_value = H5A__dense_exists(loc->file, &ainfo, name)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") } /* end if */ else { @@ -1868,14 +1834,13 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Set up user data for callback */ udata.f = loc->file; - udata.dxpl_id = dxpl_id; udata.name = name; udata.found = FALSE; /* Iterate over existing attributes, checking for attribute with same name */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O_attr_exists_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") /* Check that we found the attribute */ @@ -1883,15 +1848,15 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) } /* end else */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_attr_exists */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__attr_exists() */ /*------------------------------------------------------------------------- - * Function: H5O_attr_bh_info + * Function: H5O__attr_bh_info * * Purpose: For 1.8 attribute, returns storage amount for btree and fractal heap * @@ -1903,14 +1868,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) { H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(oh); @@ -1922,39 +1887,39 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(f, dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(f, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") else if(ainfo_exists > 0) { /* Check if name index available */ if(H5F_addr_defined(ainfo.name_bt2_addr)) { /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(f, dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(f, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Get name index B-tree size */ - if(H5B2_size(bt2_name, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_name, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Check if creation order index available */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(f, dxpl_id, ainfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(f, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Get creation order index B-tree size */ - if(H5B2_size(bt2_corder, dxpl_id, &(bh_info->index_size)) < 0) + if(H5B2_size(bt2_corder, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ /* Get storage size of fractal heap, if it's used */ if(H5F_addr_defined(ainfo.fheap_addr)) { /* Open the fractal heap for attributes */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, ainfo.fheap_addr))) + if(NULL == (fheap = H5HF_open(f, ainfo.fheap_addr))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &(bh_info->heap_size)) < 0) + if(H5HF_size(fheap, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") } /* end if */ } /* end else */ @@ -1962,20 +1927,20 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2_name && H5B2_close(bt2_name, dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_attr_bh_info() */ +} /* H5O__attr_bh_info() */ #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5O_attr_count + * Function: H5O__attr_count * * Purpose: Determine the # of attributes on an object * @@ -1987,33 +1952,33 @@ done: *------------------------------------------------------------------------- */ int -H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) +H5O__attr_count(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Pointer to actual object header */ hsize_t nattrs; /* Number of attributes */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_ATTR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve # of attributes on object */ - if(H5O_attr_count_real(loc->file, dxpl_id, oh, &nattrs) < 0) + if(H5O_attr_count_real(loc->file, oh, &nattrs) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Set return value */ ret_value = (int)nattrs; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_attr_count */ +} /* end H5O__attr_count */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Obogus.c b/src/H5Obogus.c index a3531ed..4542d30 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -37,12 +37,12 @@ #ifdef H5O_ENABLE_BOGUS /* PRIVATE PROTOTYPES */ -static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__bogus_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_bogus_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_bogus_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__bogus_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ @@ -50,7 +50,7 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ "bogus valid", /*message name for debugging */ 0, /*native message size */ 0, /* messages are sharable? */ - H5O_bogus_decode, /*decode message */ + H5O__bogus_decode, /*decode message */ H5O_bogus_encode, /*encode message */ NULL, /*copy the native value */ H5O_bogus_size, /*raw message size */ @@ -65,7 +65,7 @@ const H5O_msg_class_t H5O_MSG_BOGUS_VALID[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_bogus_debug /*debug the message */ + H5O__bogus_debug /*debug the message */ }}; /* This message derives from H5O message class */ @@ -74,8 +74,8 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ "bogus invalid", /*message name for debugging */ 0, /*native message size */ 0, /* messages are sharable? */ - H5O_bogus_decode, /*decode message */ - H5O_bogus_encode, /*encode message */ + H5O__bogus_decode, /*decode message */ + H5O__bogus_encode, /*encode message */ NULL, /*copy the native value */ H5O_bogus_size, /*raw message size */ NULL, /*free internal memory */ @@ -89,12 +89,12 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_bogus_debug /*debug the message */ + H5O__bogus_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_bogus_decode + * Function: H5O__bogus_decode * * Purpose: Decode a "bogus" message and return a pointer to a new * native message struct. @@ -110,13 +110,13 @@ const H5O_msg_class_t H5O_MSG_BOGUS_INVALID[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_bogus_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__bogus_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_bogus_t *mesg = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -141,7 +141,7 @@ done: H5MM_xfree(mesg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_bogus_decode() */ +} /* end H5O__bogus_decode() */ /*------------------------------------------------------------------------- @@ -202,7 +202,7 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha /*------------------------------------------------------------------------- - * Function: H5O_bogus_debug + * Function: H5O__bogus_debug * * Purpose: Prints debugging info for the message. * @@ -217,12 +217,12 @@ H5O_bogus_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha *------------------------------------------------------------------------- */ static herr_t -H5O_bogus_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O__bogus_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_bogus_t *mesg = (const H5O_bogus_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -235,6 +235,6 @@ H5O_bogus_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Bogus Value:", mesg->u); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_bogus_debug() */ +} /* end H5O__bogus_debug() */ #endif /* H5O_ENABLE_BOGUS */ diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 4fd0577..4b7875e 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -27,13 +27,13 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_btreek_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_btreek_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_btreek_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_btreek_copy(const void *_mesg, void *_dest); static size_t H5O_btreek_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_btreek_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__btreek_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ @@ -56,7 +56,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_btreek_debug /*debug the message */ + H5O__btreek_debug /*debug the message */ }}; /* Current version of v1 B-tree 'K' value information */ @@ -78,7 +78,7 @@ const H5O_msg_class_t H5O_MSG_BTREEK[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_btreek_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_btreek_t *mesg; /* Native message */ @@ -219,7 +219,7 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh /*------------------------------------------------------------------------- - * Function: H5O_btreek_debug + * Function: H5O__btreek_debug * * Purpose: Prints debugging info for the message. * @@ -231,12 +231,12 @@ H5O_btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh *------------------------------------------------------------------------- */ static herr_t -H5O_btreek_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__btreek_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -253,5 +253,5 @@ H5O_btreek_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo "Symbol table node leaf 'K' value:", mesg->sym_leaf_k); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_btreek_debug() */ +} /* end H5O__btreek_debug() */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8f4c155..02dd63f 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -799,7 +799,7 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, } /* end else */ /* Increment reference count of object header */ - if(H5O_inc_rc(udata->oh) < 0) + if(H5O__inc_rc(udata->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "can't increment reference count on object header") chk_proxy->oh = udata->oh; @@ -912,7 +912,6 @@ static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) { H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; - H5O_chunk_proxy_t *cont_chk_proxy = NULL; /* Proxy for chunk containing continuation message that points to this chunk, if not chunk 0 */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -927,37 +926,26 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: if(chk_proxy->oh->swmr_write) { - /* Add flush dependency on chunk parent */ - { - void *parent; /* Chunk containing continuation message that points to this chunk */ - - /* Determine the parent of the chunk */ - if(chk_proxy->cont_chunkno == 0) - parent = chk_proxy->oh; - else { - if(NULL == (cont_chk_proxy = H5O_chunk_protect(chk_proxy->f, H5AC_ind_read_dxpl_id, chk_proxy->oh, chk_proxy->cont_chunkno))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - parent = cont_chk_proxy; - } /* end else */ - + /* Add flush dependency on chunk with continuation, if one exists */ + if(chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(parent); - HDassert(((H5C_cache_entry_t *)parent)->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(((H5C_cache_entry_t *)parent)->type); - HDassert((((H5C_cache_entry_t *)(parent))->type->id == H5AC_OHDR_ID) - || (((H5C_cache_entry_t *)(parent))->type->id == H5AC_OHDR_CHK_ID)); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) + || (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); /* Add flush dependency from chunk containing the continuation message * that points to this chunk (either oh or another chunk proxy object) */ - if(H5AC_create_flush_dependency(parent, chk_proxy) < 0) + if(H5AC_create_flush_dependency(chk_proxy->fd_parent, chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ - /* Make note of the address and pointer of the flush dependency - * parent so we can take the dependency down on eviction. - */ - chk_proxy->parent = parent; - } + /* Add flush dependency on object header */ + { + if(H5AC_create_flush_dependency(chk_proxy->oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDEPEND, FAIL, "unable to create flush dependency") + } /* end if */ /* Add flush dependency on object header proxy, if proxy exists */ { @@ -996,17 +984,21 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_BEFORE_EVICT: if(chk_proxy->oh->swmr_write) { - /* Remove flush dependency on parent object header chunk */ - { + /* Remove flush dependency on parent object header chunk, if one is set */ + if(chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(chk_proxy->parent != NULL); - HDassert(((H5C_cache_entry_t *)(chk_proxy->parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(((H5C_cache_entry_t *)(chk_proxy->parent))->type); - HDassert((((H5C_cache_entry_t *)(chk_proxy->parent))->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)(chk_proxy->parent))->type->id == H5AC_OHDR_CHK_ID)); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); - if(H5AC_destroy_flush_dependency(chk_proxy->parent, chk_proxy) < 0) + if(H5AC_destroy_flush_dependency(chk_proxy->fd_parent, chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") - } + chk_proxy->fd_parent = NULL; + } /* end if */ + + /* Unregister the object header as a parent of the virtual entry */ + if(H5AC_destroy_flush_dependency(chk_proxy->oh, chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") /* Unregister the object header chunk as a parent of the virtual entry */ if(H5AC_proxy_entry_remove_parent(chk_proxy->oh->proxy, chk_proxy) < 0) @@ -1023,10 +1015,6 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) } /* end switch */ done: - if(cont_chk_proxy) - if(H5O_chunk_unprotect(chk_proxy->f, H5AC_ind_read_dxpl_id, cont_chk_proxy, FALSE) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_chk_notify() */ @@ -1515,7 +1503,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image H5O_cont_t *cont; /* Decode continuation message */ - cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + cont = (H5O_cont_t *)(H5O_MSG_CONT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw); H5_CHECKED_ASSIGN(cont->chunkno, unsigned, udata->cont_msg_info->nmsgs + 1, size_t); /* the next continuation message/chunk */ /* Save 'native' form of continuation message */ @@ -1531,7 +1519,7 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image /* Decode ref. count message */ HDassert(oh->version > H5O_VERSION_1); - refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, udata->dxpl_id, NULL, 0, &ioflags, mesg->raw); + refcount = (H5O_refcount_t *)(H5O_MSG_REFCOUNT->decode)(udata->f, NULL, 0, &ioflags, mesg->raw); /* Save 'native' form of ref. count message */ mesg->native = refcount; diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index a427b49..acf5b5b 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -37,7 +37,7 @@ #include "H5MFprivate.h" /* File space management */ /* Callbacks for message class */ -static void *H5O__mdci_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__mdci_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O__mdci_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); @@ -45,10 +45,9 @@ static void *H5O__mdci_copy(const void *_mesg, void *_dest); static size_t H5O__mdci_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__mdci_free(void *mesg); -static herr_t H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); -static herr_t H5O__mdci_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE *stream, int indent, int fwidth); +static herr_t H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static herr_t H5O__mdci_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MDCI[1] = {{ @@ -97,9 +96,9 @@ H5FL_DEFINE(H5O_mdci_t); *------------------------------------------------------------------------- */ static void * -H5O__mdci_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, - H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) +H5O__mdci_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, + const uint8_t *p) { H5O_mdci_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ @@ -276,7 +275,7 @@ H5O__mdci_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__mdci_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_mdci_t *mesg = (H5O_mdci_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -325,11 +324,11 @@ H5O__mdci_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) if(H5F_FIRST_ALLOC_DEALLOC(f)) { HDassert(HADDR_UNDEF != H5F_EOA_PRE_FSM_FSALLOC(f)); HDassert(H5F_addr_ge(mesg->addr, H5F_EOA_PRE_FSM_FSALLOC(f))); - if(H5MF_tidy_self_referential_fsm_hack(f, dxpl_id) < 0) + if(H5MF_tidy_self_referential_fsm_hack(f) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "tidy of self referential fsm hack failed") } /* end if */ else { - if(H5MF_xfree(f, H5FD_MEM_SUPER, dxpl_id, mesg->addr, mesg->size) < 0) + if(H5MF_xfree(f, H5FD_MEM_SUPER, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free file space for cache image block") } /* end else */ } /* end if */ @@ -352,8 +351,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - const void *_mesg, FILE * stream, int indent, int fwidth) +H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_mdci_t *mdci = (const H5O_mdci_t *) _mesg; diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index dbc894c..205515a 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -77,7 +77,7 @@ H5FL_DEFINE(H5O_chunk_proxy_t); /*------------------------------------------------------------------------- - * Function: H5O_chunk_add + * Function: H5O__chunk_add * * Purpose: Add new chunk for object header to metadata cache * @@ -91,13 +91,13 @@ H5FL_DEFINE(H5O_chunk_proxy_t); *------------------------------------------------------------------------- */ herr_t -H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, - unsigned cont_chunkno) +H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for chunk, to mark it dirty in the cache */ + H5O_chunk_proxy_t *cont_chk_proxy = NULL; /* Proxy for chunk containing continuation message that points to this chunk, if not chunk 0 */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -110,32 +110,43 @@ H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Increment reference count on object header */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "can't increment reference count on object header") /* Set the values in the chunk proxy */ chk_proxy->f = f; chk_proxy->oh = oh; chk_proxy->chunkno = idx; - chk_proxy->cont_chunkno = cont_chunkno; + + /* Determine the parent of the chunk */ + if(cont_chunkno != 0) { + if(NULL == (cont_chk_proxy = H5O__chunk_protect(f, oh, cont_chunkno))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") + chk_proxy->fd_parent = cont_chk_proxy; + } /* end else */ /* Insert the chunk proxy into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header chunk") - chk_proxy = NULL; done: + /* Cleanup on failure */ if(ret_value < 0) if(chk_proxy && H5O__chunk_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_chunk_add() */ + /* Release resources */ + if(cont_chk_proxy) + if(H5O__chunk_unprotect(f, cont_chk_proxy, FALSE) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") + + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_add() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_protect + * Function: H5O__chunk_protect * * Purpose: Protect an object header chunk for modifications * @@ -149,12 +160,12 @@ done: *------------------------------------------------------------------------- */ H5O_chunk_proxy_t * -H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for protected chunk */ H5O_chunk_proxy_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, NULL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -169,7 +180,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Increment reference count on object header */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "can't increment reference count on object header") /* Set chunk proxy fields */ @@ -188,7 +199,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -205,12 +216,12 @@ done: if(0 == idx && chk_proxy && H5O__chunk_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header chunk") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_chunk_protect() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_protect() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_unprotect + * Function: H5O__chunk_unprotect * * Purpose: Unprotect an object header chunk after modifications * @@ -224,12 +235,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, - hbool_t dirtied) +H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t dirtied) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -245,7 +255,7 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, } /* end else/if */ /* Decrement reference count of object header */ - if(H5O_dec_rc(chk_proxy->oh) < 0) + if(H5O__dec_rc(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header") /* Free fake chunk proxy */ @@ -253,13 +263,13 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, } /* end if */ else { /* Release the chunk proxy from the cache, possibly marking it dirty */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) + if(H5AC_unprotect(f, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_chunk_unprotect() */ +} /* end H5O__chunk_unprotect() */ /*------------------------------------------------------------------------- @@ -305,7 +315,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_chunk_update_idx + * Function: H5O__chunk_update_idx * * Purpose: Update the chunk index for a chunk proxy * @@ -319,13 +329,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx) { - H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to mark it dirty in the cache */ + H5O_chunk_proxy_t *chk_proxy = NULL;/* Proxy for chunk, to mark it dirty in the cache */ H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -341,23 +351,23 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Update index for chunk proxy in cache */ chk_proxy->chunkno = idx; /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__DIRTIED_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, H5AC__DIRTIED_FLAG) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_chunk_update_idx() */ +} /* end H5O__chunk_update_idx() */ /*------------------------------------------------------------------------- - * Function: H5O_chunk_delete + * Function: H5O__chunk_delete * * Purpose: Notify metadata cache that a chunk has been deleted * @@ -371,14 +381,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) +H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx) { - H5O_chunk_proxy_t *chk_proxy; /* Proxy for chunk, to mark it dirty in the cache */ - H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ + H5O_chunk_proxy_t *chk_proxy = NULL;/* Proxy for chunk, to mark it dirty in the cache */ unsigned cache_flags = H5AC__DELETED_FLAG; /* Flags for unprotecting proxy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ HDassert(f); @@ -386,32 +395,21 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDassert(idx < oh->nchunks); HDassert(idx > 0); - /* Construct the user data for protecting chunk proxy */ - /* (and _not_ decoding it) */ - HDmemset(&chk_udata, 0, sizeof(chk_udata)); - chk_udata.oh = oh; - chk_udata.chunkno = idx; - chk_udata.size = oh->chunk[idx].size; - /* Get the chunk proxy */ - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") - /* Sanity check */ - HDassert(chk_proxy->oh == oh); - HDassert(chk_proxy->chunkno == idx); - /* Only free file space if not doing SWMR writes */ if(!oh->swmr_write) cache_flags |= H5AC__DIRTIED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; +done: /* Release the chunk proxy from the cache, marking it deleted */ - if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, cache_flags) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") + if(chk_proxy && H5AC_unprotect(f, H5AC_OHDR_CHK, oh->chunk[idx].addr, chk_proxy, cache_flags) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") -done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_chunk_delete() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__chunk_delete() */ /*------------------------------------------------------------------------- @@ -439,7 +437,7 @@ H5O__chunk_dest(H5O_chunk_proxy_t *chk_proxy) HDassert(chk_proxy); /* Decrement reference count of object header */ - if(chk_proxy->oh && H5O_dec_rc(chk_proxy->oh) < 0) + if(chk_proxy->oh && H5O__dec_rc(chk_proxy->oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "can't decrement reference count on object header") /* Release the chunk proxy object */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index b002a32..42dfca9 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -36,14 +36,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_cont_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_cont_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_cont_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_cont_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_cont_free(void *mesg); -static herr_t H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -static herr_t H5O_cont_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__cont_free(void *mesg); +static herr_t H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static herr_t H5O__cont_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ @@ -56,8 +56,8 @@ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ NULL, /*no copy method */ H5O_cont_size, /*size of header continuation */ NULL, /*reset method */ - H5O_cont_free, /* free method */ - H5O_cont_delete, /* file delete method */ + H5O__cont_free, /* free method */ + H5O__cont_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ @@ -66,7 +66,7 @@ const H5O_msg_class_t H5O_MSG_CONT[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_cont_debug /*debugging */ + H5O__cont_debug /*debugging */ }}; /* Declare the free list for H5O_cont_t's */ @@ -89,7 +89,7 @@ H5FL_DEFINE(H5O_cont_t); *------------------------------------------------------------------------- */ static void * -H5O_cont_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_cont_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_cont_t *cont = NULL; @@ -186,9 +186,9 @@ H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_cont_free + * Function: H5O__cont_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -198,20 +198,20 @@ H5O_cont_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_cont_free(void *mesg) +H5O__cont_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_cont_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cont_free() */ +} /* end H5O__cont_free() */ /*------------------------------------------------------------------------- - * Function: H5O_cont_delete + * Function: H5O__cont_delete * * Purpose: Free file space referenced by message * @@ -223,12 +223,12 @@ H5O_cont_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_cont_t *mesg = (H5O_cont_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -236,16 +236,16 @@ H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Notify the cache that the chunk has been deleted */ /* (releases the space for the chunk) */ - if(H5O_chunk_delete(f, dxpl_id, open_oh, mesg->chunkno) < 0) + if(H5O__chunk_delete(f, open_oh, mesg->chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cont_delete() */ +} /* end H5O__cont_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_cont_debug + * Function: H5O__cont_debug * * Purpose: Prints debugging info. * @@ -260,12 +260,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cont_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__cont_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -285,4 +285,4 @@ H5O_cont_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void (int) (cont->chunkno)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cont_debug() */ +} /* end H5O__cont_debug() */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index aa2a9e0..9681bc1 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -34,6 +34,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ @@ -66,7 +67,6 @@ typedef struct H5O_copy_search_comm_dt_ud_t { H5SL_t *dst_dt_list; /* Skip list of committed datatypes */ H5G_loc_t *dst_root_loc; /* Starting location for iteration */ H5O_loc_t obj_oloc; /* Object location (for attribute iteration callback) */ - hid_t dxpl_id; /* Dataset transfer property list id */ } H5O_copy_search_comm_dt_ud_t; @@ -79,23 +79,25 @@ typedef struct H5O_copy_search_comm_dt_ud_t { /* Local Prototypes */ /********************/ -static herr_t H5O_copy_free_addrmap_cb(void *item, void *key, void *op_data); -static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); -static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, hid_t ocpypl_id); -static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, - const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id); -static herr_t H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, - H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info); -static herr_t H5O_copy_free_comm_dt_cb(void *item, void *key, void *op_data); -static int H5O_copy_comm_dt_cmp(const void *dt1, const void *dt2); -static herr_t H5O_copy_search_comm_dt_cb(hid_t group, const char *name, +static herr_t H5O__copy(const H5G_loc_t *loc, const char *src_name, + H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_free_addrmap_cb(void *item, void *key, void *op_data); +static herr_t H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); +static herr_t H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); +static herr_t H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, + H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info); +static herr_t H5O__copy_free_comm_dt_cb(void *item, void *key, void *op_data); +static int H5O__copy_comm_dt_cmp(const void *dt1, const void *dt2); +static herr_t H5O__copy_search_comm_dt_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *udata); -static htri_t H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); +static htri_t H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info); +static herr_t H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst, H5O_copy_t *cpy_info); /*********************/ @@ -202,19 +204,11 @@ H5FL_DEFINE(haddr_t); */ herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, - const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { H5G_loc_t loc; /* Source group group location */ - H5G_loc_t src_loc; /* Source object group location */ H5G_loc_t dst_loc; /* Destination group location */ - - /* for opening the destination object */ - H5G_name_t src_path; /* Opened source object hier. path */ - H5O_loc_t src_oloc; /* Opened source object object location */ - htri_t dst_exists; /* Does destination name exist already? */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - hbool_t obj_open = FALSE; /* Entry at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -231,8 +225,63 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, if(!dst_name || !*dst_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination name specified") - /* check if destination name already exists */ - if((dst_exists = H5L_exists_tolerant(&dst_loc, dst_name, H5P_DEFAULT, dxpl_id)) < 0) +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(src_loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set collective metadata read info") + + /* Call internal routine to copy object */ + if(H5O__copy(&loc, src_name, &dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Ocopy() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__copy + * + * Purpose: Internal routine to copy an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, + const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) +{ + H5G_loc_t src_loc; /* Source object group location */ + H5G_name_t src_path; /* Opened source object hier. path */ + H5O_loc_t src_oloc; /* Opened source object object location */ + htri_t dst_exists; /* Does destination name exist already? */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + hbool_t obj_open = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(src_name && *src_name); + HDassert(dst_loc); + HDassert(dst_name && *dst_name); + + /* Check if destination name already exists */ + if((dst_exists = H5L_exists_tolerant(dst_loc, dst_name)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to check if destination name exists") if(TRUE == dst_exists) HGOTO_ERROR(H5E_OHDR, H5E_EXISTS, FAIL, "destination object already exists") @@ -243,7 +292,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_reset(&src_loc); /* Find the source object to copy */ - if(H5G_loc_find(&loc, src_name, &src_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, src_name, &src_loc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "source object not found") loc_found = TRUE; @@ -254,7 +303,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, /* Get correct property lists */ if(H5P_DEFAULT == lcpl_id) { - if((lcpl_id = H5L_get_default_lcpl()) < 0) + if((lcpl_id = H5P_get_default(H5P_CLS_LCRT)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default lcpl") } /* end if */ else @@ -262,14 +311,16 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link creation property list") /* Get object copy property list */ - if(H5P_DEFAULT == ocpypl_id) - ocpypl_id = H5P_OBJECT_COPY_DEFAULT; + if(H5P_DEFAULT == ocpypl_id) { + if((ocpypl_id = H5P_get_default(H5P_CLS_OCPY)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to get default ocpypl") + } /* end if */ else if(TRUE != H5P_isa_class(ocpypl_id, H5P_OBJECT_COPY)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not object copy property list") /* Do the actual copying of the object */ - if(H5O_copy_obj(&src_loc, &dst_loc, dst_name, ocpypl_id, lcpl_id, dxpl_id) < 0) + if(H5O__copy_obj(&src_loc, dst_loc, dst_name, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: @@ -278,12 +329,12 @@ done: if(obj_open && H5O_close(&src_oloc, NULL) < 0) HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") - FUNC_LEAVE_API(ret_value) -} /* end H5Ocopy() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__copy() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_header_real + * Function: H5O__copy_header_real * * Purpose: Copy header object from one location to another using * pre-copy, copy, and post-copy callbacks for each message @@ -300,19 +351,11 @@ done: * Programmer: Peter Cao * May 30, 2005 * - * Modifications: - * Vailin Choi; Feb 2012 - * Bug fix for HDFFV-7853 - * When the object is opened, call the object's flush class action - * to ensure that cached data is flushed so that H5Ocopy will get - * the correct data. - * *------------------------------------------------------------------------- */ static herr_t -H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, - void **udata /*out*/) +H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5O_t *oh_src = NULL; /* Object header for source object */ @@ -335,7 +378,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, size_t msghdr_size; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oloc_src->addr, FAIL) + FUNC_ENTER_STATIC_TAG(oloc_src->addr) HDassert(oloc_src); HDassert(oloc_src->file); @@ -344,14 +387,14 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, HDassert(cpy_info); /* Get pointer to object class for this object */ - if(NULL == (obj_class = H5O_obj_class(oloc_src, dxpl_id))) + if(NULL == (obj_class = H5O__obj_class(oloc_src))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") /* Set the pointer to the shared struct for the object if opened in the file */ cpy_info->shared_fo = H5FO_opened(oloc_src->file, oloc_src->addr); /* Get source object header */ - if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh_src = H5O_protect(oloc_src, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve user data for particular type of object to copy */ @@ -376,7 +419,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, else /* Search for a matching committed datatype, building the list if * necessary */ - if((merge = H5O_copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info)) < 0) + if((merge = H5O__copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't search for matching committed datatype") if(merge) { @@ -488,7 +531,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, if(copy_type->pre_copy_file) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL) /* Perform "pre copy" operation on message */ if((copy_type->pre_copy_file)(oloc_src->file, mesg_src->native, @@ -560,7 +603,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, unsigned mesg_flags; /* Message flags */ /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + H5O_LOAD_NATIVE(oloc_src->file, 0, oh_src, mesg_src, FAIL) /* Get destination message flags, and unset shared and shareable * flags. mesg_dst->flags will contain the original flags for now. @@ -570,9 +613,9 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Copy the source message */ recompute_size = FALSE; - if((mesg_dst->native = H5O_msg_copy_file(copy_type, oloc_src->file, + if(NULL == (mesg_dst->native = H5O__msg_copy_file(copy_type, oloc_src->file, mesg_src->native, oloc_dst->file, &recompute_size, - &mesg_flags, cpy_info, cpy_udata, dxpl_id)) == NULL) + &mesg_flags, cpy_info, cpy_udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object header message") /* Check if the sharing state changed, and recompute the size if so @@ -653,7 +696,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, dst_oh_size += (uint64_t)H5O_SIZEOF_HDR(oh_dst); /* Allocate space for chunk in destination file */ - if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, dxpl_id, (hsize_t)dst_oh_size))) + if(HADDR_UNDEF == (oh_dst->chunk[0].addr = H5MF_alloc(oloc_dst->file, H5FD_MEM_OHDR, (hsize_t)dst_oh_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") addr_new = oh_dst->chunk[0].addr; @@ -756,7 +799,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, * the copied datatype into the list of committed datatypes in the target file. */ if(cpy_info->merge_comm_dt && obj_class->type == H5O_TYPE_NAMED_DATATYPE) - if(H5O_copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info) < 0) + if(H5O__copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't insert committed datatype into destination list") /* Allocate space for the address mapping of the object copied */ @@ -821,7 +864,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Perform "post copy" operation on message */ if((copy_type->post_copy_file)(oloc_src, mesg_src->native, oloc_dst, - mesg_dst->native, &mesg_flags, dxpl_id, cpy_info) < 0) + mesg_dst->native, &mesg_flags, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to perform 'post copy' operation on message") /* Verify that the flags did not change */ @@ -843,16 +886,16 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, FAIL, "unable to re-tag metadata entries") /* Set metadata tag for destination object's object header */ - H5_BEGIN_TAG(dxpl_id, oloc_dst->addr, FAIL); + H5_BEGIN_TAG(oloc_dst->addr); /* Insert destination object header in cache */ - if(H5AC_insert_entry(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(oloc_dst->file, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") oh_dst = NULL; inserted = TRUE; /* Reset metadat tag */ - H5_END_TAG(FAIL); + H5_END_TAG /* Set obj_type and udata, if requested */ if(obj_type) { @@ -867,7 +910,7 @@ done: H5MM_free(deleted); /* Release pointer to source object header and its derived objects */ - if(oh_src && H5O_unprotect(oloc_src, dxpl_id, oh_src, H5AC__NO_FLAGS_SET) < 0) + if(oh_src && H5O_unprotect(oloc_src, oh_src, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") /* Free destination object header on failure */ @@ -878,8 +921,8 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5O_copy_header_real() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__copy_header_real() */ /*------------------------------------------------------------------------- @@ -897,8 +940,8 @@ done: */ herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, - H5O_type_t *obj_type, void **udata /*out*/) + H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, + void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5_obj_t src_obj_pos; /* Position of source object */ @@ -932,8 +975,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, cpy_info->curr_depth++; /* Copy object referred to */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, cpy_info, obj_type, - udata) < 0) + if(H5O__copy_header_real(oloc_src, oloc_dst, cpy_info, obj_type, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check for incrementing the depth of copy */ @@ -972,7 +1014,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Increment destination object's link count, if allowed */ if(inc_link) - if(H5O_link(oloc_dst, 1, dxpl_id) < 0) + if(H5O_link(oloc_dst, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to increment object link count") done: @@ -982,11 +1024,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_copy_free_addrmap_cb + H5O__copy_free_addrmap_cb PURPOSE Internal routine to free address maps from the skip list for copying objects USAGE - herr_t H5O_copy_free_addrmap_cb(item, key, op_data) + herr_t H5O__copy_free_addrmap_cb(item, key, op_data) void *item; IN/OUT: Pointer to addr void *key; IN/OUT: (unused) void *op_data; IN: (unused) @@ -1000,11 +1042,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) +H5O__copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) { H5O_addr_map_t *item = (H5O_addr_map_t *)_item; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(item); @@ -1019,11 +1061,11 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU item = H5FL_FREE(H5O_addr_map_t, item); FUNC_LEAVE_NOAPI(0) -} /* H5O_copy_free_addrmap_cb() */ +} /* H5O__copy_free_addrmap_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_header + * Function: H5O__copy_header * * Purpose: copy header object from one location to another. * @@ -1035,8 +1077,8 @@ H5O_copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static herr_t -H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, hid_t ocpypl_id) +H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, + hid_t ocpypl_id, hid_t lcpl_id) { H5O_copy_t cpy_info; /* Information for copying object */ H5P_genplist_t *ocpy_plist; /* Object copy property list created */ @@ -1045,7 +1087,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, unsigned cpy_option = 0; /* Copy options */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oloc_src); @@ -1100,26 +1142,29 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info.mcdt_cb = cb_info.func; cpy_info.mcdt_ud = cb_info.user_data; + /* Add property lists needed by callbacks */ + cpy_info.lcpl_id = lcpl_id; + /* Create a skip list to keep track of which objects are copied */ if(NULL == (cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL))) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0) + if(H5O__copy_header_real(oloc_src, oloc_dst, &cpy_info, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: if(cpy_info.map_list) - H5SL_destroy(cpy_info.map_list, H5O_copy_free_addrmap_cb, NULL); + H5SL_destroy(cpy_info.map_list, H5O__copy_free_addrmap_cb, NULL); if(cpy_info.dst_dt_list) - H5SL_destroy(cpy_info.dst_dt_list, H5O_copy_free_comm_dt_cb, NULL); + H5SL_destroy(cpy_info.dst_dt_list, H5O__copy_free_comm_dt_cb, NULL); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_header() */ +} /* end H5O__copy_header() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_obj + * Function: H5O__copy_obj * * Purpose: Copy an object to destination location * @@ -1131,8 +1176,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, - hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id) +H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, + hid_t ocpypl_id, hid_t lcpl_id) { H5G_name_t new_path; /* Copied object group hier. path */ H5O_loc_t new_oloc; /* Copied object object location */ @@ -1141,7 +1186,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hbool_t entry_inserted = FALSE; /* Flag to indicate that the new entry was inserted into a group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(src_loc); HDassert(src_loc->oloc->file); @@ -1156,12 +1201,12 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, new_oloc.file = dst_loc->oloc->file; /* Make a copy of the destination file, in case the original is changed by - * H5O_copy_header. If and when oloc's point to the shared file struct, + * H5O__copy_header. If and when oloc's point to the shared file struct, * this will no longer be necessary, so this code can be removed. */ cached_dst_file = dst_loc->oloc->file; /* Copy the object from the source file to the destination file */ - if(H5O_copy_header(src_loc->oloc, &new_oloc, dxpl_id, ocpypl_id) < 0) + if(H5O__copy_header(src_loc->oloc, &new_oloc, ocpypl_id, lcpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Patch dst_loc. Again, this can be removed once oloc's point to shared @@ -1169,7 +1214,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, dst_loc->oloc->file = cached_dst_file; /* Insert the new object in the destination file's group */ - if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id, H5P_DEFAULT, dxpl_id) < 0) + if(H5L_link(dst_loc, dst_name, &new_loc, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link") entry_inserted = TRUE; @@ -1179,11 +1224,11 @@ done: H5G_loc_free(&new_loc); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_obj() */ +} /* end H5O__copy_obj() */ /*------------------------------------------------------------------------- - * Function: H5O_copy_obj_by_ref + * Function: H5O__copy_obj_by_ref * * Purpose: Copy the object pointed by _src_ref. * @@ -1195,19 +1240,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, +H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC HDassert(src_oloc); HDassert(dst_oloc); /* Perform the copy, or look up existing copy */ - if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, - FALSE, NULL, NULL)) < 0) + if((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, FALSE, NULL, NULL)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Check if a new valid object is copied to the destination */ @@ -1233,7 +1277,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, * pass the obj_type and udata fields returned by H5O_copy_header_map. * This could be changed in the future to slightly improve performance * --NAF */ - if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, H5P_DEFAULT, H5P_DEFAULT, dxpl_id) < 0) + if(H5L_link(dst_root_loc, tmp_obj_name, &new_loc, cpy_info->lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert link") H5G_loc_free(&new_loc); @@ -1241,7 +1285,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_obj_by_ref() */ +} /* end H5O__copy_obj_by_ref() */ /*------------------------------------------------------------------------- @@ -1257,9 +1301,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, - H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type, - H5O_copy_t *cpy_info) +H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, H5F_t *file_dst, + void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info) { H5O_loc_t dst_oloc; /* Copied object object location */ H5O_loc_t src_oloc; /* Temporary object location for source object */ @@ -1305,7 +1348,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, /* Attempt to copy object from source to destination file */ if(src_oloc.addr != (haddr_t)0) { - if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0) + if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") } /* end if */ else @@ -1334,7 +1377,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, if(hobjid.addr != (haddr_t)0) { /* Get the dataset region from the heap (allocate inside routine) */ - if((buf = (uint8_t *)H5HG_read(src_oloc.file, dxpl_id, &hobjid, NULL, &buf_size)) == NULL) + if((buf = (uint8_t *)H5HG_read(src_oloc.file, &hobjid, NULL, &buf_size)) == NULL) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -1343,7 +1386,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, dst_oloc.addr = HADDR_UNDEF; /* copy the object pointed by the ref to the destination */ - if(H5O_copy_obj_by_ref(&src_oloc, dxpl_id, &dst_oloc, &dst_root_loc, cpy_info) < 0) { + if(H5O__copy_obj_by_ref(&src_oloc, &dst_oloc, &dst_root_loc, cpy_info) < 0) { H5MM_xfree(buf); HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") } /* end if */ @@ -1353,7 +1396,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, H5F_addr_encode(dst_oloc.file, &p, dst_oloc.addr); /* Save the serialized buffer to the destination */ - if(H5HG_insert(dst_oloc.file, dxpl_id, buf_size, buf, &hobjid) < 0) { + if(H5HG_insert(dst_oloc.file, buf_size, buf, &hobjid) < 0) { H5MM_xfree(buf); HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "Unable to write dataset region information") } /* end if */ @@ -1380,7 +1423,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_free_comm_dt_cb + * Function: H5O__copy_free_comm_dt_cb * * Purpose: Frees the merge committed dt skip list key and object. * @@ -1392,12 +1435,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) +H5O__copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *_op_data) { haddr_t *addr = (haddr_t *)item; H5O_copy_search_comm_dt_key_t *key = (H5O_copy_search_comm_dt_key_t *)_key; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(addr); HDassert(key); @@ -1408,11 +1451,11 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) addr = H5FL_FREE(haddr_t, addr); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_copy_free_comm_dt_cb */ +} /* end H5O__copy_free_comm_dt_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_comm_dt_cmp + * Function: H5O__copy_comm_dt_cmp * * Purpose: Skiplist callback used to compare 2 keys for the merge * committed dt list. Mostly a wrapper for H5T_cmp. @@ -1427,13 +1470,13 @@ H5O_copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *op_data) *------------------------------------------------------------------------- */ static int -H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2) +H5O__copy_comm_dt_cmp(const void *_key1, const void *_key2) { const H5O_copy_search_comm_dt_key_t *key1 = (const H5O_copy_search_comm_dt_key_t *)_key1; const H5O_copy_search_comm_dt_key_t *key2 = (const H5O_copy_search_comm_dt_key_t *)_key2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check fileno. It is unlikely to be different so check if they are equal * first so only one comparison needs to be made. */ @@ -1448,7 +1491,7 @@ H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_comm_dt_cmp */ +} /* end H5O__copy_comm_dt_cmp */ /*------------------------------------------------------------------------- @@ -1546,10 +1589,6 @@ done: * Programmer: Neil Fortner * Nov 3 2011 * - * Modifications: - * Vailin Choi; August 2012 - * Use H5O_obj_class to get object type instead of - * H5O_get_info(...TRUE....) saving time in traversing metadata. *------------------------------------------------------------------------- */ static herr_t @@ -1572,7 +1611,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HDassert(udata->dst_root_loc); /* Get pointer to object class for this object */ - if((obj_class = H5O_obj_class(obj_oloc, udata->dxpl_id)) == NULL) + if((obj_class = H5O__obj_class(obj_oloc)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") /* Check if the object is a datatype, a dataset using a committed @@ -1583,7 +1622,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the destination datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1608,7 +1647,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the destination datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Check if the datatype is committed and search the skip list if so @@ -1636,8 +1675,7 @@ H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb; udata->obj_oloc.file = obj_oloc->file; udata->obj_oloc.addr = obj_oloc->addr; - if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, udata->dxpl_id, H5_INDEX_NAME, - H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) + if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "error iterating over attributes"); done: @@ -1659,7 +1697,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt_cb + * Function: H5O__copy_search_comm_dt_cb * * Purpose: H5G_visit callback to add committed datatypes to the merge * committed dt skiplist. Mostly a wrapper for @@ -1673,7 +1711,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, +H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; /* Skip list of dtypes in dest file */ @@ -1683,7 +1721,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, hbool_t obj_found = FALSE; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(name); @@ -1700,7 +1738,7 @@ H5O_copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, H5G_loc_reset(&obj_loc); /* Find the object */ - if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -1715,11 +1753,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt_cb */ +} /* end H5O__copy_search_comm_dt_cb */ /*------------------------------------------------------------------------- - * Function: H5O_copy_search_comm_dt + * Function: H5O__copy_search_comm_dt * * Purpose: Checks if the committed datatype present in oh_src matches any * in the destination file, building the destination file @@ -1736,8 +1774,8 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, - H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, H5O_copy_t *cpy_info) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *dst_addr; /* Destination datatype address */ @@ -1745,7 +1783,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_copy_search_comm_dt_ud_t udata; /* Group iteration user data */ herr_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(oh_src); @@ -1759,7 +1797,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Read the source datatype */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1768,7 +1806,7 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, /* Check if the destination dtype list exists, create it if it does not */ if(!cpy_info->dst_dt_list) { /* Create the skip list */ - if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O_copy_comm_dt_cmp))) + if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O__copy_comm_dt_cmp))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for committed datatypes") /* Add suggested types to list, if they are present */ @@ -1794,12 +1832,11 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, udata.dst_root_loc = &dst_root_loc; udata.obj_oloc.file = NULL; udata.obj_oloc.addr = HADDR_UNDEF; - udata.dxpl_id = dxpl_id; /* Walk through the list of datatype suggestions */ while(suggestion) { /* Find the object */ - if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/) < 0) /* Ignore errors - i.e. suggestions not present in * destination file */ H5E_clear_stack(NULL); @@ -1859,11 +1896,10 @@ H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, udata.dst_root_loc = &dst_root_loc; udata.obj_oloc.file = NULL; udata.obj_oloc.addr = HADDR_UNDEF; - udata.dxpl_id = dxpl_id; /* Traverse the destination file, adding committed datatypes to the skip * list */ - if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O_copy_search_comm_dt_cb, &udata, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O__copy_search_comm_dt_cb, &udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") cpy_info->dst_dt_list_complete = TRUE; } /* end if */ @@ -1890,11 +1926,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_search_comm_dt */ +} /* end H5O__copy_search_comm_dt */ /*------------------------------------------------------------------------- - * Function: H5O_copy_insert_comm_dt + * Function: H5O__copy_insert_comm_dt * * Purpose: Insert the committed datatype at oloc_dst into the merge committed * dt skiplist. The datatype must not be present already. @@ -1907,14 +1943,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, - hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, + H5O_copy_t *cpy_info) { H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ haddr_t *addr = NULL; /* Destination object address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(oh_src); @@ -1930,7 +1966,7 @@ H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, /* Read the datatype. Read from the source file because the destination * object could be changed in the post-copy. */ - if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, oh_src, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") /* Get destination object fileno */ @@ -1957,5 +1993,5 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_copy_insert_comm_dt */ +} /* end H5O__copy_insert_comm_dt */ diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 483c5fd..1fc95dd 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -239,12 +239,10 @@ H5O_assert(const H5O_t *oh) * koziol@ncsa.uiuc.edu * Feb 13 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t -H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth) +H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = FAIL; /* Return value */ @@ -263,7 +261,7 @@ H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE * HDassert(fwidth >= 0); /* Call the debug method in the class */ - if((ret_value = (type->debug)(f, dxpl_id, mesg, stream, indent, fwidth)) < 0) + if((ret_value = (type->debug)(f, mesg, stream, indent, fwidth)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "unable to debug message") done: @@ -289,7 +287,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth) +H5O_debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth) { size_t mesg_total = 0, chunk_total = 0, gap_total = 0; unsigned *sequence = NULL; @@ -519,13 +517,13 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i /* decode the message */ debug_type = oh->mesg[i].type; if(NULL == oh->mesg[i].native && debug_type->decode) - H5O_LOAD_NATIVE(f, dxpl_id, H5O_DECODEIO_NOCHANGE, oh, &oh->mesg[i], FAIL) + H5O_LOAD_NATIVE(f, H5O_DECODEIO_NOCHANGE, oh, &oh->mesg[i], FAIL) /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Message Information:"); if(debug_type->debug && oh->mesg[i].native != NULL) - (debug_type->debug)(f, dxpl_id, oh->mesg[i].native, stream, indent + 6, MAX(0, fwidth - 6)); + (debug_type->debug)(f, oh->mesg[i].native, stream, indent + 6, MAX(0, fwidth - 6)); else HDfprintf(stream, "%*s\n", indent + 6, ""); } /* end for */ @@ -556,7 +554,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +H5O_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) { H5O_t *oh = NULL; /* Object header to display */ H5O_loc_t loc; /* Object location for object to delete */ @@ -576,14 +574,14 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f loc.addr = addr; loc.holding_file = FALSE; - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* debug */ - H5O_debug_real(f, dxpl_id, oh, addr, stream, indent, fwidth); + H5O_debug_real(f, oh, addr, stream, indent, fwidth); done: - if(oh && H5O_unprotect(&loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index b9dea26..adb4837 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -27,14 +27,14 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_drvinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_drvinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_drvinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_drvinfo_copy(const void *_mesg, void *_dest); static size_t H5O_drvinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_drvinfo_reset(void *_mesg); -static herr_t H5O_drvinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__drvinfo_reset(void *_mesg); +static herr_t H5O__drvinfo_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ @@ -46,7 +46,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ H5O_drvinfo_encode, /*encode message */ H5O_drvinfo_copy, /*copy the native value */ H5O_drvinfo_size, /*raw message size */ - H5O_drvinfo_reset, /*free internal memory */ + H5O__drvinfo_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ @@ -57,7 +57,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_drvinfo_debug /*debug the message */ + H5O__drvinfo_debug /*debug the message */ }}; /* Current version of driver info information */ @@ -79,7 +79,7 @@ const H5O_msg_class_t H5O_MSG_DRVINFO[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_drvinfo_t *mesg; /* Native message */ @@ -245,7 +245,7 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_reset + * Function: H5O__drvinfo_reset * * Purpose: Frees internal pointers and resets the message to an * initial state. @@ -259,11 +259,11 @@ H5O_drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_reset(void *_mesg) +H5O__drvinfo_reset(void *_mesg) { H5O_drvinfo_t *mesg = (H5O_drvinfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -272,11 +272,11 @@ H5O_drvinfo_reset(void *_mesg) mesg->buf = (uint8_t *)H5MM_xfree(mesg->buf); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_reset() */ +} /* end H5O__drvinfo_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_drvinfo_debug + * Function: H5O__drvinfo_debug * * Purpose: Prints debugging info for the message. * @@ -288,12 +288,12 @@ H5O_drvinfo_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -308,6 +308,6 @@ H5O_drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const v "Buffer size:", mesg->len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_drvinfo_debug() */ +} /* end H5O__drvinfo_debug() */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index a1c24b6..013a70b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -29,25 +29,24 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_dtype_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_dtype_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static void *H5O_dtype_copy(const void *_mesg, void *_dest); static size_t H5O_dtype_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_dtype_reset(void *_mesg); +static herr_t H5O__dtype_reset(void *_mesg); static herr_t H5O__dtype_free(void *_mesg); static herr_t H5O_dtype_set_share(void *_mesg, const H5O_shared_t *sh); static htri_t H5O_dtype_can_share(const void *_mesg); static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static void *H5O_dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, +static void *H5O__dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, H5O_copy_t *cpy_info); - -static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__dtype_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_DTYPE @@ -57,17 +56,17 @@ static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_ENCODE_REAL H5O_dtype_encode #define H5O_SHARED_SIZE H5O_dtype_shared_size #define H5O_SHARED_SIZE_REAL H5O_dtype_size -#define H5O_SHARED_DELETE H5O_dtype_shared_delete +#define H5O_SHARED_DELETE H5O__dtype_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_dtype_shared_link +#define H5O_SHARED_LINK H5O__dtype_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_dtype_shared_copy_file -#define H5O_SHARED_COPY_FILE_REAL H5O_dtype_copy_file +#define H5O_SHARED_COPY_FILE H5O__dtype_shared_copy_file +#define H5O_SHARED_COPY_FILE_REAL H5O__dtype_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL -#define H5O_SHARED_POST_COPY_FILE_UPD H5O_dtype_shared_post_copy_upd +#define H5O_SHARED_POST_COPY_FILE_UPD H5O__dtype_shared_post_copy_upd #define H5O_SHARED_DEBUG H5O_dtype_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_dtype_debug +#define H5O_SHARED_DEBUG_REAL H5O__dtype_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Macros to check for the proper version of a datatype */ @@ -99,14 +98,14 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ H5O_dtype_shared_encode, /* encode message */ H5O_dtype_copy, /* copy the native value */ H5O_dtype_shared_size, /* size of raw message */ - H5O_dtype_reset, /* reset method */ + H5O__dtype_reset, /* reset method */ H5O__dtype_free, /* free method */ - H5O_dtype_shared_delete, /* file delete method */ - H5O_dtype_shared_link, /* link method */ + H5O__dtype_shared_delete, /* file delete method */ + H5O__dtype_shared_link, /* link method */ H5O_dtype_set_share, /* set share method */ H5O_dtype_can_share, /* can share method */ H5O_dtype_pre_copy_file, /* pre copy native value to file */ - H5O_dtype_shared_copy_file, /* copy native value to file */ + H5O__dtype_shared_copy_file, /* copy native value to file */ H5O_dtype_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -360,7 +359,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p } /* end if */ /* Close the base type for the array */ - H5T_close(temp_type); + (void)H5T_close_real(temp_type); /* Make the array type the type that is set for the field */ temp_type = array_dt; @@ -1080,9 +1079,8 @@ done: Decode a message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_dtype_decode(f, dxpl_id, mesg_flags, p) + void *H5O_dtype_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS @@ -1093,8 +1091,8 @@ done: function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_dtype_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, - unsigned *ioflags/*in,out*/, const uint8_t *p) +H5O_dtype_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, + unsigned H5_ATTR_UNUSED mesg_flags, unsigned *ioflags/*in,out*/, const uint8_t *p) { H5T_t *dt = NULL; void *ret_value = NULL; /* Return value */ @@ -1344,7 +1342,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_dtype_reset + * Function: H5O__dtype_reset * * Purpose: Frees resources within a message, but doesn't free * the message itself. @@ -1354,22 +1352,20 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) * Programmer: Robb Matzke * Tuesday, December 9, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_reset(void *_mesg) +H5O__dtype_reset(void *_mesg) { H5T_t *dt = (H5T_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(dt) H5T__free(dt); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_dtype_reset() */ +} /* end H5O__dtype_reset() */ /*------------------------------------------------------------------------- @@ -1395,7 +1391,7 @@ H5O__dtype_free(void *mesg) HDassert(mesg); /* Release the datatype */ - if(H5T_close((H5T_t *)mesg) < 0) + if(H5T_close_real((H5T_t *)mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free datatype") done: @@ -1552,7 +1548,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_dtype_copy_file + * Function: H5O__dtype_copy_file * * Purpose: Copy a native datatype message from one file to another. * @@ -1565,14 +1561,14 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, +H5O__dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5T_t *dst_mesg; /* Destination datatype */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Perform a normal copy of the object header message */ if(NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL))) @@ -1587,12 +1583,13 @@ H5O_dtype_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const H5O_msg_class_t *mesg_ done: if(NULL == ret_value) H5O_msg_free(mesg_type->id, dst_mesg); + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_copy_file() */ +} /* end H5O__dtype_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_shared_post_copy_upd + * Function: H5O__dtype_shared_post_copy_upd * * Purpose: Update a message after the shared message operations * during the post-copy loop @@ -1605,14 +1602,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, +H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, const void H5_ATTR_UNUSED *mesg_src, H5O_loc_t H5_ATTR_UNUSED *dst_oloc, void *mesg_dst, - hid_t H5_ATTR_UNUSED dxpl_id, H5O_copy_t H5_ATTR_UNUSED *cpy_info) + H5O_copy_t H5_ATTR_UNUSED *cpy_info) { H5T_t *dt_dst = (H5T_t *)mesg_dst; /* Destination datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if(dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { HDassert(H5T_committed(dt_dst)); @@ -1626,16 +1623,16 @@ H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_shared_post_copy_upd */ +} /* end H5O__dtype_shared_post_copy_upd */ /*-------------------------------------------------------------------------- NAME - H5O_dtype_debug + H5O__dtype_debug PURPOSE Prints debugging information for a message USAGE - void *H5O_dtype_debug(f, mesg, stream, indent, fwidth) + void *H5O__dtype_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source simple datatype struct @@ -1649,8 +1646,8 @@ done: parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, - int indent, int fwidth) +H5O__dtype_debug(H5F_t *f, const void *mesg, FILE *stream, int indent, + int fwidth) { const H5T_t *dt = (const H5T_t*)mesg; const char *s; @@ -1658,7 +1655,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, unsigned i; size_t k; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -1742,13 +1739,13 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth-3), "Byte offset:", (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - H5O_dtype_debug(f, dxpl_id, dt->shared->u.compnd.memb[i].type, stream, + H5O__dtype_debug(f, dt->shared->u.compnd.memb[i].type, stream, indent + 3, MAX(0, fwidth - 3)); } /* end for */ } /* end if */ else if(H5T_ENUM == dt->shared->type) { HDfprintf(stream, "%*s%s\n", indent, "", "Base type:"); - H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3)); + H5O__dtype_debug(f, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3)); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of members:", dt->shared->u.enumer.nmembs); @@ -1978,7 +1975,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, HDfprintf(stream, "%s%u", (i ? ", " : ""), (unsigned)dt->shared->u.array.dim[i]); HDfprintf(stream, "}\n"); HDfprintf(stream, "%*s%s\n", indent, "", "Base type:"); - H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3)); + H5O__dtype_debug(f, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3)); } /* end else if */ else { switch (dt->shared->u.atomic.order) { @@ -2162,5 +2159,5 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_dtype_debug() */ +} /* end H5O__dtype_debug() */ diff --git a/src/H5Oefl.c b/src/H5Oefl.c index ba7a6ee..5220762 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -27,17 +27,17 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_efl_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_efl_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_efl_reset(void *_mesg); -static void *H5O_efl_copy_file(H5F_t *file_src, void *mesg_src, +static herr_t H5O__efl_reset(void *_mesg); +static void *H5O__efl_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_efl_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__efl_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ @@ -49,18 +49,18 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ H5O_efl_encode, /*encode message */ H5O_efl_copy, /*copy native value */ H5O_efl_size, /*size of message on disk */ - H5O_efl_reset, /*reset method */ - NULL, /* free method */ + H5O__efl_reset, /*reset method */ + NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_efl_copy_file, /* copy native value to file */ + H5O__efl_copy_file, /* copy native value to file */ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_efl_debug /*debug the message */ + H5O__efl_debug /*debug the message */ }}; #define H5O_EFL_VERSION 1 @@ -87,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_EFL[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_efl_t *mesg = NULL; @@ -126,7 +126,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, #ifndef NDEBUG HDassert(H5F_addr_defined(mesg->heap_addr)); - if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") s = (const char *)H5HL_offset_into(heap, 0); @@ -143,7 +143,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, if(NULL == mesg->slot) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (heap = H5HL_protect(f, mesg->heap_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") for(u = 0; u < mesg->nused; u++) { /* Name */ @@ -347,7 +347,7 @@ H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void * /*------------------------------------------------------------------------- - * Function: H5O_efl_reset + * Function: H5O__efl_reset * * Purpose: Frees internal pointers and resets the message to an * initialial state. @@ -360,12 +360,12 @@ H5O_efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void * *------------------------------------------------------------------------- */ static herr_t -H5O_efl_reset(void *_mesg) +H5O__efl_reset(void *_mesg) { H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -382,7 +382,7 @@ H5O_efl_reset(void *_mesg) mesg->nused = mesg->nalloc = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_reset() */ +} /* end H5O__efl_reset() */ /*------------------------------------------------------------------------- @@ -425,7 +425,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_efl_copy_file + * Function: H5O__efl_copy_file * * Purpose: Copies an efl message from _MESG to _DEST in file * @@ -439,9 +439,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, +H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata, hid_t dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *_udata) { H5O_efl_t *efl_src = (H5O_efl_t *) mesg_src; H5O_efl_t *efl_dst = NULL; @@ -449,7 +449,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds size_t idx, size, name_offset, heap_size; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) /* check args */ HDassert(efl_src); @@ -468,15 +468,15 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds heap_size += H5HL_ALIGN(HDstrlen(efl_src->slot[idx].name) + 1); /* Create name heap */ - if(H5HL_create(file_dst, dxpl_id, heap_size, &efl_dst->heap_addr/*out*/) < 0) + if(H5HL_create(file_dst, heap_size, &efl_dst->heap_addr/*out*/) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTINIT, NULL, "can't create heap") /* Pin the heap down in memory */ - if(NULL == (heap = H5HL_protect(file_dst, dxpl_id, efl_dst->heap_addr, H5AC__NO_FLAGS_SET))) + if(NULL == (heap = H5HL_protect(file_dst, efl_dst->heap_addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_EFL, H5E_PROTECT, NULL, "unable to protect EFL file name heap") /* Insert "empty" name first */ - if(UFAIL == (name_offset = H5HL_insert(file_dst, dxpl_id, heap, (size_t)1, ""))) + if(UFAIL == (name_offset = H5HL_insert(file_dst, heap, (size_t)1, ""))) HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap") HDassert(0 == name_offset); @@ -493,7 +493,7 @@ H5O_efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_ds /* copy the name from the source */ for(idx = 0; idx < efl_src->nused; idx++) { efl_dst->slot[idx].name = H5MM_xstrdup(efl_src->slot[idx].name); - if(UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, dxpl_id, heap, + if(UFAIL == (efl_dst->slot[idx].name_offset = H5HL_insert(file_dst, heap, HDstrlen(efl_dst->slot[idx].name) + 1, efl_dst->slot[idx].name))) HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap") } /* end for */ @@ -509,12 +509,12 @@ done: if(efl_dst) H5MM_xfree(efl_dst); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_efl_copy_file() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__efl_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_efl_debug + * Function: H5O__efl_debug * * Purpose: Prints debugging info for a message. * @@ -526,13 +526,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_efl_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t u; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -572,5 +572,5 @@ H5O_efl_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_efl_debug() */ +} /* end H5O__efl_debug() */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 5419762..445a655 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -32,19 +32,19 @@ #include "H5Sprivate.h" /* Dataspaces */ -static void *H5O_fill_old_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_old_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_old_size(const H5F_t *f, const void *_mesg); -static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fill_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg); static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg); static void *H5O_fill_copy(const void *_mesg, void *_dest); -static herr_t H5O_fill_reset(void *_mesg); -static herr_t H5O_fill_free(void *_mesg); -static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__fill_reset(void *_mesg); +static herr_t H5O__fill_free(void *_mesg); +static herr_t H5O__fill_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_FILL @@ -54,17 +54,17 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #define H5O_SHARED_ENCODE_REAL H5O_fill_old_encode #define H5O_SHARED_SIZE H5O_fill_shared_size #define H5O_SHARED_SIZE_REAL H5O_fill_old_size -#define H5O_SHARED_DELETE H5O_fill_shared_delete +#define H5O_SHARED_DELETE H5O__fill_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_fill_shared_link +#define H5O_SHARED_LINK H5O__fill_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_fill_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_fill_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* Set up & include shared message "interface" info */ @@ -84,13 +84,13 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_SIZE_REAL #define H5O_SHARED_SIZE_REAL H5O_fill_new_size #undef H5O_SHARED_DELETE -#define H5O_SHARED_DELETE H5O_fill_new_shared_delete +#define H5O_SHARED_DELETE H5O__fill_new_shared_delete #undef H5O_SHARED_DELETE_REAL #undef H5O_SHARED_LINK -#define H5O_SHARED_LINK H5O_fill_new_shared_link +#define H5O_SHARED_LINK H5O__fill_new_shared_link #undef H5O_SHARED_LINK_REAL #undef H5O_SHARED_COPY_FILE -#define H5O_SHARED_COPY_FILE H5O_fill_new_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__fill_new_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE #define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file @@ -99,7 +99,7 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_DEBUG #define H5O_SHARED_DEBUG H5O_fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL -#define H5O_SHARED_DEBUG_REAL H5O_fill_debug +#define H5O_SHARED_DEBUG_REAL H5O__fill_debug #undef H5Oshared_H #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -113,14 +113,14 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ H5O_fill_shared_encode, /*encode message */ H5O_fill_copy, /*copy the native value */ H5O_fill_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_shared_delete, /* file delete method */ - H5O_fill_shared_link, /* link method */ + H5O__fill_reset, /*free internal memory */ + H5O__fill_free, /* free method */ + H5O__fill_shared_delete, /* file delete method */ + H5O__fill_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_fill_shared_copy_file, /* copy native value to file */ + H5O__fill_shared_copy_file, /* copy native value to file */ H5O_fill_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -137,14 +137,14 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ H5O_fill_new_shared_encode, /*encode message */ H5O_fill_copy, /*copy the native value */ H5O_fill_new_shared_size, /*raw message size */ - H5O_fill_reset, /*free internal memory */ - H5O_fill_free, /* free method */ - H5O_fill_new_shared_delete, /* file delete method */ - H5O_fill_new_shared_link, /* link method */ + H5O__fill_reset, /*free internal memory */ + H5O__fill_free, /* free method */ + H5O__fill_new_shared_delete,/* file delete method */ + H5O__fill_new_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_fill_new_shared_copy_file, /* copy native value to file */ + H5O__fill_new_shared_copy_file, /* copy native value to file */ H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -183,7 +183,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ static void * -H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; @@ -297,7 +297,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fill_old_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fill_t *fill = NULL; /* Decoded fill value message */ @@ -525,7 +525,7 @@ H5O_fill_copy(const void *_src, void *_dst) H5T_path_t *tpath; /* Conversion information */ /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(src->type, dst->type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src->type, dst->type))) HGOTO_ERROR(H5E_OHDR, H5E_UNSUPPORTED, NULL, "unable to convert between src and dst data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -553,7 +553,7 @@ H5O_fill_copy(const void *_src, void *_dst) } /* end if */ /* Convert fill value */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf, H5AC_noio_dxpl_id) < 0) { + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf) < 0) { H5I_dec_ref(src_id); H5I_dec_ref(dst_id); if(bkg_buf) @@ -580,7 +580,7 @@ done: if(dst->buf) H5MM_xfree(dst->buf); if(dst->type) - H5T_close(dst->type); + (void)H5T_close_real(dst->type); if(!_dst) dst = H5FL_FREE(H5O_fill_t, dst); } /* end if */ @@ -698,7 +698,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) if(NULL == (fill_type = H5T_copy(fill->type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy fill value datatype") if((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, FALSE)) < 0) { - H5T_close(fill_type); + (void)H5T_close_real(fill_type); HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register fill value datatype") } /* end if */ @@ -707,7 +707,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create scalar dataspace") /* Reclaim any variable length components of the fill value */ - if(H5D_vlen_reclaim(fill_type_id, fill_space, H5AC_noio_dxpl_id, fill->buf) < 0) { + if(H5D_vlen_reclaim(fill_type_id, fill_space, fill->buf) < 0) { H5S_close(fill_space); HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "unable to reclaim variable-length fill value data") } /* end if */ @@ -721,7 +721,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) } /* end if */ fill->size = 0; if(fill->type) { - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; } /* end if */ @@ -734,7 +734,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_fill_reset + * Function: H5O__fill_reset * * Purpose: Resets a message to an initial state. * @@ -746,11 +746,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_fill_reset(void *_fill) +H5O__fill_reset(void *_fill) { H5O_fill_t *fill = (H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); @@ -763,11 +763,11 @@ H5O_fill_reset(void *_fill) fill->fill_defined = FALSE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_reset() */ +} /* end H5O__fill_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_free + * Function: H5O__fill_free * * Purpose: Frees the message * @@ -779,20 +779,20 @@ H5O_fill_reset(void *_fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_free(void *fill) +H5O__fill_free(void *fill) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(fill); fill = H5FL_FREE(H5O_fill_t, fill); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_free() */ +} /* end H5O__fill_free() */ /*------------------------------------------------------------------------- - * Function: H5O_fill_debug + * Function: H5O__fill_debug * * Purpose: Prints debugging info for the message. * @@ -804,13 +804,13 @@ H5O_fill_free(void *fill) *------------------------------------------------------------------------- */ static herr_t -H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_fill, FILE *stream, - int indent, int fwidth) +H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, + int indent, int fwidth) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(f); HDassert(fill); @@ -890,7 +890,7 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void fprintf(stream, "\n"); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fill_debug() */ +} /* end H5O__fill_debug() */ /*------------------------------------------------------------------------- @@ -909,7 +909,7 @@ H5O_fill_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *------------------------------------------------------------------------- */ herr_t -H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_t dxpl_id) +H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) { H5T_path_t *tpath; /* Type conversion info */ void *buf = NULL, *bkg = NULL; /* Conversion buffers */ @@ -926,7 +926,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ if(!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, FALSE)) { /* Don't need datatype for fill value */ if(fill->type) - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; /* Note that the fill value info has changed */ @@ -938,7 +938,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ /* * Can we convert between source and destination data types? */ - if(NULL == (tpath = H5T_path_find(fill->type, dset_type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill->type, dset_type))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") /* Don't bother doing anything if there will be no actual conversion */ @@ -965,16 +965,16 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") /* Do the conversion */ - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Update the fill message */ if(buf != fill->buf) { - H5T_vlen_reclaim_elmt(fill->buf, fill->type, dxpl_id); + H5T_vlen_reclaim_elmt(fill->buf, fill->type); H5MM_xfree(fill->buf); fill->buf = buf; } /* end if */ - H5T_close(fill->type); + (void)H5T_close_real(fill->type); fill->type = NULL; H5_CHECKED_ASSIGN(fill->size, ssize_t, H5T_get_size(dset_type), size_t); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index b1592dd..31ef9b9 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -33,17 +33,24 @@ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Errors */ #include "H5Fprivate.h" /* Files */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Objects */ + /********************/ /* Local Prototypes */ /********************/ -static herr_t H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag); +static herr_t H5O__flush(hid_t obj_id); +static herr_t H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag); +static herr_t H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, + H5G_loc_t *obj_loc); +static herr_t H5O__refresh(hid_t obj_id); + /*************/ /* Functions */ @@ -66,38 +73,31 @@ static herr_t H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag); herr_t H5Oflush(hid_t obj_id) { - H5O_loc_t *oloc; /* object location */ - void *obj_ptr; /* Pointer to object */ - const H5O_obj_class_t *obj_class = NULL; /* Class of object */ - herr_t ret_value = SUCCEED; /* return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", obj_id); - /* Check args */ - if(NULL == (oloc = H5O_get_loc(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") - - /* Get the object pointer */ - if(NULL == (obj_ptr = H5I_object(obj_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(obj_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") - /* Get the object class */ - if(NULL == (obj_class = H5O_obj_class(oloc, H5AC_ind_read_dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object class") - - /* Flush the object of this class */ - if(obj_class->flush && obj_class->flush(obj_ptr, H5AC_ind_read_dxpl_id) < 0) + /* Call internal routine */ + if(H5O__flush(obj_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") - /* Flush the object metadata and invoke flush callback */ - if(H5O_flush_common(oloc, obj_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object and object flush callback") - done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Oflush() */ + /*------------------------------------------------------------------------- * Function: H5O_flush_common * @@ -111,7 +111,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id) +H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id) { haddr_t tag = 0; herr_t ret_value = SUCCEED; /* Return value */ @@ -119,11 +119,11 @@ H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Retrieve tag for object */ - if(H5O_oh_tag(oloc, dxpl_id, &tag) < 0) + if(H5O__oh_tag(oloc, &tag) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object metadata") /* Flush metadata based on tag value of the object */ - if(H5F_flush_tagged_metadata(oloc->file, tag, dxpl_id) < 0) + if(H5F_flush_tagged_metadata(oloc->file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Check to invoke callback */ @@ -136,7 +136,58 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_oh_tag + * Function: H5O__flush + * + * Purpose: Internal routine to flush an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__flush(hid_t obj_id) +{ + H5O_loc_t *oloc; /* Object location */ + void *obj_ptr; /* Pointer to object */ + const H5O_obj_class_t *obj_class; /* Class of object */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(NULL == (oloc = H5O_get_loc(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Get the object pointer */ + if(NULL == (obj_ptr = H5I_object(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier") + + /* Get the object class */ + if(NULL == (obj_class = H5O__obj_class(oloc))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object class") + + /* Flush the object of this class */ + if(obj_class->flush && obj_class->flush(obj_ptr) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") + + /* Flush the object metadata and invoke flush callback */ + if(H5O_flush_common(oloc, obj_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__flush() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__oh_tag * * Purpose: Get object header's address--tag value for the object * @@ -149,18 +200,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag) +H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(oloc); /* Get object header for object */ - if(NULL == (oh = H5O_protect(oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object's object header") /* Get object header's address (i.e. the tag value for this object) */ @@ -169,11 +220,11 @@ H5O_oh_tag(const H5O_loc_t *oloc, hid_t dxpl_id, haddr_t *tag) done: /* Unprotect object header on failure */ - if(oh && H5O_unprotect(oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_oh_tag() */ +} /* end H5O__oh_tag() */ /*------------------------------------------------------------------------- @@ -191,21 +242,27 @@ done: herr_t H5Orefresh(hid_t oid) { - H5O_loc_t *oloc; /* object location */ - herr_t ret_value = SUCCEED; /* return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", oid); - /* Check args */ - if(NULL == (oloc = H5O_get_loc(oid))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(oid, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") - /* Private function */ - if(H5O_refresh_metadata(oid, *oloc, H5AC_ind_read_dxpl_id) < 0) + /* Call internal routine */ + if(H5O__refresh(oid) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Orefresh() */ @@ -231,7 +288,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) +H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc) { hbool_t objs_incr = FALSE; /* Whether the object count in the file was incremented */ herr_t ret_value = SUCCEED; /* Return value */ @@ -256,11 +313,11 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) objs_incr = TRUE; /* Close object & evict its metadata */ - if((H5O_refresh_metadata_close(oid, oloc, &obj_loc, dxpl_id)) < 0) + if((H5O__refresh_metadata_close(oid, oloc, &obj_loc)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") /* Re-open the object, re-fetching its metadata */ - if((H5O_refresh_metadata_reopen(oid, &obj_loc, dxpl_id, FALSE)) < 0) + if((H5O_refresh_metadata_reopen(oid, &obj_loc, FALSE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") } /* end if */ @@ -273,7 +330,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_refresh_metadata_close + * Function: H5O__refresh_metadata_close * * Purpose: This is the first part of the original routine H5O_refresh_metadata(). * (1) Save object location information. @@ -291,14 +348,14 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t dxpl_id) +static herr_t +H5O__refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc) { haddr_t tag = 0; /* Tag for object */ hbool_t corked = FALSE; /* Whether object's metadata is corked */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Make deep local copy of object's location information */ if(obj_loc) { @@ -310,11 +367,11 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t /* Get object's type */ if(H5I_get_type(oid) == H5I_DATASET) - if(H5D_mult_refresh_close(oid, dxpl_id) < 0) + if(H5D_mult_refresh_close(oid) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to prepare refresh for dataset") /* Retrieve tag for object */ - if(H5O_oh_tag(&oloc, dxpl_id, &tag) < 0) + if(H5O__oh_tag(&oloc, &tag) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to get object header address") /* Get cork status of the object with tag */ @@ -326,11 +383,11 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close object") /* Flush metadata based on tag value of the object */ - if(H5F_flush_tagged_metadata(oloc.file, tag, dxpl_id) < 0) + if(H5F_flush_tagged_metadata(oloc.file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") /* Evict the object's tagged metadata */ - if(H5F_evict_tagged_metadata(oloc.file, tag, dxpl_id) < 0) + if(H5F_evict_tagged_metadata(oloc.file, tag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict metadata") /* Re-cork object with tag */ @@ -340,7 +397,7 @@ H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t done: FUNC_LEAVE_NOAPI(ret_value); -} /* end H5O_refresh_metadata_close() */ +} /* end H5O__refresh_metadata_close() */ /*------------------------------------------------------------------------- @@ -358,7 +415,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t start_swmr) +H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hbool_t start_swmr) { void *object = NULL; /* Dataset for this operation */ H5I_type_t type; /* Type of object for the ID */ @@ -372,22 +429,22 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ switch(type) { case H5I_GROUP: /* Re-open the group */ - if(NULL == (object = H5G_open(obj_loc, dxpl_id))) + if(NULL == (object = H5G_open(obj_loc))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") break; case H5I_DATATYPE: /* Re-open the named datatype */ - if(NULL == (object = H5T_open(obj_loc, dxpl_id))) + if(NULL == (object = H5T_open(obj_loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") break; case H5I_DATASET: /* Re-open the dataset */ - if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) + if(NULL == (object = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") if(!start_swmr) /* No need to handle multiple opens when H5Fstart_swmr_write() */ - if(H5D_mult_refresh_reopen((H5D_t *)object, dxpl_id) < 0) + if(H5D_mult_refresh_reopen((H5D_t *)object) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to finish refresh for dataset") break; @@ -417,3 +474,40 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_refresh_metadata_reopen() */ + +/*------------------------------------------------------------------------- + * Function: H5O__refresh + * + * Purpose: Internal routine to refresh an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 29, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O__refresh(hid_t obj_id) +{ + H5O_loc_t *oloc; /* Object location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Check args */ + if(NULL == (oloc = H5O_get_loc(obj_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object") + + /* Private function */ + if(H5O_refresh_metadata(obj_id, *oloc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to refresh object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__refresh() */ + diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 4d62f49..2b135ed 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -32,13 +32,14 @@ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ -static void *H5O_fsinfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_fsinfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_fsinfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_fsinfo_copy(const void *_mesg, void *_dest); static size_t H5O_fsinfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_fsinfo_free(void *mesg); -static herr_t H5O_fsinfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__fsinfo_free(void *mesg); +static herr_t H5O__fsinfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ @@ -51,7 +52,7 @@ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ H5O_fsinfo_copy, /* copy the native value */ H5O_fsinfo_size, /* size of free-space manager info message */ NULL, /* default reset method */ - H5O_fsinfo_free, /* free method */ + H5O__fsinfo_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /* set share method */ @@ -61,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_FSINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_fsinfo_debug /* debug the message */ + H5O__fsinfo_debug /* debug the message */ }}; /* Current version of free-space manager info information */ @@ -85,7 +86,7 @@ H5FL_DEFINE_STATIC(H5O_fsinfo_t); *------------------------------------------------------------------------- */ static void * -H5O_fsinfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_fsinfo_t *fsinfo = NULL; /* File space info message */ @@ -307,9 +308,9 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_free + * Function: H5O__fsinfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -318,20 +319,20 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_free(void *mesg) +H5O__fsinfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_fsinfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_free() */ +} /* end H5O__fsinfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_fsinfo_debug + * Function: H5O__fsinfo_debug * * Purpose: Prints debugging info for a message. * @@ -342,13 +343,13 @@ H5O_fsinfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; H5F_mem_page_t ptype; /* Free-space types for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -402,5 +403,5 @@ H5O_fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_fsinfo_debug() */ +} /* end H5O__fsinfo_debug() */ diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 468e07a..7c13f8f 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -32,14 +32,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_ginfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O_ginfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_ginfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_ginfo_copy(const void *_mesg, void *_dest); static size_t H5O_ginfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_ginfo_free(void *_mesg); -static herr_t H5O_ginfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__ginfo_free(void *_mesg); +static herr_t H5O__ginfo_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ @@ -52,7 +52,7 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ H5O_ginfo_copy, /*copy the native value */ H5O_ginfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_ginfo_free, /* free method */ + H5O__ginfo_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -62,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_GINFO[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_ginfo_debug /*debug the message */ + H5O__ginfo_debug /*debug the message */ }}; /* Current version of group info information */ @@ -94,7 +94,7 @@ H5FL_DEFINE_STATIC(H5O_ginfo_t); *------------------------------------------------------------------------- */ static void * -H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O_ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_ginfo_t *ginfo = NULL; /* Pointer to group information message */ @@ -285,9 +285,9 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha /*------------------------------------------------------------------------- - * Function: H5O_ginfo_free + * Function: H5O__ginfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -297,7 +297,7 @@ H5O_ginfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_free(void *mesg) +H5O__ginfo_free(void *mesg) { FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -306,11 +306,11 @@ H5O_ginfo_free(void *mesg) mesg = H5FL_FREE(H5O_ginfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_free() */ +} /* end H5O__ginfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_ginfo_debug + * Function: H5O__ginfo_debug * * Purpose: Prints debugging info for a message. * @@ -323,12 +323,12 @@ H5O_ginfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_ginfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__ginfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -347,5 +347,5 @@ H5O_ginfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Estimated length of object in group's name:", ginfo->est_name_len); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_ginfo_debug() */ +} /* end H5O__ginfo_debug() */ diff --git a/src/H5Oint.c b/src/H5Oint.c index 6ab5393..3ed19bf 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -58,8 +58,6 @@ typedef struct { hid_t obj_id; /* The ID for the starting group */ H5G_loc_t *start_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ H5SL_t *visited; /* Skip list for tracking visited nodes */ H5O_iterate_t op; /* Application callback */ void *op_data; /* Application's op data */ @@ -75,10 +73,14 @@ typedef struct { /* Local Prototypes */ /********************/ -static herr_t H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type); -static herr_t H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); -static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); +static herr_t H5O__delete_oh(H5F_t *f, H5O_t *oh); +static herr_t H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type); +static herr_t H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); +static herr_t H5O__free_visit_visited(void *item, void *key, + void *operator_data/*in,out*/); +static herr_t H5O__visit_cb(hid_t group, const char *name, const H5L_info_t *linfo, + void *_udata); +static const H5O_obj_class_t *H5O__obj_class_real(const H5O_t *oh); /*********************/ @@ -223,8 +225,8 @@ H5O__init_package(void) *------------------------------------------------------------------------- */ herr_t -H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, - hid_t ocpl_id, H5O_loc_t *loc/*out*/) +H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, + H5O_loc_t *loc/*out*/) { H5P_genplist_t *oc_plist; /* Object creation property list */ H5O_t *oh = NULL; /* Object header created */ @@ -337,7 +339,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, oh_size = (size_t)H5O_SIZEOF_HDR(oh) + size_hint; /* Allocate disk space for header and first chunk */ - if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)oh_size))) + if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)oh_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") /* Create the chunk list */ @@ -381,18 +383,18 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, insert_flags |= H5AC__PIN_ENTRY_FLAG; } - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(dxpl_id, oh_addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(oh_addr); /* Cache object header */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) + if(H5AC_insert_entry(f, H5AC_OHDR, oh_addr, oh, insert_flags) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") /* Reset object header pointer, now that it's been inserted into the cache */ oh = NULL; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Set up object location */ loc->file = f; @@ -470,15 +472,15 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O_open_name(const H5G_loc_t *loc, const char *name, hbool_t app_ref) { H5G_loc_t obj_loc; /* Location used to open group */ H5G_name_t obj_path; /* Opened object group hier. path */ H5O_loc_t obj_oloc; /* Opened object object location */ hbool_t loc_found = FALSE; /* Entry at 'name' found */ - hid_t ret_value = FAIL; + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Check args */ HDassert(loc); @@ -490,25 +492,162 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hb H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(loc, name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + if(H5G_loc_find(loc, name, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5I_INVALID_HID, "object not found") loc_found = TRUE; /* Open the object */ - if((ret_value = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ret_value = H5O__open_by_loc(&obj_loc, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") done: if(ret_value < 0 && loc_found) if(H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5I_INVALID_HID, "can't free location") FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_open_name() */ /*------------------------------------------------------------------------- - * Function: H5O_open_by_loc + * Function: H5O__open_name + * + * Purpose: Internal routine to open an object by name + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_name(const H5G_loc_t *loc, const char *name) +{ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name); + + /* Open the object */ + if((ret_value = H5O_open_name(loc, name, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_idx + * + * Purpose: Internal routine to open an object by index within group + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, name, idx_type, order, n, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5I_INVALID_HID, "group not found") + loc_found = TRUE; + + /* Open the object */ + if((ret_value = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + /* Release the object location if we failed after copying it */ + if(ret_value < 0 && loc_found) + if(H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5I_INVALID_HID, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_addr + * + * Purpose: Internal routine to open an object by its address + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +hid_t +H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + obj_loc.oloc->addr = addr; + obj_loc.oloc->file = loc->oloc->file; + H5G_name_reset(obj_loc.path); /* objects opened through this routine don't have a path name */ + + /* Open the object */ + if((ret_value = H5O__open_by_loc(&obj_loc, TRUE)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__open_by_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__open_by_loc * * Purpose: Opens an object and returns an ID given its group loction. * @@ -521,27 +660,65 @@ done: *------------------------------------------------------------------------- */ hid_t -H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__open_by_loc(const H5G_loc_t *obj_loc, hbool_t app_ref) { const H5O_obj_class_t *obj_class; /* Class of object for location */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(obj_loc); /* Get the object class for this location */ - if(NULL == (obj_class = H5O_obj_class(obj_loc->oloc, dxpl_id))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") + if(NULL == (obj_class = H5O__obj_class(obj_loc->oloc))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5I_INVALID_HID, "unable to determine object class") /* Call the object class's 'open' routine */ HDassert(obj_class->open); - if((ret_value = obj_class->open(obj_loc, lapl_id, dxpl_id, app_ref)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") + if((ret_value = obj_class->open(obj_loc, app_ref)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open object") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_open_by_loc() */ +} /* end H5O__open_by_loc() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__create_link + * + * Purpose: Internal routine to create a link from a group to an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__create_link(const H5G_loc_t *new_loc, const char *new_name, + H5G_loc_t *obj_loc, hid_t lcpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(new_loc); + HDassert(new_name && *new_name); + HDassert(obj_loc); + + /* Link to the object */ + if(H5L_link(new_loc, new_name, obj_loc, lcpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__create_link() */ /*------------------------------------------------------------------------- @@ -609,7 +786,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_link_oh + * Function: H5O__link_oh * * Purpose: Adjust the link count for an open object header by adding * ADJUST to the link count. @@ -625,12 +802,12 @@ done: *------------------------------------------------------------------------- */ int -H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) +H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted) { haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -690,7 +867,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) if(oh->has_refcount_msg) { /* Check for removing refcount message */ if(oh->nlink <= 1) { - if(H5O_msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE, dxpl_id) < 0) + if(H5O__msg_remove_real(f, oh, H5O_MSG_REFCOUNT, H5O_ALL, NULL, NULL, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete refcount message") oh->has_refcount_msg = FALSE; } /* end if */ @@ -698,7 +875,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) else { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_write_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O__msg_write_real(f, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update refcount message") } /* end else */ } /* end if */ @@ -707,7 +884,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) if(oh->nlink > 1) { H5O_refcount_t refcount = oh->nlink; - if(H5O_msg_append_real(f, dxpl_id, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) + if(H5O__msg_append_real(f, oh, H5O_MSG_REFCOUNT, H5O_MSG_FLAG_DONTSHARE, 0, &refcount) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to create new refcount message") oh->has_refcount_msg = TRUE; } /* end if */ @@ -720,7 +897,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_oh() */ +} /* end H5O__link_oh() */ /*------------------------------------------------------------------------- @@ -740,13 +917,13 @@ done: *------------------------------------------------------------------------- */ int -H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) +H5O_link(const H5O_loc_t *loc, int adjust) { H5O_t *oh = NULL; hbool_t deleted = FALSE; /* Whether the object was deleted */ int ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* check args */ HDassert(loc); @@ -754,24 +931,59 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) HDassert(H5F_addr_defined(loc->addr)); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" link routine */ - if((ret_value = H5O_link_oh(loc->file, adjust, dxpl_id, oh, &deleted)) < 0) + if((ret_value = H5O__link_oh(loc->file, adjust, oh, &deleted)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust object link count") done: if(oh && H5O_unpin(oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") - if(ret_value >= 0 && deleted && H5O_delete(loc->file, dxpl_id, loc->addr) < 0) + if(ret_value >= 0 && deleted && H5O_delete(loc->file, loc->addr) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_link() */ /*------------------------------------------------------------------------- + * Function: H5O__link + * + * Purpose: Internal routine to change the refcount for an object + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__link(const H5O_loc_t *oloc, int adjust) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(oloc); + + /* Change the object's refcount */ + if(H5O_link(oloc, adjust) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "modifying object link count failed") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__link() */ + + +/*------------------------------------------------------------------------- * Function: H5O_protect * * Purpose: Wrapper around H5AC_protect for use during a H5O_protect-> @@ -789,8 +1001,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, - hbool_t pin_all_chunks) +H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks) { H5O_t *oh = NULL; /* Object header protected */ H5O_cache_ud_t udata; /* User data for protecting object header */ @@ -798,7 +1009,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, unsigned file_intent; /* R/W intent on file */ H5O_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(loc->addr, NULL) /* check args */ HDassert(loc); @@ -822,7 +1033,6 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.chunk0_size = 0; udata.oh = NULL; udata.common.f = loc->file; - udata.common.dxpl_id = dxpl_id; udata.common.file_intent = file_intent; udata.common.merged_null_msgs = 0; HDmemset(&cont_msg_info, 0, sizeof(cont_msg_info)); @@ -830,7 +1040,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, udata.common.addr = loc->addr; /* Lock the object header into the cache */ - if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, &udata, prot_flags))) + if(NULL == (oh = (H5O_t *)H5AC_protect(loc->file, H5AC_OHDR, loc->addr, &udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Check if there are any continuation messages to process */ @@ -849,7 +1059,6 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, chk_udata.oh = oh; chk_udata.chunkno = UINT_MAX; /* Set to invalid value, for better error detection */ chk_udata.common.f = loc->file; - chk_udata.common.dxpl_id = dxpl_id; chk_udata.common.file_intent = file_intent; chk_udata.common.merged_null_msgs = udata.common.merged_null_msgs; chk_udata.common.cont_msg_info = &cont_msg_info; @@ -869,7 +1078,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, /* (which adds to the object header) */ chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; chk_udata.size = cont_msg_info.msgs[curr_msg].size; - if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) + if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot_flags))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ @@ -878,7 +1087,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags, HDassert(oh->nchunks == (chkcnt + 1)); /* Release the chunk from the cache */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_unprotect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header chunk") /* Advance to next continuation message */ @@ -928,7 +1137,7 @@ H5O_assert(oh); H5O_chunk_proxy_t *chk_proxy; /* Chunk proxy */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(loc->file, dxpl_id, oh, u))) + if(NULL == (chk_proxy = H5O__chunk_protect(loc->file, oh, u))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header chunk") /* Pin chunk proxy*/ @@ -936,7 +1145,7 @@ H5O_assert(oh); HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header chunk") /* Unprotect chunk */ - if(H5O_chunk_unprotect(loc->file, dxpl_id, chk_proxy, FALSE) < 0) + if(H5O__chunk_unprotect(loc->file, chk_proxy, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to unprotect object header chunk") /* Preserve chunk proxy pointer for later */ @@ -952,10 +1161,10 @@ H5O_assert(oh); done: if(ret_value == NULL && oh) - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_protect() */ @@ -977,7 +1186,7 @@ done: *------------------------------------------------------------------------- */ H5O_t * -H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_pin(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ H5O_t *ret_value = NULL; /* Return value */ @@ -988,12 +1197,12 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Increment the reference count on the object header */ /* (which will pin it, if appropriate) */ - if(H5O_inc_rc(oh) < 0) + if(H5O__inc_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, NULL, "unable to increment reference count on object header") /* Set the return value */ @@ -1001,7 +1210,7 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1035,7 +1244,7 @@ H5O_unpin(H5O_t *oh) /* Decrement the reference count on the object header */ /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) + if(H5O__dec_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") done: @@ -1060,7 +1269,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) +H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1092,7 +1301,7 @@ H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) } /* end if */ /* Unprotect the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) + if(H5AC_unprotect(loc->file, H5AC_OHDR, oh->chunk[0].addr, oh, oh_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") done: @@ -1115,7 +1324,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) +H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ @@ -1150,7 +1359,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) HGOTO_DONE(SUCCEED); /*nothing to do*/ /* Allocate space for the modification time message */ - if(H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) + if(H5O__msg_alloc(f, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") /* Set the message's flags if appropriate */ @@ -1158,7 +1367,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) } /* end if */ /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, oh->mesg[idx].chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, oh->mesg[idx].chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Allocate 'native' space, if necessary */ @@ -1187,7 +1396,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) done: /* Release chunk */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -1210,7 +1419,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) +H5O_touch(const H5O_loc_t *loc, hbool_t force) { H5O_t *oh = NULL; /* Object header to modify */ unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ @@ -1222,18 +1431,18 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Create/Update the modification time message */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, force) < 0) + if(H5O_touch_oh(loc->file, oh, force) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "unable to update object modificaton time") /* Mark object header as changed */ oh_flags |= H5AC__DIRTIED_FLAG; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, oh_flags) < 0) + if(oh && H5O_unprotect(loc, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1255,7 +1464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) +H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags) { size_t idx; /* Local index variable */ H5O_msg_class_t *type; /* Message class type */ @@ -1290,7 +1499,7 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned bogus_id, unsigned mes HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID for 'bogus' message") /* Allocate space in the object header for bogus message */ - if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, bogus, &idx) < 0) + if(H5O__msg_alloc(f, oh, type, &mesg_flags, bogus, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") /* Point to "bogus" information (take it over) */ @@ -1327,7 +1536,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) +H5O_delete(H5F_t *f, haddr_t addr) { H5O_t *oh = NULL; /* Object header information */ H5O_loc_t loc; /* Object location for object to delete */ @@ -1335,7 +1544,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) hbool_t corked; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, addr, FAIL) + FUNC_ENTER_NOAPI_TAG(addr, FAIL) /* Check args */ HDassert(f); @@ -1347,11 +1556,11 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) loc.holding_file = FALSE; /* Get the object header information */ - if(NULL == (oh = H5O_protect(&loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(&loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Delete object */ - if(H5O_delete_oh(f, dxpl_id, oh) < 0) + if(H5O__delete_oh(f, oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file") /* Uncork cache entries with tag: addr */ @@ -1365,15 +1574,15 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) oh_flags = H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; done: - if(oh && H5O_unprotect(&loc, dxpl_id, oh, oh_flags) < 0) + if(oh && H5O_unprotect(&loc, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_delete_oh + * Function: H5O__delete_oh * * Purpose: Internal function to: * Delete an object header from a file. This frees the file @@ -1390,13 +1599,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) +H5O__delete_oh(H5F_t *f, H5O_t *oh) { H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(f); @@ -1407,13 +1616,13 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { /* Free any space referred to in the file from this message */ - if(H5O_delete_mesg(f, dxpl_id, oh, curr_msg) < 0) + if(H5O__delete_mesg(f, oh, curr_msg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") } /* end for */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_delete_oh() */ +} /* end H5O__delete_oh() */ /*------------------------------------------------------------------------- @@ -1430,31 +1639,31 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) +H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type) { H5O_t *oh = NULL; /* Object header for location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the type of the object */ - if(H5O_obj_type_real(oh, obj_type) < 0) + if(H5O__obj_type_real(oh, obj_type) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_obj_type() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_type_real + * Function: H5O__obj_type_real * * Purpose: Returns the type of object pointed to by `oh'. * @@ -1467,35 +1676,35 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) +H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type) { const H5O_obj_class_t *obj_class; /* Class of object for header */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(oh); HDassert(obj_type); /* Look up class for object header */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) { + if(NULL == (obj_class = H5O__obj_class_real(oh))) { /* Clear error stack from "failed" class lookup */ H5E_clear_stack(NULL); /* Set type to "unknown" */ *obj_type = H5O_TYPE_UNKNOWN; - } + } /* end if */ else { /* Set object type */ *obj_type = obj_class->type; - } + } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_obj_type_real() */ +} /* end H5O__obj_type_real() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_class + * Function: H5O__obj_class * * Purpose: Returns the class of object pointed to by `loc'. * @@ -1508,31 +1717,31 @@ H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) *------------------------------------------------------------------------- */ const H5O_obj_class_t * -H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) +H5O__obj_class(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header for location */ const H5O_obj_class_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_STATIC_TAG(loc->addr) /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Test whether entry qualifies as a particular type of object */ - if(NULL == (ret_value = H5O_obj_class_real(oh))) + if(NULL == (ret_value = H5O__obj_class_real(oh))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* end H5O_obj_class() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5O__obj_class() */ /*------------------------------------------------------------------------- - * Function: H5O_obj_class_real + * Function: H5O__obj_class_real * * Purpose: Returns the class of object pointed to by `oh'. * @@ -1545,12 +1754,12 @@ done: *------------------------------------------------------------------------- */ static const H5O_obj_class_t * -H5O_obj_class_real(H5O_t *oh) +H5O__obj_class_real(const H5O_t *oh) { size_t i; /* Local index variable */ const H5O_obj_class_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(oh); @@ -1564,14 +1773,14 @@ H5O_obj_class_real(H5O_t *oh) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") else if(isa) HGOTO_DONE(H5O_obj_class_g[i - 1]) - } + } /* end for */ if(0 == i) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to determine object type") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_obj_class_real() */ +} /* end H5O__obj_class_real() */ /*------------------------------------------------------------------------- @@ -1786,6 +1995,42 @@ done: /*------------------------------------------------------------------------- + * Function: H5O__exists_by_name + * + * Purpose: Internal routine to check if an object exists + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +htri_t +H5O__exists_by_name(const H5G_loc_t *loc, const char *name) +{ + htri_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Check if the object exists */ + if((ret_value = H5G_loc_exists(loc, name)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine if '%s' exists", name) + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__exists_by_name() */ + + +/*------------------------------------------------------------------------- * Function: H5O_get_hdr_info * * Purpose: Retrieve the object header information for an object @@ -1799,7 +2044,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) +H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1814,15 +2059,15 @@ H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) HDmemset(hdr, 0, sizeof(*hdr)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, hdr) < 0) + if(H5O__get_hdr_info_real(oh, hdr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1830,7 +2075,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_get_hdr_info_real + * Function: H5O__get_hdr_info_real * * Purpose: Internal routine to retrieve the object header information for an object * @@ -1843,13 +2088,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) +H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) { const H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ const H5O_chunk_t *curr_chunk; /* Pointer to current message being operated on */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(oh); @@ -1907,7 +2152,7 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) HDassert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_get_hdr_info_real() */ +} /* end H5O__get_hdr_info_real() */ /*------------------------------------------------------------------------- @@ -1924,21 +2169,20 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) *------------------------------------------------------------------------- */ herr_t -H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, - H5O_info_t *oinfo) +H5O_get_info(const H5O_loc_t *loc, hbool_t want_ih_info, H5O_info_t *oinfo) { const H5O_obj_class_t *obj_class; /* Class of object for header */ H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) /* Check args */ HDassert(loc); HDassert(oinfo); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Reset the object info structure */ @@ -1951,7 +2195,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, oinfo->addr = loc->addr; /* Get class for object */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) + if(NULL == (obj_class = H5O__obj_class_real(oh))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object class") /* Retrieve the type of the object */ @@ -1984,7 +2228,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME message") if(exists > 0) { /* Get "old style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_ID, &oinfo->ctime)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_ID, &oinfo->ctime)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME message") } /* end if */ else { @@ -1993,7 +2237,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for MTIME_NEW message") if(exists > 0) { /* Get "new style" modification time info */ - if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) + if(NULL == H5O_msg_read_oh(loc->file, oh, H5O_MTIME_NEW_ID, &oinfo->ctime)) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read MTIME_NEW message") } /* end if */ else @@ -2002,38 +2246,204 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, } /* end else */ /* Get the information for the object header */ - if(H5O_get_hdr_info_real(oh, &oinfo->hdr) < 0) + if(H5O__get_hdr_info_real(oh, &oinfo->hdr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object header info") /* Retrieve # of attributes */ - if(H5O_attr_count_real(loc->file, dxpl_id, oh, &oinfo->num_attrs) < 0) + if(H5O_attr_count_real(loc->file, oh, &oinfo->num_attrs) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute count") /* Get B-tree & heap metadata storage size, if requested */ if(want_ih_info) { /* Check for 'bh_info' callback for this type of object */ - if(obj_class->bh_info) { + if(obj_class->bh_info) /* Call the object's class 'bh_info' routine */ - if((obj_class->bh_info)(loc, dxpl_id, oh, &oinfo->meta_size.obj) < 0) + if((obj_class->bh_info)(loc, oh, &oinfo->meta_size.obj) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object's btree & heap info") - } /* end if */ /* Get B-tree & heap info for any attributes */ - if(oinfo->num_attrs > 0) { - if(H5O_attr_bh_info(loc->file, dxpl_id, oh, &oinfo->meta_size.attr) < 0) + if(oinfo->num_attrs > 0) + if(H5O__attr_bh_info(loc->file, oh, &oinfo->meta_size.attr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve attribute btree & heap info") - } /* end if */ } /* end if */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_get_info() */ /*------------------------------------------------------------------------- + * Function: H5O__get_info_by_name + * + * Purpose: Internal routine to retrieve an object's info + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, H5O_info_t *oinfo) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + HDassert(oinfo); + + /* Retrieve the object's information */ + if(H5G_loc_info(loc, name, TRUE, oinfo/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_info_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__get_info_by_idx + * + * Purpose: Internal routine to retrieve an object's info according to + * an index within a group. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo) +{ + H5G_loc_t obj_loc; /* Location used to open group */ + H5G_name_t obj_path; /* Opened object group hier. path */ + H5O_loc_t obj_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Entry at 'name' found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(group_name && *group_name); + HDassert(oinfo); + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object's location, according to the order in the index */ + if(H5G_loc_find_by_idx(loc, group_name, idx_type, order, n, &obj_loc/*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") + loc_found = TRUE; + + /* Retrieve the object's information */ + if(H5O_get_info(obj_loc.oloc, TRUE, oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object info") + +done: + /* Release the object location */ + if(loc_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_info_by_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__set_comment_by_name + * + * Purpose: Internal routine to set an object's "comment" + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5O__set_comment_by_name(const H5G_loc_t *loc, const char *name, + const char *comment) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* (Re)set the object's comment */ + if(H5G_loc_set_comment(loc, name, comment) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set comment for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__set_comment_by_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5O__get_comment_by_name + * + * Purpose: Internal routine to retrieve an object's "comment" + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 28, 2017 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5O__get_comment_by_name(const H5G_loc_t *loc, const char *name, + char *comment, size_t bufsize) +{ + ssize_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + + /* Retrieve the object's comment */ + if((ret_value = H5G_loc_get_comment(loc, name, comment/*out*/, bufsize)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get comment for object") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__get_comment_by_name() */ + + +/*------------------------------------------------------------------------- * Function: H5O_get_create_plist * * Purpose: Retrieve the object creation properties for an object @@ -2047,7 +2457,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_plist) +H5O_get_create_plist(const H5O_loc_t *loc, H5P_genplist_t *oc_plist) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2059,7 +2469,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli HDassert(oc_plist); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set property values, if they were used for the object */ @@ -2081,7 +2491,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli } /* end if */ done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2102,7 +2512,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) +H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2114,14 +2524,14 @@ H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) HDassert(nlinks); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Retrieve the # of link messages seen when the object header was loaded */ *nlinks = oh->link_msgs_seen; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2142,8 +2552,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id) +H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc) { size_t u; /* Local index variable */ void *ret_value = NULL; /* Return value */ @@ -2162,7 +2571,7 @@ H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc if(H5O_obj_class_g[u]->type == obj_type) { /* Call the object class's 'create' routine */ HDassert(H5O_obj_class_g[u]->create); - if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc, dxpl_id))) + if(NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object") /* Break out of loop */ @@ -2220,7 +2629,7 @@ H5O_get_oh_addr(const H5O_t *oh) *------------------------------------------------------------------------- */ herr_t -H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype) +H5O_get_rc_and_type(const H5O_loc_t *loc, unsigned *rc, H5O_type_t *otype) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2231,7 +2640,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ HDassert(loc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Set the object's reference count */ @@ -2240,11 +2649,11 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ /* Retrieve the type of the object */ if(otype) - if(H5O_obj_type_real(oh, otype) < 0) + if(H5O__obj_type_real(oh, otype) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2252,7 +2661,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_free_visit_visited + * Function: H5O__free_visit_visited * * Purpose: Free the key for an object visited during a group traversal * @@ -2264,18 +2673,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) +H5O__free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *operator_data/*in,out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR item = H5FL_FREE(H5_obj_t, item); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_free_visit_visited() */ +} /* end H5O__free_visit_visited() */ /*------------------------------------------------------------------------- - * Function: H5O_visit_cb + * Function: H5O__visit_cb * * Purpose: Callback function for recursively visiting objects from a group * @@ -2288,7 +2697,7 @@ H5O_free_visit_visited(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static herr_t -H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, +H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *linfo, void *_udata) { H5O_iter_visit_ud_t *udata = (H5O_iter_visit_ud_t *)_udata; /* User data for callback */ @@ -2298,7 +2707,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin hbool_t obj_found = FALSE; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(name); @@ -2316,7 +2725,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin /* Find the object using the LAPL passed in */ /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G_loc_find(udata->start_loc, name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") obj_found = TRUE; @@ -2329,7 +2738,7 @@ H5O_visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t *lin H5O_info_t oinfo; /* Object info */ /* Get the object's info */ - if(H5O_get_info(&obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0) + if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") /* Make the application callback */ @@ -2363,11 +2772,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit_cb() */ +} /* end H5O__visit_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_visit + * Function: H5O__visit * * Purpose: Recursively visit an object and all the objects reachable * from it. If the starting object is a group, all the objects @@ -2399,9 +2808,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) +H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data) { H5O_iter_visit_ud_t udata; /* User data for callback */ H5G_loc_t loc; /* Location of reference object */ @@ -2413,7 +2821,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t obj_id = (-1); /* ID of object */ herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE_VOL /* Portably initialize user data struct to zeros */ HDmemset(&udata, 0, sizeof(udata)); @@ -2428,17 +2836,17 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5G_loc_reset(&obj_loc); /* Find the object's location */ - if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/, lapl_id, dxpl_id) < 0) + if(H5G_loc_find(&loc, obj_name, &obj_loc/*out*/) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "object not found") loc_found = TRUE; /* Get the object's info */ - if(H5O_get_info(&obj_oloc, dxpl_id, TRUE, &oinfo) < 0) + if(H5O_get_info(&obj_oloc, TRUE, &oinfo) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") /* Open the object */ /* (Takes ownership of the obj_loc information) */ - if((obj_id = H5O_open_by_loc(&obj_loc, lapl_id, dxpl_id, TRUE)) < 0) + if((obj_id = H5O__open_by_loc(&obj_loc, TRUE)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open object") /* Make callback for starting object */ @@ -2460,8 +2868,6 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, /* Set up user data for visiting links */ udata.obj_id = obj_id; udata.start_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; udata.op = op; udata.op_data = op_data; @@ -2488,7 +2894,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, } /* end if */ /* Call internal group visitation routine */ - if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O_visit_cb, &udata, lapl_id, dxpl_id)) < 0) + if((ret_value = H5G_visit(obj_id, ".", idx_type, order, H5O__visit_cb, &udata)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") } /* end if */ @@ -2500,14 +2906,14 @@ done: else if(loc_found && H5G_loc_free(&obj_loc) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") if(udata.visited) - H5SL_destroy(udata.visited, H5O_free_visit_visited, NULL); + H5SL_destroy(udata.visited, H5O__free_visit_visited, NULL); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_visit() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5O__visit() */ /*------------------------------------------------------------------------- - * Function: H5O_inc_rc + * Function: H5O__inc_rc * * Purpose: Increments the reference count on an object header * @@ -2520,11 +2926,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_inc_rc(H5O_t *oh) +H5O__inc_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -2539,11 +2945,11 @@ H5O_inc_rc(H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_inc_rc() */ +} /* end H5O__inc_rc() */ /*------------------------------------------------------------------------- - * Function: H5O_dec_rc + * Function: H5O__dec_rc * * Purpose: Decrements the reference count on an object header * @@ -2556,11 +2962,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_dec_rc(H5O_t *oh) +H5O__dec_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(oh); @@ -2575,7 +2981,7 @@ H5O_dec_rc(H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dec_rc() */ +} /* end H5O__dec_rc() */ /*------------------------------------------------------------------------- @@ -2593,7 +2999,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_dec_rc_by_loc(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2604,17 +3010,17 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) HDassert(loc); /* Get header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Decrement the reference count on the object header */ /* (which will unpin it, if appropriate) */ - if(H5O_dec_rc(oh) < 0) + if(H5O__dec_rc(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement reference count on object header") done: /* Release the object header from the cache */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -2690,7 +3096,7 @@ H5O__free(H5O_t *oh) HDassert(oh->mesg[u].dirty == 0); #endif /* NDEBUG */ - H5O_msg_free_mesg(&oh->mesg[u]); + H5O__msg_free_mesg(&oh->mesg[u]); } /* end for */ /* Make sure we accounted for all the messages dirtied by decoding */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 838a80f..e854884 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -33,25 +33,21 @@ /* Local macros */ -/* Version # of encoded virtual dataset global heap blocks */ -#define H5O_LAYOUT_VDS_GH_ENC_VERS 0 - /* PRIVATE PROTOTYPES */ -static void *H5O__layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__layout_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O__layout_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O__layout_copy(const void *_mesg, void *_dest); static size_t H5O__layout_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O__layout_reset(void *_mesg); static herr_t H5O__layout_free(void *_mesg); -static herr_t H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +static herr_t H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); static void *H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O__layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__layout_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LAYOUT[1] = {{ @@ -98,7 +94,7 @@ H5FL_DEFINE(H5O_layout_t); *------------------------------------------------------------------------- */ static void * -H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_layout_t *mesg = NULL; @@ -395,7 +391,7 @@ H5O__layout_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED size_t i; /* Read heap */ - if(NULL == (heap_block = (uint8_t *)H5HG_read(f, dxpl_id, &(mesg->storage.u.virt.serial_list_hobjid), NULL, &block_size))) + if(NULL == (heap_block = (uint8_t *)H5HG_read(f, &(mesg->storage.u.virt.serial_list_hobjid), NULL, &block_size))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "Unable to read global heap block") heap_block_p = (const uint8_t *)heap_block; @@ -550,8 +546,6 @@ static herr_t H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - uint8_t *heap_block = NULL; - size_t *str_size = NULL; unsigned u; herr_t ret_value = SUCCEED; /* Return value */ @@ -676,106 +670,9 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, break; case H5D_VIRTUAL: - /* Create heap block if it has not been created yet */ - /* Note that we assume here that the contents of the heap block - * cannot change! If this ever stops being the case we must change - * this code to allow overwrites of the heap block. -NAF */ - if((mesg->storage.u.virt.serial_list_hobjid.addr == HADDR_UNDEF) - && (mesg->storage.u.virt.list_nused > 0)) { - uint8_t *heap_block_p; - size_t block_size; - hssize_t select_serial_size; - hsize_t tmp_hsize; - uint32_t chksum; - size_t i; - - /* Allocate array for caching results of strlen */ - if(NULL == (str_size = (size_t *)H5MM_malloc(2 * mesg->storage.u.virt.list_nused *sizeof(size_t)))) - HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate string length array") - - /* - * Calculate heap block size - */ - /* Version and number of entries */ - block_size = (size_t)1 + H5F_SIZEOF_SIZE(f); - - /* Calculate size of each entry */ - for(i = 0; i < mesg->storage.u.virt.list_nused; i++) { - HDassert(mesg->storage.u.virt.list[i].source_file_name); - HDassert(mesg->storage.u.virt.list[i].source_dset_name); - HDassert(mesg->storage.u.virt.list[i].source_select); - HDassert(mesg->storage.u.virt.list[i].source_dset.virtual_select); - - /* Source file name */ - str_size[2 * i] = HDstrlen(mesg->storage.u.virt.list[i].source_file_name) + (size_t)1; - block_size += str_size[2 * i]; - - /* Source dset name */ - str_size[(2 * i) + 1] = HDstrlen(mesg->storage.u.virt.list[i].source_dset_name) + (size_t)1; - block_size += str_size[(2 * i) + 1]; - - /* Source selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(mesg->storage.u.virt.list[i].source_select)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") - block_size += (size_t)select_serial_size; - - /* Virtual dataset selection */ - if((select_serial_size = H5S_SELECT_SERIAL_SIZE(mesg->storage.u.virt.list[i].source_dset.virtual_select)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to check dataspace selection size") - block_size += (size_t)select_serial_size; - } /* end for */ - - /* Checksum */ - block_size += 4; - - /* Allocate heap block */ - if(NULL == (heap_block = (uint8_t *)H5MM_malloc(block_size))) - HGOTO_ERROR(H5E_OHDR, H5E_RESOURCE, FAIL, "unable to allocate heap block") - - /* - * Encode heap block - */ - heap_block_p = heap_block; - - /* Encode heap block encoding version */ - *heap_block_p++ = (uint8_t)H5O_LAYOUT_VDS_GH_ENC_VERS; - - /* Number of entries */ - tmp_hsize = (hsize_t)mesg->storage.u.virt.list_nused; - H5F_ENCODE_LENGTH(f, heap_block_p, tmp_hsize) - - /* Encode each entry */ - for(i = 0; i < mesg->storage.u.virt.list_nused; i++) { - /* Source file name */ - (void)HDmemcpy((char *)heap_block_p, mesg->storage.u.virt.list[i].source_file_name, str_size[2 * i]); - heap_block_p += str_size[2 * i]; - - /* Source dataset name */ - (void)HDmemcpy((char *)heap_block_p, mesg->storage.u.virt.list[i].source_dset_name, str_size[(2 * i) + 1]); - heap_block_p += str_size[(2 * i) + 1]; - - /* Source selection */ - if(H5S_SELECT_SERIALIZE(mesg->storage.u.virt.list[i].source_select, &heap_block_p) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize source selection") - - /* Virtual selection */ - if(H5S_SELECT_SERIALIZE(mesg->storage.u.virt.list[i].source_dset.virtual_select, &heap_block_p) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to serialize virtual selection") - } /* end for */ - - /* Checksum */ - chksum = H5_checksum_metadata(heap_block, block_size - (size_t)4, 0); - UINT32ENCODE(heap_block_p, chksum) - - /* Insert block into global heap */ - if(H5HG_insert(f, H5AC_ind_read_dxpl_id, block_size, heap_block, &((H5O_layout_t *)mesg)->storage.u.virt.serial_list_hobjid) < 0) /* Casting away const OK --NAF */ - HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to insert virtual dataset heap block") - } /* end if */ - - /* Heap information */ + /* Encode heap ID for VDS info */ H5F_addr_encode(f, &p, mesg->storage.u.virt.serial_list_hobjid.addr); UINT32ENCODE(p, mesg->storage.u.virt.serial_list_hobjid.idx); - break; case H5D_LAYOUT_ERROR: @@ -785,9 +682,6 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, } /* end switch */ done: - heap_block = (uint8_t *)H5MM_xfree(heap_block); - str_size = (size_t *)H5MM_xfree(str_size); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__layout_encode() */ @@ -997,7 +891,7 @@ H5O__layout_free(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_layout_t *mesg = (H5O_layout_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -1017,19 +911,19 @@ H5O__layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) case H5D_CONTIGUOUS: /* Contiguous block on disk */ /* Free the file space for the raw data */ - if(H5D__contig_delete(f, dxpl_id, &mesg->storage) < 0) + if(H5D__contig_delete(f, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_CHUNKED: /* Chunked blocks on disk */ /* Free the file space for the index & chunk raw data */ - if(H5D__chunk_delete(f, dxpl_id, open_oh, &mesg->storage) < 0) + if(H5D__chunk_delete(f, open_oh, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_VIRTUAL: /* Virtual dataset */ /* Free the file space virtual dataset */ - if(H5D__virtual_delete(f, dxpl_id, &mesg->storage) < 0) + if(H5D__virtual_delete(f, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; @@ -1061,7 +955,7 @@ done: static void * H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void *_udata) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *) mesg_src; @@ -1085,7 +979,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_COMPACT: if(layout_src->storage.u.compact.buf) { /* copy compact raw data */ - if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ @@ -1102,7 +996,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, if(H5D__contig_is_space_alloc(&layout_src->storage)) { /* copy contiguous raw data */ - if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage") copied = TRUE; } /* end if */ @@ -1111,7 +1005,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_CHUNKED: if(H5D__chunk_is_space_alloc(&layout_src->storage)) { /* Create chunked layout */ - if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info, dxpl_id) < 0) + if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ @@ -1120,7 +1014,7 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_VIRTUAL: /* Copy virtual layout. Always copy so the memory fields get copied * properly. */ - if(H5D__virtual_copy(file_dst, layout_dst, dxpl_id) < 0) + if(H5D__virtual_copy(file_dst, layout_dst) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy virtual storage") break; @@ -1159,8 +1053,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth) +H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t u; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index cac4ed1..342e8ba 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -36,22 +36,21 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_linfo_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__linfo_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_linfo_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_linfo_copy(const void *_mesg, void *_dest); static size_t H5O_linfo_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_linfo_free(void *_mesg); -static herr_t H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); -static void *H5O_linfo_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_linfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__linfo_free(void *_mesg); +static herr_t H5O__linfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static void *H5O__linfo_copy_file(H5F_t *file_src, void *native_src, + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__linfo_debug(H5F_t *f, const void *_mesg, + FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ @@ -59,22 +58,22 @@ const H5O_msg_class_t H5O_MSG_LINFO[1] = {{ "linfo", /*message name for debugging */ sizeof(H5O_linfo_t), /*native message size */ 0, /* messages are sharable? */ - H5O_linfo_decode, /*decode message */ + H5O__linfo_decode, /*decode message */ H5O_linfo_encode, /*encode message */ H5O_linfo_copy, /*copy the native value */ H5O_linfo_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_linfo_free, /* free method */ - H5O_linfo_delete, /* file delete method */ + H5O__linfo_free, /* free method */ + H5O__linfo_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_linfo_copy_file, /* copy native value to file */ - H5O_linfo_post_copy_file, /* post copy native value to file */ + H5O__linfo_copy_file, /* copy native value to file */ + H5O__linfo_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_linfo_debug /*debug the message */ + H5O__linfo_debug /*debug the message */ }}; /* Current version of link info information */ @@ -90,7 +89,6 @@ typedef struct { const H5O_loc_t *src_oloc; /* Source object location */ H5O_loc_t *dst_oloc; /* Destination object location */ H5O_linfo_t *dst_linfo; /* Destination object's link info message */ - hid_t dxpl_id; /* DXPL for operation */ H5O_copy_t *cpy_info; /* Information for copy operation */ } H5O_linfo_postcopy_ud_t; @@ -99,7 +97,7 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); /*------------------------------------------------------------------------- - * Function: H5O_linfo_decode + * Function: H5O__linfo_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -113,14 +111,14 @@ H5FL_DEFINE_STATIC(H5O_linfo_t); *------------------------------------------------------------------------- */ static void * -H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_linfo_t *linfo = NULL; /* Link info */ unsigned char index_flags; /* Flags for encoding link index info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -132,7 +130,7 @@ H5O_linfo_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *o /* Allocate space for message */ if(NULL == (linfo = H5FL_MALLOC(H5O_linfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the index flags for the group */ index_flags = *p++; @@ -171,7 +169,7 @@ done: linfo = H5FL_FREE(H5O_linfo_t, linfo); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_decode() */ +} /* end H5O__linfo_decode() */ /*------------------------------------------------------------------------- @@ -255,7 +253,7 @@ H5O_linfo_copy(const void *_mesg, void *_dest) /* check args */ HDassert(linfo); if(!dest && NULL == (dest = H5FL_MALLOC(H5O_linfo_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *linfo; @@ -305,9 +303,9 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_linfo_free + * Function: H5O__linfo_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -317,20 +315,20 @@ H5O_linfo_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_free(void *mesg) +H5O__linfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_linfo_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_free() */ +} /* end H5O__linfo_free() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_delete + * Function: H5O__linfo_delete * * Purpose: Free file space referenced by message * @@ -342,12 +340,12 @@ H5O_linfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) +H5O__linfo_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_linfo_t *linfo = (H5O_linfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -355,16 +353,16 @@ H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_ /* If the group is using "dense" link storage, delete it */ if(H5F_addr_defined(linfo->fheap_addr)) - if(H5G__dense_delete(f, dxpl_id, linfo, TRUE) < 0) + if(H5G__dense_delete(f, linfo, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense link storage") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_delete() */ +} /* end H5O__linfo_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_copy_file + * Function: H5O__linfo_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -378,16 +376,16 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, +H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t *cpy_info, void *_udata) { H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; H5O_linfo_t *linfo_dst = NULL; H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *) _udata; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_STATIC_TAG(H5AC__COPIED_TAG) /* check args */ HDassert(linfo_src); @@ -415,7 +413,7 @@ H5O_linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fil */ if(H5F_addr_defined(linfo_src->fheap_addr)) { /* Create the dense link storage */ - if(H5G__dense_create(file_dst, dxpl_id, linfo_dst, udata->common.src_pline) < 0) + if(H5G__dense_create(file_dst, linfo_dst, udata->common.src_pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create 'dense' form of new format group") } /* end if */ } /* end else */ @@ -428,12 +426,12 @@ done: if(linfo_dst) linfo_dst = H5FL_FREE(H5O_linfo_t, linfo_dst); - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) -} /* H5O_linfo_copy_file() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* H5O__linfo_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_post_copy_file_cb + * Function: H5O__linfo_post_copy_file_cb * * Purpose: Callback routine for copying links from src to dst file * during "post copy" routine @@ -448,35 +446,34 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) +H5O__linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) { H5O_linfo_postcopy_ud_t *udata = (H5O_linfo_postcopy_ud_t *)_udata; /* 'User data' passed in */ H5O_link_t dst_lnk; /* Destination link to insert */ hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check arguments */ HDassert(src_lnk); HDassert(udata); /* Copy the link (and the object it points to) */ - if(H5L_link_copy_file(udata->dst_oloc->file, udata->dxpl_id, src_lnk, - udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) + if(H5L__link_copy_file(udata->dst_oloc->file, src_lnk, udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy link") dst_lnk_init = TRUE; - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(udata->dxpl_id, H5AC__COPIED_TAG, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Insert the new object in the destination file's group */ /* (Doesn't increment the link count - that's already been taken care of for hard links) */ - if(H5G__dense_insert(udata->dst_oloc->file, udata->dxpl_id, udata->dst_linfo, &dst_lnk) < 0) + if(H5G__dense_insert(udata->dst_oloc->file, udata->dst_linfo, &dst_lnk) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert destination link") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Check if the destination link has been initialized */ @@ -484,11 +481,11 @@ done: H5O_msg_reset(H5O_LINK_ID, &dst_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_linfo_post_copy_file_cb() */ +} /* end H5O__linfo_post_copy_file_cb() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_post_copy_file + * Function: H5O__linfo_post_copy_file * * Purpose: Finish copying a message from between files * @@ -500,15 +497,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_linfo_t *linfo_src = (const H5O_linfo_t *)mesg_src; H5O_linfo_t *linfo_dst = (H5O_linfo_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(src_oloc && src_oloc->file); @@ -530,21 +527,20 @@ H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, udata.src_oloc = src_oloc; udata.dst_oloc = dst_oloc; udata.dst_linfo = linfo_dst; - udata.dxpl_id = dxpl_id; udata.cpy_info = cpy_info; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G__dense_iterate(src_oloc->file, dxpl_id, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O_linfo_post_copy_file_cb, &udata) < 0) + if(H5G__dense_iterate(src_oloc->file, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O__linfo_post_copy_file_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_linfo_post_copy_file() */ +} /* H5O__linfo_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_linfo_debug + * Function: H5O__linfo_debug * * Purpose: Prints debugging info for a message. * @@ -557,12 +553,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_linfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__linfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_linfo_t *linfo = (const H5O_linfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -588,5 +584,5 @@ H5O_linfo_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_linfo_debug() */ +} /* end H5O__linfo_debug() */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 77872ad..12dbe30 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -38,23 +38,23 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_link_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__link_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_link_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_link_copy(const void *_mesg, void *_dest); static size_t H5O_link_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_link_reset(void *_mesg); -static herr_t H5O_link_free(void *_mesg); +static herr_t H5O__link_reset(void *_mesg); +static herr_t H5O__link_free(void *_mesg); static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static void *H5O_link_copy_file(H5F_t *file_src, void *native_src, +static void *H5O__link_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *udata); +static herr_t H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_link_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__link_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ @@ -62,22 +62,22 @@ const H5O_msg_class_t H5O_MSG_LINK[1] = {{ "link", /*message name for debugging */ sizeof(H5O_link_t), /*native message size */ 0, /* messages are sharable? */ - H5O_link_decode, /*decode message */ + H5O__link_decode, /*decode message */ H5O_link_encode, /*encode message */ H5O_link_copy, /*copy the native value */ H5O_link_size, /*size of symbol table entry */ - H5O_link_reset, /* reset method */ - H5O_link_free, /* free method */ + H5O__link_reset, /* reset method */ + H5O__link_free, /* free method */ H5O_link_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ H5O_link_pre_copy_file, /* pre copy native value to file */ - H5O_link_copy_file, /* copy native value to file */ - H5O_link_post_copy_file, /* post copy native value to file */ + H5O__link_copy_file, /* copy native value to file */ + H5O__link_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_link_debug /*debug the message */ + H5O__link_debug /*debug the message */ }}; /* Current version of link information */ @@ -101,7 +101,7 @@ H5FL_DEFINE_STATIC(H5O_link_t); /*------------------------------------------------------------------------- - * Function: H5O_link_decode + * Function: H5O__link_decode * * Purpose: Decode a message and return a pointer to * a newly allocated one. @@ -117,7 +117,7 @@ H5FL_DEFINE_STATIC(H5O_link_t); *------------------------------------------------------------------------- */ static void * -H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_link_t *lnk = NULL; /* Pointer to link message */ @@ -125,7 +125,7 @@ H5O_link_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *op unsigned char link_flags; /* Flags for encoding link info */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -262,7 +262,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_decode() */ +} /* end H5O__link_decode() */ /*------------------------------------------------------------------------- @@ -534,7 +534,7 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void /*------------------------------------------------------------------------- - * Function: H5O_link_reset + * Function: H5O__link_reset * * Purpose: Frees resources within a message, but doesn't free * the message itself. @@ -547,11 +547,11 @@ H5O_link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void *------------------------------------------------------------------------- */ static herr_t -H5O_link_reset(void *_mesg) +H5O__link_reset(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(lnk) { /* Free information for link (but don't free link pointer) */ @@ -565,13 +565,13 @@ H5O_link_reset(void *_mesg) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_reset() */ +} /* end H5O__link_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_link_free + * Function: H5O__link_free * - * Purpose: Free's the message contents and the message itself + * Purpose: Frees the message contents and the message itself * * Return: Non-negative on success/Negative on failure * @@ -581,20 +581,18 @@ H5O_link_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_link_free(void *_mesg) +H5O__link_free(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(lnk); - /* Free information for link */ - H5O_link_reset(lnk); lnk = H5FL_FREE(H5O_link_t, lnk); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_link_free() */ +} /* end H5O__link_free() */ /*------------------------------------------------------------------------- @@ -610,7 +608,7 @@ H5O_link_free(void *_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) +H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -633,7 +631,7 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *_m oloc.addr = lnk->u.hard.addr; /* Decrement the ref count for the object */ - if(H5O_link(&oloc, -1, dxpl_id) < 0) + if(H5O_link(&oloc, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to decrement object link count") } /* end if */ /* Perform the "delete" callback when a user-defined link is removed */ @@ -707,7 +705,7 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED /*------------------------------------------------------------------------- - * Function: H5O_link_copy_file + * Function: H5O__link_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -721,14 +719,14 @@ H5O_link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSED *------------------------------------------------------------------------- */ static void * -H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, +H5O__link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_ATTR_UNUSED *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata, hid_t H5_ATTR_UNUSED dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_link_t *link_src = (H5O_link_t *)native_src; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(link_src); @@ -746,11 +744,11 @@ H5O_link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_AT done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_link_copy_file() */ +} /* H5O__link_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_link_post_copy_file + * Function: H5O__link_post_copy_file * * Purpose: Finish copying a message from between files * @@ -762,15 +760,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_link_t *link_src = (const H5O_link_t *)mesg_src; H5O_link_t *link_dst = (H5O_link_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(link_src); @@ -782,17 +780,16 @@ H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, HDassert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); /* Copy the link (and the object it points to) */ - if(H5L_link_copy_file(dst_oloc->file, dxpl_id, link_src, src_oloc, link_dst, - cpy_info) < 0) + if(H5L__link_copy_file(dst_oloc->file, link_src, src_oloc, link_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy link") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_link_post_copy_file() */ +} /* H5O__link_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_link_debug + * Function: H5O__link_debug * * Purpose: Prints debugging info for a message. * @@ -805,8 +802,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_link_t *lnk = (const H5O_link_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -873,5 +870,5 @@ H5O_link_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_link_debug() */ +} /* end H5O__link_debug() */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 158701b..0ae2eac 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -54,7 +54,6 @@ /* User data for iteration while removing a message */ typedef struct { H5F_t *f; /* Pointer to file for insertion */ - hid_t dxpl_id; /* DXPL during iteration */ int sequence; /* Sequence # to search for */ unsigned nfailed; /* # of failed message removals */ H5O_operator_t op; /* Callback routine for removal operations */ @@ -75,7 +74,7 @@ typedef struct { static herr_t H5O__msg_reset_real(const H5O_msg_class_t *type, void *native); static herr_t H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned *oh_modified, void *_udata/*in,out*/); -static herr_t H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, +static herr_t H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags); @@ -113,7 +112,7 @@ static herr_t H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, */ herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id) + unsigned update_flags, void *mesg) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -127,11 +126,11 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HDassert(mesg); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Go append message to object header */ - if(H5O_msg_append_oh(loc->file, dxpl_id, oh, type_id, mesg_flags, update_flags, mesg) < 0) + if(H5O_msg_append_oh(loc->file, oh, type_id, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to append to object header") done: @@ -160,7 +159,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, +H5O_msg_append_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg) { const H5O_msg_class_t *type; /* Original H5O class type for the ID */ @@ -179,7 +178,7 @@ H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, HDassert(mesg); /* Append new message to object header */ - if(H5O_msg_append_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_append_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new message in header") done: @@ -188,7 +187,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_append_real + * Function: H5O__msg_append_real * * Purpose: Append a new message to an object header. * @@ -203,13 +202,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_append_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg) { size_t idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -219,11 +218,11 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t HDassert(mesg); /* Allocate space for a new message */ - if(H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, mesg, &idx) < 0) + if(H5O__msg_alloc(f, oh, type, &mesg_flags, mesg, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create new message") /* Copy the information for the message */ - if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -231,7 +230,7 @@ H5O_assert(oh); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_append_real() */ +} /* end H5O__msg_append_real() */ /*------------------------------------------------------------------------- @@ -256,7 +255,7 @@ done: */ herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id) + unsigned update_flags, void *mesg) { H5O_t *oh = NULL; /* Object header to use */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -276,11 +275,11 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" modify routine */ - if(H5O_msg_write_real(loc->file, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_write_real(loc->file, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header message") done: @@ -311,13 +310,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg) +H5O_msg_write_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, + unsigned update_flags, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check args */ HDassert(f); @@ -330,16 +329,16 @@ H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Call the "real" modify routine */ - if(H5O_msg_write_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) + if(H5O__msg_write_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header message") done: - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_write_oh() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_write_real + * Function: H5O__msg_write_real * * Purpose: Modifies an existing message or creates a new message. * @@ -359,14 +358,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, void *mesg) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ size_t idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -408,7 +407,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * the location of the object changes (from in another object's * header to the SOHM heap), so just delete it first -QAK) */ - if(H5SM_delete(f, dxpl_id, oh, (H5O_shared_t *)idx_msg->native) < 0) + if(H5SM_delete(f, oh, (H5O_shared_t *)idx_msg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete message from SOHM index") /* If we're replacing a shared message, the new message must be shared @@ -418,14 +417,14 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * XXX: This doesn't handle freeing extra space in object header from * a message shrinking. */ - if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) + if((status = H5SM_try_share(f, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "error while trying to share message") if(status == FALSE && (mesg_flags & H5O_MSG_FLAG_SHARED)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status") } /* end if */ /* Copy the information for the message */ - if(H5O__copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) + if(H5O__copy_mesg(f, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -433,7 +432,7 @@ H5O_assert(oh); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_write_real() */ +} /* end H5O__msg_write_real() */ /*------------------------------------------------------------------------- @@ -460,13 +459,12 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, - hid_t dxpl_id) +H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg) { H5O_t *oh = NULL; /* Object header to use */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(loc->addr, NULL) /* check args */ HDassert(loc); @@ -475,18 +473,18 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to protect object header") /* Call the "real" read routine */ - if(NULL == (ret_value = H5O_msg_read_oh(loc->file, dxpl_id, oh, type_id, mesg))) + if(NULL == (ret_value = H5O_msg_read_oh(loc->file, oh, type_id, mesg))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header message") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, NULL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_read() */ @@ -514,8 +512,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - void *mesg) +H5O_msg_read_oh(H5F_t *f, H5O_t *oh, unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned idx; /* Message's index in object header */ @@ -541,7 +538,7 @@ H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, * Decode the message if necessary. If the message is shared then retrieve * native message through the shared interface. */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, &(oh->mesg[idx]), NULL) + H5O_LOAD_NATIVE(f, 0, oh, &(oh->mesg[idx]), NULL) /* * The object header caches the native message (along with @@ -661,16 +658,16 @@ H5O_msg_free(unsigned type_id, void *mesg) HDassert(type); /* Call the "real" free routine */ - ret_value = H5O_msg_free_real(type, mesg); + ret_value = H5O__msg_free_real(type, mesg); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_free() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_free_mesg + * Function: H5O__msg_free_mesg * - * Purpose: Call H5O_msg_free_real() on a message. + * Purpose: Call H5O__msg_free_real() on a message. * * Return: Non-negative on success/Negative on failure * @@ -680,28 +677,27 @@ H5O_msg_free(unsigned type_id, void *mesg) *------------------------------------------------------------------------- */ herr_t -H5O_msg_free_mesg(H5O_mesg_t *mesg) +H5O__msg_free_mesg(H5O_mesg_t *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check args */ HDassert(mesg); /* Free any native information */ - mesg->native = H5O_msg_free_real(mesg->type, mesg->native); + mesg->native = H5O__msg_free_real(mesg->type, mesg->native); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_msg_free_mesg() */ +} /* end H5O__msg_free_mesg() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_free_real + * Function: H5O__msg_free_real * * Purpose: Similar to H5O_msg_reset() except it also frees the message * pointer. * * Return: Success: NULL - * * Failure: NULL * * Programmer: Robb Matzke @@ -710,9 +706,9 @@ H5O_msg_free_mesg(H5O_mesg_t *mesg) *------------------------------------------------------------------------- */ void * -H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) +H5O__msg_free_real(const H5O_msg_class_t *type, void *msg_native) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* check args */ HDassert(type); @@ -726,7 +722,7 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) } /* end if */ FUNC_LEAVE_NOAPI(NULL) -} /* end H5O_msg_free_real() */ +} /* end H5O__msg_free_real() */ /*------------------------------------------------------------------------- @@ -783,7 +779,7 @@ done: *------------------------------------------------------------------------- */ int -H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) +H5O_msg_count(const H5O_loc_t *loc, unsigned type_id) { H5O_t *oh = NULL; /* Object header to operate on */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -801,7 +797,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HDassert(type); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Count the messages of the correct type */ @@ -809,7 +805,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) H5_CHECKED_ASSIGN(ret_value, int, msg_count, unsigned); done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -871,19 +867,19 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) *------------------------------------------------------------------------- */ htri_t -H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) +H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id) { H5O_t *oh = NULL; /* Object header for location */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) HDassert(loc); HDassert(loc->file); HDassert(type_id < NELMTS(H5O_msg_class_g)); /* Load the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" exists routine */ @@ -891,10 +887,10 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, FAIL, "unable to verify object header message") done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5O_msg_exists() */ @@ -961,8 +957,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link, - hid_t dxpl_id) +H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -980,11 +975,11 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj HDassert(type); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" remove routine */ - if((ret_value = H5O_msg_remove_real(loc->file, oh, type, sequence, NULL, NULL, adj_link, dxpl_id)) < 0) + if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, NULL, NULL, adj_link)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message") done: @@ -1014,7 +1009,7 @@ done: */ herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, - H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id) + H5O_operator_t op, void *op_data, hbool_t adj_link) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -1032,11 +1027,11 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, HDassert(type); /* Pin the object header */ - if(NULL == (oh = H5O_pin(loc, dxpl_id))) + if(NULL == (oh = H5O_pin(loc))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, FAIL, "unable to pin object header") /* Call the "real" remove routine */ - if((ret_value = H5O_msg_remove_real(loc->file, oh, type, sequence, op, op_data, adj_link, dxpl_id)) < 0) + if((ret_value = H5O__msg_remove_real(loc->file, oh, type, sequence, op, op_data, adj_link)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove object header message") done: @@ -1095,7 +1090,7 @@ H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, * (OK to remove constant messages - QAK) */ /* Convert message into a null message */ - if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, udata->adj_link) < 0) + if(H5O_release_mesg(udata->f, oh, mesg, udata->adj_link) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") /* Indicate that the object header was modified */ @@ -1112,7 +1107,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_remove_real + * Function: H5O__msg_remove_real * * Purpose: Removes the specified message from the object header. * If sequence is H5O_ALL (-1) then all messages of the @@ -1129,15 +1124,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - int sequence, H5O_operator_t app_op, void *op_data, hbool_t adj_link, - hid_t dxpl_id) +H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + int sequence, H5O_operator_t app_op, void *op_data, hbool_t adj_link) { H5O_iter_rm_t udata; /* User data for iterator */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1150,7 +1144,6 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, /* Set up iterator operator data */ udata.f = f; - udata.dxpl_id = dxpl_id; udata.sequence = sequence; udata.nfailed = 0; udata.op = app_op; @@ -1160,7 +1153,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, /* Iterate over the messages, deleting appropriate one(s) */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5O__msg_remove_cb; - if(H5O_msg_iterate_real(f, oh, type, &op, &udata, dxpl_id) < 0) + if(H5O__msg_iterate_real(f, oh, type, &op, &udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "error iterating over messages") /* Fail if we tried to remove any constant messages */ @@ -1169,7 +1162,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_remove_real() */ +} /* end H5O__msg_remove_real() */ /*------------------------------------------------------------------------- @@ -1205,7 +1198,7 @@ done: */ herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id) + const H5O_mesg_operator_t *op, void *op_data) { H5O_t *oh = NULL; /* Pointer to actual object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -1223,15 +1216,15 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, HDassert(op); /* Protect the object header to iterate over */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Call the "real" iterate routine */ - if((ret_value = H5O_msg_iterate_real(loc->file, oh, type, op, op_data, dxpl_id)) < 0) + if((ret_value = H5O__msg_iterate_real(loc->file, oh, type, op, op_data)) < 0) HERROR(H5E_OHDR, H5E_BADITER, "unable to iterate over object header messages"); done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1239,7 +1232,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_iterate_real + * Function: H5O__msg_iterate_real * * Purpose: Iterate through object headers of a certain type. * @@ -1270,8 +1263,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id) +H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const H5O_mesg_operator_t *op, void *op_data) { H5O_mesg_t *idx_msg; /* Pointer to current message */ unsigned idx; /* Absolute index of current message in all messages */ @@ -1279,7 +1272,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned oh_modified = 0; /* Whether the callback modified the object header */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1292,7 +1285,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, for(sequence = 0, idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs && !ret_value; idx++, idx_msg++) { if(type == idx_msg->type) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(f, dxpl_id, 0, oh, idx_msg, FAIL) + H5O_LOAD_NATIVE(f, 0, oh, idx_msg, FAIL) /* Check for making an "internal" (i.e. within the H5O package) callback */ if(op->op_type == H5O_MESG_OP_LIB) @@ -1322,11 +1315,11 @@ done: * message removal) */ if(oh_modified & H5O_MODIFY_CONDENSE) - if(H5O_condense_header(f, oh, dxpl_id) < 0) + if(H5O_condense_header(f, oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") /* Mark object header as changed */ - if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(f, oh, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") /* Mark object header as dirty in cache */ @@ -1335,7 +1328,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_iterate_real() */ +} /* end H5O__msg_iterate_real() */ /*------------------------------------------------------------------------- @@ -1810,8 +1803,7 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - const unsigned char *buf) +H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, const unsigned char *buf) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ unsigned ioflags = 0; /* Flags for decode routine */ @@ -1826,7 +1818,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* decode */ - if((ret_value = (type->decode)(f, dxpl_id, open_oh, 0, &ioflags, buf)) == NULL) + if((ret_value = (type->decode)(f, open_oh, 0, &ioflags, buf)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode message") done: @@ -1835,7 +1827,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_msg_copy_file + * Function: H5O__msg_copy_file * * Purpose: Copies a message to file. If MESG is is the null pointer then a null * pointer is returned with no error. @@ -1853,13 +1845,13 @@ done: *------------------------------------------------------------------------- */ void * -H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, +H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(type); @@ -1873,16 +1865,16 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, /* The copy_file callback will return an H5O_shared_t only if the message * to be copied is a committed datatype. */ - if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, mesg_flags, cpy_info, udata, dxpl_id))) + if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, mesg_flags, cpy_info, udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object header message to file") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_copy_file() */ +} /* end H5O__msg_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_msg_alloc + * Function: H5O__msg_alloc * * Purpose: Create a new message in an object header * @@ -1895,14 +1887,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, +H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_flags, void *native, size_t *mesg_idx) { size_t new_idx; /* New index for message */ htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -1918,18 +1910,18 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "error determining if message is shared") else if(shared_mesg > 0) { /* Increment message's reference count */ - if(type->link && (type->link)(f, dxpl_id, oh, native) < 0) + if(type->link && (type->link)(f, oh, native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared message ref count") *mesg_flags |= H5O_MSG_FLAG_SHARED; } /* end if */ else { /* Attempt to share message */ - if(H5SM_try_share(f, dxpl_id, oh, 0, type->id, native, mesg_flags) < 0) + if(H5SM_try_share(f, oh, 0, type->id, native, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") } /* end else */ /* Allocate space in the object header for the message */ - if(H5O_alloc(f, dxpl_id, oh, type, native, &new_idx) < 0) + if(H5O__alloc(f, oh, type, native, &new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for message") /* Get the message's "creation index", if it has one */ @@ -1944,7 +1936,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_msg_alloc() */ +} /* end H5O__msg_alloc() */ /*------------------------------------------------------------------------- @@ -1961,9 +1953,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, - const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, - unsigned update_flags) +H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, + const void *mesg, unsigned mesg_flags, unsigned update_flags) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ @@ -1980,7 +1971,7 @@ H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, HDassert(mesg); /* Protect chunk */ - if(NULL == (chk_proxy = H5O_chunk_protect(f, dxpl_id, oh, idx_msg->chunkno))) + if(NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx_msg->chunkno))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Reset existing native information for the header's message */ @@ -1998,18 +1989,18 @@ H5O__copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t idx, chk_dirtied = TRUE; /* Release chunk */ - if(H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") chk_proxy = NULL; /* Update the modification time, if requested */ if(update_flags & H5O_UPDATE_TIME) - if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) + if(H5O_touch_oh(f, oh, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: /* Release chunk, if not already released */ - if(chk_proxy && H5O_chunk_unprotect(f, dxpl_id, chk_proxy, chk_dirtied) < 0) + if(chk_proxy && H5O__chunk_unprotect(f, chk_proxy, chk_dirtied) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") FUNC_LEAVE_NOAPI(ret_value) @@ -2021,8 +2012,8 @@ done: * * Purpose: Calls a message's delete callback. * - * This is mostly redundant with H5O_delete_mesg below, - * but H5O_delete_mesg only works on messages in object headers + * This is mostly redundant with H5O__delete_mesg below, + * but H5O__delete_mesg only works on messages in object headers * (while the shared message code needs to delete messages in * the heap). * @@ -2039,8 +2030,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - void *mesg) +H5O_msg_delete(H5F_t *f, H5O_t *open_oh, unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2054,7 +2044,7 @@ H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, HDassert(type); /* delete */ - if((type->del) && (type->del)(f, dxpl_id, open_oh, mesg) < 0) + if((type->del) && (type->del)(f, open_oh, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") done: @@ -2063,7 +2053,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_delete_mesg + * Function: H5O__delete_mesg * * Purpose: Internal function to: * Delete an object header message from a file. This frees the file @@ -2078,12 +2068,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg) +H5O__delete_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) { const H5O_msg_class_t *type = mesg->type; /* Type of object to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -2093,15 +2083,15 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg) /* Check if there is a file space deletion callback for this type of message */ if(type->del) { /* Decode the message if necessary. */ - H5O_LOAD_NATIVE(f, dxpl_id, H5O_DECODEIO_NOCHANGE, oh, mesg, FAIL) + H5O_LOAD_NATIVE(f, H5O_DECODEIO_NOCHANGE, oh, mesg, FAIL) - if((type->del)(f, dxpl_id, oh, mesg->native) < 0) + if((type->del)(f, oh, mesg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_delete_mesg() */ +} /* end H5O__delete_mesg() */ /*------------------------------------------------------------------------- @@ -2264,7 +2254,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags) +H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags) { H5O_t *oh = NULL; /* Object header to use */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ @@ -2283,7 +2273,7 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t HDassert(type); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Locate message of correct type */ @@ -2298,7 +2288,7 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags = idx_msg->flags; done: - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 7e7baea..6699706 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -27,20 +27,19 @@ #include "H5Opkg.h" /* Object headers */ -static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_new_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static size_t H5O_mtime_new_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__mtime_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_mtime_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_mtime_copy(const void *_mesg, void *_dest); static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_mtime_reset(void *_mesg); -static herr_t H5O_mtime_free(void *_mesg); -static herr_t H5O_mtime_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__mtime_free(void *_mesg); +static herr_t H5O__mtime_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ @@ -48,12 +47,12 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ "mtime", /*message name for debugging */ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ - H5O_mtime_decode, /*decode message */ + H5O__mtime_decode, /*decode message */ H5O_mtime_encode, /*encode message */ H5O_mtime_copy, /*copy the native value */ H5O_mtime_size, /*raw message size */ - H5O_mtime_reset, /* reset method */ - H5O_mtime_free, /* free method */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -63,7 +62,7 @@ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_mtime_debug /*debug the message */ + H5O__mtime_debug /*debug the message */ }}; /* This message derives from H5O message class */ @@ -73,12 +72,12 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ "mtime_new", /*message name for debugging */ sizeof(time_t), /*native message size */ 0, /* messages are sharable? */ - H5O_mtime_new_decode, /*decode message */ + H5O__mtime_new_decode, /*decode message */ H5O_mtime_new_encode, /*encode message */ H5O_mtime_copy, /*copy the native value */ H5O_mtime_new_size, /*raw message size */ - H5O_mtime_reset, /* reset method */ - H5O_mtime_free, /* free method */ + NULL, /* reset method */ + H5O__mtime_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -88,7 +87,7 @@ const H5O_msg_class_t H5O_MSG_MTIME_NEW[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_mtime_debug /*debug the message */ + H5O__mtime_debug /*debug the message */ }}; /* Current version of new mtime information */ @@ -99,7 +98,7 @@ H5FL_DEFINE(time_t); /*------------------------------------------------------------------------- - * Function: H5O_mtime_new_decode + * Function: H5O__mtime_new_decode * * Purpose: Decode a new modification time message and return a pointer to * a new time_t value. @@ -118,14 +117,14 @@ H5FL_DEFINE(time_t); *------------------------------------------------------------------------- */ static void * -H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { time_t *mesg; uint32_t tmp_time; /* Temporary copy of the time */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -151,11 +150,11 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_mtime_new_decode() */ +} /* end H5O__mtime_new_decode() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_decode + * Function: H5O__mtime_decode * * Purpose: Decode a modification time message and return a pointer to a * new time_t value. @@ -174,7 +173,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__mtime_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { time_t *mesg, the_time; @@ -182,7 +181,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -215,7 +214,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_mtime_decode() */ +} /* end H5O__mtime_decode() */ /*------------------------------------------------------------------------- @@ -406,58 +405,32 @@ H5O_mtime_size(const H5F_t H5_ATTR_UNUSED * f, hbool_t H5_ATTR_UNUSED disable_sh /*------------------------------------------------------------------------- - * Function: H5O_mtime_reset + * Function: H5O__mtime_free * - * Purpose: Frees resources within a modification time message, but doesn't free - * the message itself. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Mondey, December 23, 2002 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_mtime_reset(void H5_ATTR_UNUSED *_mesg) -{ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(SUCCEED) -} - - -/*------------------------------------------------------------------------- - * Function: H5O_mtime_free - * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_free(void *mesg) +H5O__mtime_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(time_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_mtime_free() */ +} /* end H5O__mtime_free() */ /*------------------------------------------------------------------------- - * Function: H5O_mtime_debug + * Function: H5O__mtime_debug * * Purpose: Prints debugging info for the message. * @@ -472,7 +445,7 @@ H5O_mtime_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const time_t *mesg = (const time_t *)_mesg; @@ -496,5 +469,5 @@ H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi "Time:", buf); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__mtime_debug() */ diff --git a/src/H5Oname.c b/src/H5Oname.c index 6292883..185dc48 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -32,14 +32,14 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__name_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static herr_t H5O_name_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_name_copy(const void *_mesg, void *_dest); static size_t H5O_name_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_name_reset(void *_mesg); -static herr_t H5O_name_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth); +static herr_t H5O__name_reset(void *_mesg); +static herr_t H5O__name_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ @@ -47,11 +47,11 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ "name", /*message name for debugging */ sizeof(H5O_name_t), /*native message size */ 0, /* messages are sharable? */ - H5O_name_decode, /*decode message */ + H5O__name_decode, /*decode message */ H5O_name_encode, /*encode message */ H5O_name_copy, /*copy the native value */ H5O_name_size, /*raw message size */ - H5O_name_reset, /*free internal memory */ + H5O__name_reset, /*free internal memory */ NULL, /* free method */ NULL, /* file delete method */ NULL, /* link method */ @@ -62,12 +62,12 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_name_debug /*debug the message */ + H5O__name_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_name_decode + * Function: H5O__name_decode * * Purpose: Decode a name message and return a pointer to a new * native message struct. @@ -83,13 +83,13 @@ const H5O_msg_class_t H5O_MSG_NAME[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__name_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_name_t *mesg; void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -105,13 +105,12 @@ H5O_name_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ ret_value = mesg; done: - if(NULL == ret_value) { + if(NULL == ret_value) if(mesg) mesg = (H5O_name_t *)H5MM_xfree(mesg); - } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_name_decode() */ +} /* end H5O__name_decode() */ /*------------------------------------------------------------------------- @@ -237,7 +236,7 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar /*------------------------------------------------------------------------- - * Function: H5O_name_reset + * Function: H5O__name_reset * * Purpose: Frees internal pointers and resets the message to an * initial state. @@ -248,16 +247,14 @@ H5O_name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar * matzke@llnl.gov * Aug 12 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_name_reset(void *_mesg) +H5O__name_reset(void *_mesg) { H5O_name_t *mesg = (H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(mesg); @@ -266,11 +263,11 @@ H5O_name_reset(void *_mesg) mesg->s = (char *)H5MM_xfree(mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_name_reset() */ +} /* end H5O__name_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_name_debug + * Function: H5O__name_debug * * Purpose: Prints debugging info for the message. * @@ -285,8 +282,8 @@ H5O_name_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_name_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, + int indent, int fwidth) { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; @@ -304,4 +301,5 @@ H5O_name_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void mesg->s); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__name_debug() */ + diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 109d273..c6fb55c 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -179,14 +179,14 @@ /* Load native information for a message, if it's not already present */ /* (Only works for messages with decode callback) */ -#define H5O_LOAD_NATIVE(F, DXPL, IOF, OH, MSG, ERR) \ +#define H5O_LOAD_NATIVE(F, IOF, OH, MSG, ERR) \ if(NULL == (MSG)->native) { \ const H5O_msg_class_t *msg_type = (MSG)->type; \ unsigned ioflags = (IOF); \ \ /* Decode the message */ \ HDassert(msg_type->decode); \ - if(NULL == ((MSG)->native = (msg_type->decode)((F), (DXPL), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ + if(NULL == ((MSG)->native = (msg_type->decode)((F), (OH), (MSG)->flags, &ioflags, (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ \ /* Mark the message dirty if it was changed by decoding */ \ @@ -228,22 +228,22 @@ struct H5O_msg_class_t { const char *name; /*for debugging */ size_t native_size; /*size of native message */ unsigned share_flags; /* Message sharing settings */ - void *(*decode)(H5F_t *, hid_t, H5O_t *, unsigned, unsigned *, const uint8_t *); + void *(*decode)(H5F_t *, H5O_t *, unsigned, unsigned *, const uint8_t *); herr_t (*encode)(H5F_t *, hbool_t, uint8_t *, const void *); void *(*copy)(const void *, void *); /*copy native value */ size_t (*raw_size)(const H5F_t *, hbool_t, const void *);/*sizeof encoded message */ herr_t (*reset)(void *); /*free nested data structs */ herr_t (*free)(void *); /*free main data struct */ - herr_t (*del)(H5F_t *, hid_t, H5O_t *, void *); /* Delete space in file referenced by this message */ - herr_t (*link)(H5F_t *, hid_t, H5O_t *, void *); /* Increment any links in file reference by this message */ + herr_t (*del)(H5F_t *, H5O_t *, void *); /* Delete space in file referenced by this message */ + herr_t (*link)(H5F_t *, H5O_t *, void *); /* Increment any links in file reference by this message */ herr_t (*set_share)(void*, const H5O_shared_t*); /* Set shared information */ htri_t (*can_share)(const void *); /* Is message allowed to be shared? */ herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */ - void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *, hid_t); /*copy native value to file */ - herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */ + void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *); /*copy native value to file */ + herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, H5O_copy_t *); /*"post copy" action when copying native value to file */ herr_t (*get_crt_index)(const void *, H5O_msg_crt_idx_t *); /* Get message's creation index */ herr_t (*set_crt_index)(void *, H5O_msg_crt_idx_t); /* Set message's creation index */ - herr_t (*debug)(H5F_t*, hid_t, const void*, FILE*, int, int); + herr_t (*debug)(H5F_t*, const void*, FILE*, int, int); }; struct H5O_mesg_t { @@ -338,12 +338,12 @@ typedef struct H5O_obj_class_t { const char *name; /*for debugging */ void *(*get_copy_file_udata)(void); /*retrieve user data for 'copy file' operation */ void (*free_copy_file_udata)(void *); /*free user data for 'copy file' operation */ - htri_t (*isa)(H5O_t *); /*if a header matches an object class */ - hid_t (*open)(const H5G_loc_t *, hid_t, hid_t, hbool_t ); /*open an object of this class */ - void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */ + htri_t (*isa)(const H5O_t *); /*if a header matches an object class */ + hid_t (*open)(const H5G_loc_t *, hbool_t ); /*open an object of this class */ + void *(*create)(H5F_t *, void *, H5G_loc_t *); /*create an object of this class */ H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */ - herr_t (*bh_info)(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */ - herr_t (*flush)(void *obj_ptr, hid_t dxpl_id); /*flush an opened object of this class */ + herr_t (*bh_info)(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */ + herr_t (*flush)(void *obj_ptr); /*flush an opened object of this class */ } H5O_obj_class_t; /* Node in skip list to map addresses from one file to another during object header copy */ @@ -366,7 +366,6 @@ typedef struct H5O_cont_msgs_t { /* Common callback information for loading object header prefix from disk */ typedef struct H5O_common_cache_ud_t { H5F_t *f; /* Pointer to file for object header/chunk */ - hid_t dxpl_id; /* DXPL for operation */ unsigned file_intent; /* Read/write intent for file */ unsigned merged_null_msgs; /* Number of null messages merged together */ H5O_cont_msgs_t *cont_msg_info; /* Pointer to continuation messages to work on */ @@ -390,21 +389,19 @@ typedef struct H5O_chunk_proxy_t { H5F_t *f; /* Pointer to file for object header/chunk */ H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Chunk number for this chunk */ - unsigned cont_chunkno; /* Chunk number for the chunk containing the continuation message that points to this chunk */ /* Flush depencency parent information (not stored) * * The following field is used to store a pointer - * to the in-core representation of the chunk proxy's flush dependency + * to the in-core representation of a new chunk proxy's flush dependency * parent -- if it exists. If it does not exist, this field will * contain NULL. * * If the file is opened in SWMR write mode, the flush dependency * parent of the chunk proxy will be either its object header - * (if cont_chunkno == 0) or the chunk proxy indicated by the - * cont_chunkno field (if cont_chunkno > 0). + * or the chunk with the continuation message that references this chunk. */ - void *parent; /* Pointer to flush dependency parent */ + void *fd_parent; /* Pointer to flush dependency parent */ } H5O_chunk_proxy_t; /* Callback information for loading object header chunk from disk */ @@ -558,89 +555,99 @@ H5_DLLVAR const H5O_obj_class_t H5O_OBJ_DATATYPE[1]; /* Package-local function prototypes */ -H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); -H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); -H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); -H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg); -H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted); -H5_DLL herr_t H5O_inc_rc(H5O_t *oh); -H5_DLL herr_t H5O_dec_rc(H5O_t *oh); +H5_DLL hid_t H5O__open_name(const H5G_loc_t *loc, const char *name); +H5_DLL hid_t H5O__open_by_idx(const H5G_loc_t *loc, const char *name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n); +H5_DLL hid_t H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr); +H5_DLL hid_t H5O__open_by_loc(const H5G_loc_t *obj_loc, hbool_t app_ref); +H5_DLL herr_t H5O__create_link(const H5G_loc_t *new_loc, const char *new_name, + H5G_loc_t *obj_loc, hid_t lcpl_id); +H5_DLL const H5O_obj_class_t *H5O__obj_class(const H5O_loc_t *loc); +H5_DLL int H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted); +H5_DLL herr_t H5O__link(const H5O_loc_t *loc, int adjust); +H5_DLL htri_t H5O__exists_by_name(const H5G_loc_t *loc, const char *name); +H5_DLL herr_t H5O__get_info_by_name(const H5G_loc_t *loc, const char *name, + H5O_info_t *oinfo); +H5_DLL herr_t H5O__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo); +H5_DLL herr_t H5O__set_comment_by_name(const H5G_loc_t *loc, const char *name, + const char *comment); +H5_DLL ssize_t H5O__get_comment_by_name(const H5G_loc_t *loc, const char *name, + char *comment, size_t bufsize); +H5_DLL herr_t H5O__visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, + H5_iter_order_t order, H5O_iterate_t op, void *op_data); +H5_DLL herr_t H5O__inc_rc(H5O_t *oh); +H5_DLL herr_t H5O__dec_rc(H5O_t *oh); H5_DLL herr_t H5O__free(H5O_t *oh); /* Object header message routines */ -H5_DLL herr_t H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg, - size_t *mesg_idx); -H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg); -H5_DLL herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg); -H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg); -H5_DLL herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg); +H5_DLL herr_t H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned *mesg_flags, void *mesg, size_t *mesg_idx); +H5_DLL herr_t H5O__msg_append_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL herr_t H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL void *H5O__msg_free_real(const H5O_msg_class_t *type, void *mesg); +H5_DLL herr_t H5O__msg_free_mesg(H5O_mesg_t *mesg); H5_DLL unsigned H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type); -H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); -H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, +H5_DLL herr_t H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link); +H5_DLL void *H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, - unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata); +H5_DLL herr_t H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const H5O_mesg_operator_t *op, void *op_data); +H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); +H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); +H5_DLL herr_t H5O__delete_mesg(H5F_t *f, H5O_t *open_oh, H5O_mesg_t *mesg); /* Object header chunk routines */ -H5_DLL herr_t H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, - unsigned cont_chunkno); -H5_DLL H5O_chunk_proxy_t *H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned idx); -H5_DLL herr_t H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, - H5O_chunk_proxy_t *chk_proxy, hbool_t chk_dirtied); -H5_DLL herr_t H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno); +H5_DLL H5O_chunk_proxy_t *H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, + hbool_t chk_dirtied); +H5_DLL herr_t H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy); -H5_DLL herr_t H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx); +H5_DLL herr_t H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx); H5_DLL herr_t H5O__chunk_dest(H5O_chunk_proxy_t *chunk_proxy); /* Collect storage info for btree and heap */ -H5_DLL herr_t H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5_ih_info_t *bh_info); +H5_DLL herr_t H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info); /* Object header allocation routines */ H5_DLL herr_t H5O_alloc_msgs(H5O_t *oh, size_t min_alloc); -H5_DLL herr_t H5O__alloc_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, +H5_DLL herr_t H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_msg_alloc_info_t *found_msg, size_t *new_idx); -H5_DLL herr_t H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, const void *mesg, size_t *mesg_idx); -H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id); -H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_mesg_t *mesg, hbool_t adj_link); +H5_DLL herr_t H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, + const void *mesg, size_t *mesg_idx); +H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh); +H5_DLL herr_t H5O_release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, + hbool_t adj_link); /* Shared object operators */ -H5_DLL void * H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned *ioflags, const uint8_t *buf, const H5O_msg_class_t *type); +H5_DLL void * H5O_shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, + const uint8_t *buf, const H5O_msg_class_t *type); H5_DLL herr_t H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_mesg); H5_DLL size_t H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +H5_DLL herr_t H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +H5_DLL herr_t H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); -H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, +H5_DLL herr_t H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id); -H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, + void *udata); +H5_DLL herr_t H5O__shared_post_copy_file (H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, - H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id, - H5O_copy_t *cpy_info); + H5O_shared_t *shared_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info); H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth); /* Attribute message operators */ -H5_DLL herr_t H5O_attr_reset(void *_mesg); -H5_DLL herr_t H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -H5_DLL herr_t H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -H5_DLL herr_t H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - hsize_t *nattrs); +H5_DLL herr_t H5O__attr_reset(void *_mesg); +H5_DLL herr_t H5O__attr_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +H5_DLL herr_t H5O__attr_link(H5F_t *f, H5O_t *open_oh, void *_mesg); +H5_DLL herr_t H5O_attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs); /* Testing functions */ #ifdef H5O_TESTING @@ -649,8 +656,8 @@ H5_DLL htri_t H5O_is_attr_dense_test(hid_t oid); H5_DLL herr_t H5O_num_attrs_test(hid_t oid, hsize_t *nattrs); H5_DLL herr_t H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count); H5_DLL herr_t H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val); -H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc, hid_t dxpl_id); -H5_DLL herr_t H5O_get_rc(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc); +H5_DLL herr_t H5O_expunge_chunks_test(const H5O_loc_t *oloc); +H5_DLL herr_t H5O_get_rc(const H5O_loc_t *oloc, unsigned *rc); H5_DLL herr_t H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num); H5_DLL herr_t H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type); @@ -660,7 +667,8 @@ H5_DLL herr_t H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type); #ifdef H5O_DEBUG H5_DLL herr_t H5O_assert(const H5O_t *oh); #endif /* H5O_DEBUG */ -H5_DLL herr_t H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5O_debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, + int indent, int fwidth); #endif /* _H5Opkg_H */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 2e52dbb..7ce4ae3 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -33,36 +33,36 @@ /* PRIVATE PROTOTYPES */ static herr_t H5O_pline_encode(H5F_t *f, uint8_t *p, const void *mesg); -static void *H5O_pline_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, +static void *H5O__pline_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); static void *H5O_pline_copy(const void *_mesg, void *_dest); static size_t H5O_pline_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_pline_reset(void *_mesg); -static herr_t H5O_pline_free(void *_mesg); +static herr_t H5O__pline_reset(void *_mesg); +static herr_t H5O__pline_free(void *_mesg); static herr_t H5O_pline_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static herr_t H5O_pline_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__pline_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_PLINE #define H5O_SHARED_DECODE H5O_pline_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_pline_decode +#define H5O_SHARED_DECODE_REAL H5O__pline_decode #define H5O_SHARED_ENCODE H5O_pline_shared_encode #define H5O_SHARED_ENCODE_REAL H5O_pline_encode #define H5O_SHARED_SIZE H5O_pline_shared_size #define H5O_SHARED_SIZE_REAL H5O_pline_size -#define H5O_SHARED_DELETE H5O_pline_shared_delete +#define H5O_SHARED_DELETE H5O__pline_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_pline_shared_link +#define H5O_SHARED_LINK H5O__pline_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_pline_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__pline_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_pline_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_pline_debug +#define H5O_SHARED_DEBUG_REAL H5O__pline_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -75,14 +75,14 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ H5O_pline_shared_encode, /* encode message */ H5O_pline_copy, /* copy the native value */ H5O_pline_shared_size, /* size of raw message */ - H5O_pline_reset, /* reset method */ - H5O_pline_free, /* free method */ - H5O_pline_shared_delete, /* file delete method */ - H5O_pline_shared_link, /* link method */ + H5O__pline_reset, /* reset method */ + H5O__pline_free, /* free method */ + H5O__pline_shared_delete, /* file delete method */ + H5O__pline_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ H5O_pline_pre_copy_file, /* pre copy native value to file */ - H5O_pline_shared_copy_file, /* copy native value to file */ + H5O__pline_shared_copy_file, /* copy native value to file */ H5O_pline_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -95,7 +95,7 @@ H5FL_DEFINE(H5O_pline_t); /*------------------------------------------------------------------------- - * Function: H5O_pline_decode + * Function: H5O__pline_decode * * Purpose: Decodes a filter pipeline message. * @@ -108,7 +108,7 @@ H5FL_DEFINE(H5O_pline_t); *------------------------------------------------------------------------- */ static void * -H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_pline_t *pline = NULL; /* Pipeline message */ @@ -117,7 +117,7 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 size_t i; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(p); @@ -215,12 +215,12 @@ H5O_pline_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 done: if(NULL == ret_value && pline) { - H5O_pline_reset(pline); - H5O_pline_free(pline); + H5O__pline_reset(pline); + H5O__pline_free(pline); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_pline_decode() */ +} /* end H5O__pline_decode() */ /*------------------------------------------------------------------------- @@ -405,9 +405,9 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) done: if(!ret_value && dst) { - H5O_pline_reset(dst); + H5O__pline_reset(dst); if(!_dst) - H5O_pline_free(dst); + H5O__pline_free(dst); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -476,7 +476,7 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) /*------------------------------------------------------------------------- - * Function: H5O_pline_reset + * Function: H5O__pline_reset * * Purpose: Resets a filter pipeline message by clearing all filters. * The MESG buffer is not freed. @@ -489,12 +489,12 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_reset(void *mesg) +H5O__pline_reset(void *mesg) { H5O_pline_t *pline = (H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(pline); @@ -521,13 +521,13 @@ H5O_pline_reset(void *mesg) pline->version = H5O_PLINE_VERSION_1; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_reset() */ +} /* end H5O__pline_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_pline_free + * Function: H5O__pline_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -537,16 +537,16 @@ H5O_pline_reset(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_pline_free(void *mesg) +H5O__pline_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_pline_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_free() */ +} /* end H5O__pline_free() */ /*------------------------------------------------------------------------- @@ -591,7 +591,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_pline_debug + * Function: H5O__pline_debug * * Purpose: Prints debugging information for filter pipeline message MESG * on output stream STREAM. Each line is indented INDENT @@ -605,13 +605,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, FILE *stream, - int indent, int fwidth) +H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, + int indent, int fwidth) { const H5O_pline_t *pline = (const H5O_pline_t *)mesg; size_t i, j; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -660,7 +660,7 @@ H5O_pline_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_pline_debug() */ +} /* end H5O__pline_debug() */ /*------------------------------------------------------------------------- diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 4b74d8f..455ec41 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -180,6 +180,7 @@ typedef struct H5O_copy_t { void *shared_fo; /* The shared pointer for the object */ H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */ void *mcdt_ud; /* User data passed to callback */ + hid_t lcpl_id; /* LCPL for callbacks' use */ } H5O_copy_t; /* Header message IDs */ @@ -387,6 +388,9 @@ typedef struct H5O_efl_t { | H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER \ ) +/* Version # of encoded virtual dataset global heap blocks */ +#define H5O_LAYOUT_VDS_GH_ENC_VERS 0 + /* Initial version of the layout information. Used when space is allocated */ #define H5O_LAYOUT_VERSION_1 1 @@ -854,65 +858,58 @@ struct H5P_genplist_t; /* Object header routines */ H5_DLL herr_t H5O_init(void); -H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, - size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/); +H5_DLL herr_t H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, + hid_t ocpl_id, H5O_loc_t *loc/*out*/); H5_DLL herr_t H5O_open(H5O_loc_t *loc); H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed/*out*/); -H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); -H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, - unsigned prot_flags, hbool_t pin_all_chunks); -H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust); +H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, + hbool_t pin_all_chunks); +H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc); H5_DLL herr_t H5O_unpin(H5O_t *oh); -H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL herr_t H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, - unsigned oh_flags); -H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); -H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - hbool_t force); +H5_DLL herr_t H5O_dec_rc_by_loc(const H5O_loc_t *loc); +H5_DLL herr_t H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags); +H5_DLL herr_t H5O_touch(const H5O_loc_t *loc, hbool_t force); +H5_DLL herr_t H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force); #ifdef H5O_ENABLE_BOGUS -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned mesg_id, unsigned mesg_flags); #endif /* H5O_ENABLE_BOGUS */ -H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); -H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, hid_t dxpl_id, H5O_hdr_info_t *hdr); -H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hid_t dxpl_id, hbool_t want_ih_info, +H5_DLL herr_t H5O_delete(H5F_t *f, haddr_t addr); +H5_DLL herr_t H5O_get_hdr_info(const H5O_loc_t *oloc, H5O_hdr_info_t *hdr); +H5_DLL herr_t H5O_get_info(const H5O_loc_t *oloc, hbool_t want_ih_info, H5O_info_t *oinfo); -H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id); -H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H5P_genplist_t *oc_plist); -H5_DLL hid_t H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); -H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks); -H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); +H5_DLL herr_t H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type); +H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, struct H5P_genplist_t *oc_plist); +H5_DLL hid_t H5O_open_name(const H5G_loc_t *loc, const char *name, hbool_t app_ref); +H5_DLL herr_t H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks); +H5_DLL void *H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc); H5_DLL haddr_t H5O_get_oh_addr(const H5O_t *oh); -H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, hid_t dxpl_id, unsigned *rc, H5O_type_t *otype); +H5_DLL herr_t H5O_get_rc_and_type(const H5O_loc_t *oloc, unsigned *rc, H5O_type_t *otype); H5_DLL H5AC_proxy_entry_t *H5O_get_proxy(const H5O_t *oh); -H5_DLL herr_t H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); /* Object header message routines */ H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, - unsigned update_flags, void *mesg, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, + unsigned update_flags, void *mesg); +H5_DLL herr_t H5O_msg_append_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg); H5_DLL herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id); -H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg); -H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, - hid_t dxpl_id); -H5_DLL void *H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - void *mesg); + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL herr_t H5O_msg_write_oh(H5F_t *f, H5O_t *oh, unsigned type_id, + unsigned mesg_flags, unsigned update_flags, void *mesg); +H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg); +H5_DLL void *H5O_msg_read_oh(H5F_t *f, H5O_t *oh, unsigned type_id, void *mesg); H5_DLL herr_t H5O_msg_reset(unsigned type_id, void *native); H5_DLL void *H5O_msg_free(unsigned type_id, void *mesg); H5_DLL void *H5O_msg_copy(unsigned type_id, const void *mesg, void *dst); -H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id); -H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id); +H5_DLL int H5O_msg_count(const H5O_loc_t *loc, unsigned type_id); +H5_DLL htri_t H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id); H5_DLL htri_t H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id); H5_DLL herr_t H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, - hbool_t adj_link, hid_t dxpl_id); + hbool_t adj_link); H5_DLL herr_t H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, - H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); + H5O_operator_t op, void *op_data, hbool_t adj_link); H5_DLL herr_t H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, - const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); + const H5O_mesg_operator_t *op, void *op_data); H5_DLL size_t H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const void *mesg); H5_DLL size_t H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, @@ -929,29 +926,28 @@ H5_DLL herr_t H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt_idx); H5_DLL herr_t H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char *buf, const void *obj); -H5_DLL void* H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, const unsigned char *buf); -H5_DLL herr_t H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, void *mesg); -H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id, uint8_t *flags); +H5_DLL void* H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, + const unsigned char *buf); +H5_DLL herr_t H5O_msg_delete(H5F_t *f, H5O_t *open_oh, unsigned type_id, + void *mesg); +H5_DLL herr_t H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags); /* Object metadata flush/refresh routines */ -H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata_close(hid_t oid, H5O_loc_t oloc, H5G_loc_t *obj_loc, hid_t dxpl_id); -H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_t start_swmr); +H5_DLL herr_t H5O_flush_common(H5O_loc_t *oloc, hid_t obj_id); +H5_DLL herr_t H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc); +H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hbool_t start_swmr); /* Object copying routines */ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, + H5O_copy_t *cpy_info, hbool_t inc_depth, H5O_type_t *obj_type, void **udata); -H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, +H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, H5F_t *file_dst, void *_dst_ref, size_t ref_count, H5R_type_t ref_type, H5O_copy_t *cpy_info); /* Debugging routines */ -H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, int indent, int fwidth); -H5_DLL herr_t H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, +H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidth); +H5_DLL herr_t H5O_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, int fwidth); /* These functions operate on object locations */ @@ -966,12 +962,11 @@ H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl); /* Fill value operators */ H5_DLL herr_t H5O_fill_reset_dyn(H5O_fill_t *fill); -H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed, hid_t dxpl_id); +H5_DLL herr_t H5O_fill_convert(H5O_fill_t *fill, H5T_t *type, hbool_t *fill_changed); H5_DLL herr_t H5O_fill_set_latest_version(H5O_fill_t *fill); /* Link operators */ -H5_DLL herr_t H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - void *_mesg); +H5_DLL herr_t H5O_link_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); /* Filter pipeline operators */ H5_DLL herr_t H5O_pline_set_latest_version(H5O_pline_t *pline); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index af68417..5b6cbb0 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -32,16 +32,16 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_refcount_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__refcount_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_refcount_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_refcount_copy(const void *_mesg, void *_dest); static size_t H5O_refcount_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_refcount_free(void *_mesg); +static herr_t H5O__refcount_free(void *_mesg); static herr_t H5O_refcount_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); -static herr_t H5O_refcount_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__refcount_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ @@ -49,12 +49,12 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ "refcount", /*message name for debugging */ sizeof(H5O_refcount_t), /*native message size */ 0, /* messages are sharable? */ - H5O_refcount_decode, /*decode message */ + H5O__refcount_decode, /*decode message */ H5O_refcount_encode, /*encode message */ H5O_refcount_copy, /*copy the native value */ H5O_refcount_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_refcount_free, /* free method */ + H5O__refcount_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -64,7 +64,7 @@ const H5O_msg_class_t H5O_MSG_REFCOUNT[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_refcount_debug /*debug the message */ + H5O__refcount_debug /*debug the message */ }}; /* Current version of ref. count information */ @@ -75,7 +75,7 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); /*------------------------------------------------------------------------- - * Function: H5O_refcount_decode + * Function: H5O__refcount_decode * * Purpose: Decode a message and return a pointer to a newly allocated one. * @@ -89,13 +89,13 @@ H5FL_DEFINE_STATIC(H5O_refcount_t); *------------------------------------------------------------------------- */ static void * -H5O_refcount_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__refcount_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -120,7 +120,7 @@ done: refcount = H5FL_FREE(H5O_refcount_t, refcount); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_refcount_decode() */ +} /* end H5O__refcount_decode() */ /*------------------------------------------------------------------------- @@ -231,9 +231,9 @@ H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_ /*------------------------------------------------------------------------- - * Function: H5O_refcount_free + * Function: H5O__refcount_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -243,16 +243,16 @@ H5O_refcount_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_ *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_free(void *mesg) +H5O__refcount_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_refcount_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_free() */ +} /* end H5O__refcount_free() */ /*------------------------------------------------------------------------- @@ -289,7 +289,7 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN /*------------------------------------------------------------------------- - * Function: H5O_refcount_debug + * Function: H5O__refcount_debug * * Purpose: Prints debugging info for a message. * @@ -302,12 +302,12 @@ H5O_refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UN *------------------------------------------------------------------------- */ static herr_t -H5O_refcount_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__refcount_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_refcount_t *refcount = (const H5O_refcount_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -320,5 +320,5 @@ H5O_refcount_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const "Number of links:", (unsigned)*refcount); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_refcount_debug() */ +} /* end H5O__refcount_debug() */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 3fe5652..22ab4fe 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -25,37 +25,37 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__sdspace_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); static void *H5O_sdspace_copy(const void *_mesg, void *_dest); static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg); -static herr_t H5O_sdspace_reset(void *_mesg); -static herr_t H5O_sdspace_free(void *_mesg); +static herr_t H5O__sdspace_reset(void *_mesg); +static herr_t H5O__sdspace_free(void *_mesg); static herr_t H5O_sdspace_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata); -static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, - FILE * stream, int indent, int fwidth); +static herr_t H5O__sdspace_debug(H5F_t *f, const void *_mesg, FILE * stream, + int indent, int fwidth); /* Set up & include shared message "interface" info */ #define H5O_SHARED_TYPE H5O_MSG_SDSPACE #define H5O_SHARED_DECODE H5O_sdspace_shared_decode -#define H5O_SHARED_DECODE_REAL H5O_sdspace_decode +#define H5O_SHARED_DECODE_REAL H5O__sdspace_decode #define H5O_SHARED_ENCODE H5O_sdspace_shared_encode #define H5O_SHARED_ENCODE_REAL H5O_sdspace_encode #define H5O_SHARED_SIZE H5O_sdspace_shared_size #define H5O_SHARED_SIZE_REAL H5O_sdspace_size -#define H5O_SHARED_DELETE H5O_sdspace_shared_delete +#define H5O_SHARED_DELETE H5O__sdspace_shared_delete #undef H5O_SHARED_DELETE_REAL -#define H5O_SHARED_LINK H5O_sdspace_shared_link +#define H5O_SHARED_LINK H5O__sdspace_shared_link #undef H5O_SHARED_LINK_REAL -#define H5O_SHARED_COPY_FILE H5O_sdspace_shared_copy_file +#define H5O_SHARED_COPY_FILE H5O__sdspace_shared_copy_file #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL #undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_sdspace_shared_debug -#define H5O_SHARED_DEBUG_REAL H5O_sdspace_debug +#define H5O_SHARED_DEBUG_REAL H5O__sdspace_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ /* This message derives from H5O message class */ @@ -68,14 +68,14 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{ H5O_sdspace_shared_encode, /* encode message */ H5O_sdspace_copy, /* copy the native value */ H5O_sdspace_shared_size, /* size of symbol table entry */ - H5O_sdspace_reset, /* default reset method */ - H5O_sdspace_free, /* free method */ - H5O_sdspace_shared_delete, /* file delete method */ - H5O_sdspace_shared_link, /* link method */ + H5O__sdspace_reset, /* default reset method */ + H5O__sdspace_free, /* free method */ + H5O__sdspace_shared_delete, /* file delete method */ + H5O__sdspace_shared_link, /* link method */ NULL, /* set share method */ NULL, /*can share method */ H5O_sdspace_pre_copy_file, /* pre copy native value to file */ - H5O_sdspace_shared_copy_file,/* copy native value to file */ + H5O__sdspace_shared_copy_file,/* copy native value to file */ H5O_sdspace_shared_post_copy_file,/* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ @@ -91,14 +91,13 @@ H5FL_ARR_EXTERN(hsize_t); /*-------------------------------------------------------------------------- NAME - H5O_sdspace_decode + H5O__sdspace_decode PURPOSE Decode a simple dimensionality message and return a pointer to a memory struct with the decoded information USAGE - void *H5O_sdspace_decode(f, dxpl_id, mesg_flags, p) + void *H5O__sdspace_decode(f, mesg_flags, p) H5F_t *f; IN: pointer to the HDF5 file struct - hid_t dxpl_id; IN: DXPL for any I/O unsigned mesg_flags; IN: Message flags to influence decoding const uint8 *p; IN: the raw information buffer RETURNS @@ -109,7 +108,7 @@ H5FL_ARR_EXTERN(hsize_t); within this function using malloc() and is returned to the caller. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5S_extent_t *sdim = NULL;/* New extent dimensionality structure */ @@ -117,7 +116,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED unsigned i; /* Local counting variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -194,7 +193,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_sdspace_decode() */ +} /* end H5O__sdspace_decode() */ /*-------------------------------------------------------------------------- @@ -372,7 +371,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) /*------------------------------------------------------------------------- - * Function: H5O_sdspace_reset + * Function: H5O__sdspace_reset * * Purpose: Frees the inside of a dataspace message and resets it to some * initial value. @@ -382,27 +381,25 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) * Programmer: Robb Matzke * Thursday, April 30, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_reset(void *_mesg) +H5O__sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR H5S_extent_release(mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__sdspace_reset() */ /*------------------------------------------------------------------------- - * Function: H5O_sdsdpace_free + * Function: H5O__sdsdpace_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -412,16 +409,16 @@ H5O_sdspace_reset(void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_sdspace_free(void *mesg) +H5O__sdspace_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5S_extent_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_free() */ +} /* end H5O__sdspace_free() */ /*------------------------------------------------------------------------- @@ -476,11 +473,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5O_sdspace_debug + H5O__sdspace_debug PURPOSE Prints debugging information for a simple dimensionality message USAGE - void *H5O_sdspace_debug(f, mesg, stream, indent, fwidth) + void *H5O__sdspace_debug(f, mesg, stream, indent, fwidth) H5F_t *f; IN: pointer to the HDF5 file struct const void *mesg; IN: Pointer to the source extent dimensionality struct FILE *stream; IN: Pointer to the stream for output data @@ -493,12 +490,12 @@ done: parameter. --------------------------------------------------------------------------*/ static herr_t -H5O_sdspace_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *mesg, - FILE * stream, int indent, int fwidth) +H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE * stream, + int indent, int fwidth) { const H5S_extent_t *sdim = (const H5S_extent_t *)mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -535,5 +532,5 @@ H5O_sdspace_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const v } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_sdspace_debug() */ +} /* end H5O__sdspace_debug() */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index db2d0cc..c1957b4 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -104,7 +104,7 @@ *------------------------------------------------------------------------- */ static void * -H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, +H5O_shared_read(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t *shared, const H5O_msg_class_t *type) { H5HF_t *fheap = NULL; @@ -132,15 +132,15 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, size_t mesg_size; /* Size of message */ /* Retrieve the fractal heap address for shared messages */ - if(H5SM_get_fheap_addr(f, dxpl_id, type->id, &fheap_addr) < 0) + if(H5SM_get_fheap_addr(f, type->id, &fheap_addr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get fheap address for shared messages") /* Open the fractal heap */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, fheap_addr))) + if(NULL == (fheap = H5HF_open(f, fheap_addr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open fractal heap") /* Get the size of the message in the heap */ - if(H5HF_get_obj_len(fheap, dxpl_id, &(shared->u.heap_id), &mesg_size) < 0) + if(H5HF_get_obj_len(fheap, &(shared->u.heap_id), &mesg_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "can't get message size from fractal heap.") /* Wrap the local buffer for serialized message */ @@ -152,11 +152,11 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") /* Retrieve the message from the heap */ - if(H5HF_read(fheap, dxpl_id, &(shared->u.heap_id), mesg_ptr) < 0) + if(H5HF_read(fheap, &(shared->u.heap_id), mesg_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "can't read message from fractal heap.") /* Decode the message */ - if(NULL == (ret_value = (type->decode)(f, dxpl_id, open_oh, 0, ioflags, mesg_ptr))) + if(NULL == (ret_value = (type->decode)(f, open_oh, 0, ioflags, mesg_ptr))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't decode shared message.") } /* end if */ else { @@ -174,11 +174,11 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, * is possible, for example, if an attribute's datatype is shared in * the same object header the attribute is in. Read the message * directly. */ - if(NULL == (ret_value = H5O_msg_read_oh(f, dxpl_id, open_oh, type->id, NULL))) + if(NULL == (ret_value = H5O_msg_read_oh(f, open_oh, type->id, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") } else /* The shared message is in another object header */ - if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL, dxpl_id))) + if(NULL == (ret_value = H5O_msg_read(&oloc, type->id, NULL))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read message") } /* end else */ @@ -188,7 +188,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "can't close fractal heap") if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") @@ -198,7 +198,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_shared_link_adj + * Function: H5O__shared_link_adj * * Purpose: Changes the link count for the object referenced by a shared * message. @@ -219,12 +219,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *shared, int adjust) +H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *shared, int adjust) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -262,15 +262,15 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * is possible, for example, if an attribute's datatype is shared in * the same object header the attribute is in. Adjust the link * count directly. */ - hbool_t deleted = FALSE; /* This is used only to satisfy H5O_link_oh */ + hbool_t deleted = FALSE; /* This is used only to satisfy H5O__link_oh */ - if(H5O_link_oh(f, adjust, dxpl_id, open_oh, &deleted) < 0) + if(H5O__link_oh(f, adjust, open_oh, &deleted) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") HDassert(!deleted); } else /* The shared message is in another object header */ - if(H5O_link(&oloc, adjust, dxpl_id) < 0) + if(H5O_link(&oloc, adjust) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") } /* end if */ else { @@ -278,19 +278,19 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Check for decrementing reference count on shared message */ if(adjust < 0) { - if(H5SM_delete(f, dxpl_id, open_oh, shared) < 0) + if(H5SM_delete(f, open_oh, shared) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to delete message from SOHM table") } /* end if */ /* Check for incrementing reference count on message */ else if(adjust > 0) { - if(H5SM_try_share(f, dxpl_id, open_oh, 0, type->id, shared, NULL) < 0) + if(H5SM_try_share(f, open_oh, 0, type->id, shared, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "error trying to share message") } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_link_adj() */ +} /* end H5O__shared_link_adj() */ /*------------------------------------------------------------------------- @@ -306,8 +306,8 @@ done: *------------------------------------------------------------------------- */ void * -H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, - const uint8_t *buf, const H5O_msg_class_t *type) +H5O_shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const uint8_t *buf, + const H5O_msg_class_t *type) { H5O_shared_t sh_mesg; /* Shared message info */ unsigned version; /* Shared message version */ @@ -373,7 +373,7 @@ H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, sh_mesg.msg_type_id = type->id; /* Retrieve actual message, through decoded shared message info */ - if(NULL == (ret_value = H5O_shared_read(f, dxpl_id, open_oh, ioflags, &sh_mesg, type))) + if(NULL == (ret_value = H5O_shared_read(f, open_oh, ioflags, &sh_mesg, type))) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to retrieve native message") done: @@ -496,7 +496,7 @@ H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) /*------------------------------------------------------------------------- - * Function: H5O_shared_delete + * Function: H5O__shared_delete * * Purpose: Free file space referenced by message * @@ -508,12 +508,12 @@ H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) *------------------------------------------------------------------------- */ herr_t -H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *sh_mesg) +H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *sh_mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -521,24 +521,24 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* * Committed datatypes increment the OH of the original message when they - * are written (in H5O_shared_link) and decrement it here. + * are written (in H5O__shared_link) and decrement it here. * SOHMs in the heap behave differently; their refcount is incremented * during H5SM_share when they are going to be written (in H5O_msg_append * or H5O_msg_write). Their refcount in the SOHM indexes still needs to - * be decremented when they're deleted (in H5O_shared_link_adj). + * be decremented when they're deleted (in H5O__shared_link_adj). */ /* Decrement the reference count on the shared object */ - if(H5O_shared_link_adj(f, dxpl_id, open_oh, type, sh_mesg, -1) < 0) + if(H5O__shared_link_adj(f, open_oh, type, sh_mesg, -1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_delete() */ +} /* end H5O__shared_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_link + * Function: H5O__shared_link * * Purpose: Increment reference count on any objects referenced by * message @@ -551,28 +551,28 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - const H5O_msg_class_t *type, H5O_shared_t *sh_mesg) +H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, + H5O_shared_t *sh_mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); HDassert(sh_mesg); /* Increment the reference count on the shared object */ - if(H5O_shared_link_adj(f, dxpl_id, open_oh, type, sh_mesg, 1) < 0) + if(H5O__shared_link_adj(f, open_oh, type, sh_mesg, 1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_link() */ +} /* end H5O__shared_link() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_copy_file + * Function: H5O__shared_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -585,16 +585,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, +H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void H5_ATTR_UNUSED *udata, hid_t dxpl_id) + void H5_ATTR_UNUSED *udata) { const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */ H5O_shared_t *shared_dst = (H5O_shared_t *)_native_dst; /* Alias to shared info in native destination message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(file_src); @@ -617,13 +617,13 @@ H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, if(shared_src->type != H5O_SHARE_TYPE_COMMITTED) { /* Simulate trying to share new message in the destination file. */ /* Set copied metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, FAIL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) + if(H5SM_try_share(file_dst, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) HGOTO_ERROR_TAG(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to determine if message should be shared") /* Reset metadata tag */ - H5_END_TAG(FAIL); + H5_END_TAG } /* end if */ else { /* Mark the message as committed - as it will be committed in post copy @@ -634,11 +634,11 @@ H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_shared_copy_file() */ +} /* H5O__shared_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_shared_post_copy_file + * Function: H5O__shared_post_copy_file * * Purpose: Delate a shared message and replace with a new one. * The function is needed at cases such as coping a shared reg_ref attribute. @@ -656,13 +656,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, +H5O__shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) + unsigned *mesg_flags, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -679,8 +679,7 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, dst_oloc.file = f; src_oloc.file = shared_src->file; src_oloc.addr = shared_src->u.loc.oh_addr; - if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE, - NULL, NULL) < 0) + if(H5O_copy_header_map(&src_oloc, &dst_oloc, cpy_info, FALSE, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Set up destination message's shared info */ @@ -688,13 +687,12 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, } /* end if */ else /* Share the message */ - if(H5SM_try_share(f, dxpl_id, NULL, H5SM_WAS_DEFERRED, mesg_type->id, - shared_dst, mesg_flags) < 0) + if(H5SM_try_share(f, NULL, H5SM_WAS_DEFERRED, mesg_type->id, shared_dst, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "can't share message") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shared_post_copy_file() */ +} /* end H5O__shared_post_copy_file() */ /*------------------------------------------------------------------------- diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 2465e65..fdde3dc 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -46,7 +46,7 @@ *------------------------------------------------------------------------- */ static H5_INLINE void * -H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, +H5O_SHARED_DECODE(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, const uint8_t *p) { void *ret_value = NULL; /* Return value */ @@ -66,7 +66,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, /* Check for shared message */ if(mesg_flags & H5O_MSG_FLAG_SHARED) { /* Retrieve native message info indirectly through shared message */ - if(NULL == (ret_value = H5O_shared_decode(f, dxpl_id, open_oh, ioflags, p, H5O_SHARED_TYPE))) + if(NULL == (ret_value = H5O_shared_decode(f, open_oh, ioflags, p, H5O_SHARED_TYPE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode shared message") /* We currently do not support automatically fixing shared messages */ @@ -79,7 +79,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, } /* end if */ else { /* Decode native message directly */ - if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, dxpl_id, open_oh, mesg_flags, ioflags, p))) + if(NULL == (ret_value = H5O_SHARED_DECODE_REAL(f, open_oh, mesg_flags, ioflags, p))) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "unable to decode native message") } /* end else */ @@ -214,12 +214,12 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O_SHARED_DELETE(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -231,13 +231,13 @@ H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Check for message tracked elsewhere */ if(H5O_IS_TRACKED_SHARED(sh_mesg->type)) { /* Decrement the reference count on the shared message/object */ - if(H5O_shared_delete(f, dxpl_id, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) + if(H5O__shared_delete(f, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for shared message") } /* end if */ #ifdef H5O_SHARED_DELETE_REAL else { /* Decrement the reference count on the native message directly */ - if(H5O_SHARED_DELETE_REAL(f, dxpl_id, open_oh, _mesg) < 0) + if(H5O_SHARED_DELETE_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for native message") } /* end else */ #endif /* H5O_SHARED_DELETE_REAL */ @@ -266,12 +266,12 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) +H5O_SHARED_LINK(H5F_t *f, H5O_t *open_oh, void *_mesg) { H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -283,13 +283,13 @@ H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* Check for message tracked elsewhere */ if(H5O_IS_TRACKED_SHARED(sh_mesg->type)) { /* Increment the reference count on the shared message/object */ - if(H5O_shared_link(f, dxpl_id, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) + if(H5O__shared_link(f, open_oh, H5O_SHARED_TYPE, sh_mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for shared message") } /* end if */ #ifdef H5O_SHARED_LINK_REAL else { /* Increment the reference count on the native message directly */ - if(H5O_SHARED_LINK_REAL(f, dxpl_id, open_oh, _mesg) < 0) + if(H5O_SHARED_LINK_REAL(f, open_oh, _mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "unable to increment ref count for native message") } /* end else */ #endif /* H5O_SHARED_LINK_REAL */ @@ -319,12 +319,12 @@ done: static H5_INLINE void * H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id) + void *udata) { void *dst_mesg = NULL; /* Destination message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -335,7 +335,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, #ifdef H5O_SHARED_COPY_FILE_REAL /* Call native message's copy file callback to copy the message */ - if(NULL == (dst_mesg = H5O_SHARED_COPY_FILE_REAL(file_src, H5O_SHARED_TYPE, _native_src, file_dst, recompute_size, cpy_info, udata, dxpl_id))) + if(NULL == (dst_mesg = H5O_SHARED_COPY_FILE_REAL(file_src, H5O_SHARED_TYPE, _native_src, file_dst, recompute_size, cpy_info, udata))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy native message to another file") #else /* H5O_SHARED_COPY_FILE_REAL */ /* No copy file callback defined, just copy the message itself */ @@ -347,8 +347,8 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, HDmemset(dst_mesg, 0, sizeof(H5O_shared_t)); /* Handle sharing destination message */ - if(H5O_shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, _native_src, - dst_mesg, recompute_size, mesg_flags, cpy_info, udata, dxpl_id) < 0) + if(H5O__shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, _native_src, + dst_mesg, recompute_size, mesg_flags, cpy_info, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "unable to determine if message should be shared") /* Set return value */ @@ -382,7 +382,7 @@ done: */ static H5_INLINE herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, - H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, hid_t dxpl_id, + H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info) { const H5O_shared_t *shared_src = (const H5O_shared_t *)mesg_src; /* Alias to shared info in native source */ @@ -406,21 +406,21 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, #ifdef H5O_SHARED_POST_COPY_FILE_REAL /* Call native message's post copy file callback to copy the message */ - if(H5O_SHARED_POST_COPY_FILE_REAL(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) <0 ) + if(H5O_SHARED_POST_COPY_FILE_REAL(oloc_src, mesg_src, oloc_dst, mesg_dst, cpy_info) <0 ) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy native message to another file") #endif /* H5O_SHARED_POST_COPY_FILE_REAL */ /* Update shared message after the post copy - will short circuit in * production if the DEFER pass determined it will not be shared; debug mode * verifies that it is indeed the case */ - if(H5O_shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, - shared_src, shared_dst, mesg_flags, dxpl_id, cpy_info) < 0) + if(H5O__shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, + shared_src, shared_dst, mesg_flags, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy") #ifdef H5O_SHARED_POST_COPY_FILE_UPD /* Call native message's post copy file update callback to update the * message */ - if(H5O_SHARED_POST_COPY_FILE_UPD(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) < 0) + if(H5O_SHARED_POST_COPY_FILE_UPD(oloc_src, mesg_src, oloc_dst, mesg_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to update native message") #endif /* H5O_SHARED_POST_COPY_FILE_UPD */ @@ -452,8 +452,8 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_DEBUG(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) +H5O_SHARED_DEBUG(H5F_t *f, const void *_mesg, FILE *stream, int indent, + int fwidth) { const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ @@ -478,7 +478,7 @@ H5O_SHARED_DEBUG(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, } /* end if */ /* Call native message's debug callback */ - if(H5O_SHARED_DEBUG_REAL(f, dxpl_id, _mesg, stream, indent, fwidth) < 0) + if(H5O_SHARED_DEBUG_REAL(f, _mesg, stream, indent, fwidth) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display native message info") done: diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 1cbfb05..2a3cdc3 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -27,13 +27,13 @@ #include "H5Opkg.h" /* Object headers */ #include "H5MMprivate.h" /* Memory management */ -static void *H5O_shmesg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__shmesg_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_shmesg_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_shmesg_copy(const void *_mesg, void *_dest); static size_t H5O_shmesg_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_shmesg_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); +static herr_t H5O__shmesg_debug(H5F_t *f, const void *_mesg, FILE *stream, + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ @@ -41,7 +41,7 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ "shared message table", /*message name for debugging */ sizeof(H5O_shmesg_table_t), /*native message size */ 0, /* messages are sharable? */ - H5O_shmesg_decode, /*decode message */ + H5O__shmesg_decode, /*decode message */ H5O_shmesg_encode, /*encode message */ H5O_shmesg_copy, /*copy the native value */ H5O_shmesg_size, /*raw message size */ @@ -56,12 +56,12 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ NULL, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_shmesg_debug /*debug the message */ + H5O__shmesg_debug /*debug the message */ }}; /*------------------------------------------------------------------------- - * Function: H5O_shmesg_decode + * Function: H5O__shmesg_decode * * Purpose: Decode a shared message table message and return a pointer * to a newly allocated H5O_shmesg_table_t struct. @@ -75,13 +75,13 @@ const H5O_msg_class_t H5O_MSG_SHMESG[1] = {{ *------------------------------------------------------------------------- */ static void * -H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__shmesg_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -100,7 +100,7 @@ H5O_shmesg_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED * done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_shmesg_decode() */ +} /* end H5O__shmesg_decode() */ /*------------------------------------------------------------------------- @@ -209,7 +209,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi /*------------------------------------------------------------------------- - * Function: H5O_shmesg_debug + * Function: H5O__shmesg_debug * * Purpose: Prints debugging info for the message. * @@ -221,12 +221,12 @@ H5O_shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const voi *------------------------------------------------------------------------- */ static herr_t -H5O_shmesg_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, +H5O__shmesg_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(f); @@ -243,5 +243,5 @@ H5O_shmesg_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const vo "Number of indexes:", mesg->nindexes); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_shmesg_debug() */ +} /* end H5O__shmesg_debug() */ diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 5c840a6..944a722 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -35,20 +35,20 @@ /* PRIVATE PROTOTYPES */ -static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned mesg_flags, unsigned *ioflags, const uint8_t *p); +static void *H5O__stab_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, + unsigned *ioflags, const uint8_t *p); static herr_t H5O_stab_encode(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mesg); static void *H5O_stab_copy(const void *_mesg, void *_dest); static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); -static herr_t H5O_stab_free(void *_mesg); -static herr_t H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); -static void *H5O_stab_copy_file(H5F_t *file_src, void *native_src, +static herr_t H5O__stab_free(void *_mesg); +static herr_t H5O__stab_delete(H5F_t *f, H5O_t *open_oh, void *_mesg); +static void *H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, - H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id); -static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, + H5O_copy_t *cpy_info, void *_udata); +static herr_t H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, - unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); -static herr_t H5O_stab_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, + unsigned *mesg_flags, H5O_copy_t *cpy_info); +static herr_t H5O__stab_debug(H5F_t *f, const void *_mesg, FILE * stream, int indent, int fwidth); /* This message derives from H5O message class */ @@ -57,22 +57,22 @@ const H5O_msg_class_t H5O_MSG_STAB[1] = {{ "stab", /*message name for debugging */ sizeof(H5O_stab_t), /*native message size */ 0, /* messages are sharable? */ - H5O_stab_decode, /*decode message */ + H5O__stab_decode, /*decode message */ H5O_stab_encode, /*encode message */ H5O_stab_copy, /*copy the native value */ H5O_stab_size, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_stab_free, /* free method */ - H5O_stab_delete, /* file delete method */ + H5O__stab_free, /* free method */ + H5O__stab_delete, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ NULL, /*can share method */ NULL, /* pre copy native value to file */ - H5O_stab_copy_file, /* copy native value to file */ - H5O_stab_post_copy_file, /* post copy native value to file */ + H5O__stab_copy_file, /* copy native value to file */ + H5O__stab_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ - H5O_stab_debug /*debug the message */ + H5O__stab_debug /*debug the message */ }}; /* Declare a free list to manage the H5O_stab_t struct */ @@ -80,7 +80,7 @@ H5FL_DEFINE_STATIC(H5O_stab_t); /*------------------------------------------------------------------------- - * Function: H5O_stab_decode + * Function: H5O__stab_decode * * Purpose: Decode a symbol table message and return a pointer to * a newly allocated one. @@ -96,7 +96,7 @@ H5FL_DEFINE_STATIC(H5O_stab_t); *------------------------------------------------------------------------- */ static void * -H5O_stab_decode(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, +H5O__stab_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, unsigned H5_ATTR_UNUSED *ioflags, const uint8_t *p) { H5O_stab_t *stab = NULL; @@ -124,7 +124,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_stab_decode() */ +} /* end H5O__stab_decode() */ /*------------------------------------------------------------------------- @@ -229,38 +229,36 @@ H5O_stab_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void ret_value = (size_t)(2 * H5F_SIZEOF_ADDR(f)); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5O_stab_size() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_free + * Function: H5O__stab_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Thursday, March 30, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t -H5O_stab_free(void *mesg) +H5O__stab_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_stab_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_stab_free() */ +} /* end H5O__stab_free() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_delete + * Function: H5O__stab_delete * * Purpose: Free file space referenced by message * @@ -272,27 +270,27 @@ H5O_stab_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) +H5O__stab_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); HDassert(mesg); /* Free the file space for the symbol table */ - if(H5G__stab_delete(f, dxpl_id, (const H5O_stab_t *)mesg) < 0) + if(H5G__stab_delete(f, (const H5O_stab_t *)mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free symbol table") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_stab_delete() */ +} /* end H5O__stab_delete() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_copy_file + * Function: H5O__stab_copy_file * * Purpose: Copies a message from _MESG to _DEST in file * @@ -306,9 +304,9 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, +H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata, hid_t dxpl_id) + H5O_copy_t H5_ATTR_UNUSED *cpy_info, void *_udata) { H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; @@ -316,7 +314,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, size_t size_hint; /* Local heap initial size */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(stab_src); @@ -327,18 +325,18 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Get the old local heap's size and use that as the hint for the new heap */ - if(H5HL_get_size(file_src, dxpl_id, stab_src->heap_addr, &size_hint) < 0) + if(H5HL_get_size(file_src, stab_src->heap_addr, &size_hint) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, NULL, "can't query local heap size") /* Set copy metadata tag */ - H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); + H5_BEGIN_TAG(H5AC__COPIED_TAG); /* Create components of symbol table message */ - if(H5G__stab_create_components(file_dst, stab_dst, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(file_dst, stab_dst, size_hint) < 0) HGOTO_ERROR_TAG(H5E_SYM, H5E_CANTINIT, NULL, "can't create symbol table components") /* Reset metadata tag */ - H5_END_TAG(NULL); + H5_END_TAG /* Cache stab in udata */ udata->cache_type = H5G_CACHED_STAB; @@ -354,11 +352,11 @@ done: stab_dst = H5FL_FREE(H5O_stab_t, stab_dst); FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_stab_copy_file() */ +} /* H5O__stab_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_post_copy_file + * Function: H5O__stab_post_copy_file * * Purpose: Finish copying a message from between files * @@ -370,16 +368,16 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, +H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, unsigned H5_ATTR_UNUSED *mesg_flags, - hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_copy_t *cpy_info) { const H5O_stab_t *stab_src = (const H5O_stab_t *)mesg_src; H5O_stab_t *stab_dst = (H5O_stab_t *)mesg_dst; H5G_bt_it_cpy_t udata; /* B-tree user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(stab_src); @@ -400,16 +398,16 @@ H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, udata.cpy_info = cpy_info; /* Iterate over objects in group, copying them */ - if((H5B_iterate(src_oloc->file, dxpl_id, H5B_SNODE, stab_src->btree_addr, H5G__node_copy, &udata)) < 0) + if((H5B_iterate(src_oloc->file, H5B_SNODE, stab_src->btree_addr, H5G__node_copy, &udata)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_stab_post_copy_file() */ +} /* H5O__stab_post_copy_file() */ /*------------------------------------------------------------------------- - * Function: H5O_stab_debug + * Function: H5O__stab_debug * * Purpose: Prints debugging info for a symbol table message. * @@ -424,12 +422,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE * stream, - int indent, int fwidth) +H5O__stab_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE * stream, + int indent, int fwidth) { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(f); @@ -445,5 +443,5 @@ H5O_stab_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void "Name heap address:", stab->heap_addr); FUNC_LEAVE_NOAPI(SUCCEED) -} +} /* end H5O__stab_debug() */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 68462a1..c978d10 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -32,6 +32,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ @@ -97,6 +98,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_t *oh = NULL; /* Object header */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -105,15 +107,20 @@ H5O_is_attr_dense_test(hid_t oid) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -128,8 +135,10 @@ H5O_is_attr_dense_test(hid_t oid) ret_value = FALSE; done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_dense_test() */ @@ -162,6 +171,7 @@ H5O_is_attr_empty_test(hid_t oid) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t nattrs; /* Number of attributes */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -170,14 +180,19 @@ H5O_is_attr_empty_test(hid_t oid) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if((ainfo_exists = H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo)) < 0) + if((ainfo_exists = H5A__get_ainfo(loc->file, oh, &ainfo)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -192,15 +207,15 @@ H5O_is_attr_empty_test(hid_t oid) /* Check for any messages in object header */ HDassert(nattrs == 0); - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Retrieve # of records in name index */ if(H5B2_get_nrec(bt2_name, &nattrs) < 0) @@ -219,10 +234,12 @@ H5O_is_attr_empty_test(hid_t oid) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_is_attr_empty_test() */ @@ -255,6 +272,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ hsize_t obj_nattrs; /* Number of attributes */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -263,15 +281,20 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ @@ -285,15 +308,15 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) /* Check for any messages in object header */ HDassert(obj_nattrs == 0); - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG /* Retrieve # of records in name index */ if(H5B2_get_nrec(bt2_name, &obj_nattrs) < 0) @@ -309,10 +332,12 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_num_attrs_test() */ @@ -347,6 +372,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ H5O_ainfo_t ainfo; /* Attribute information for object */ H5O_loc_t *loc; /* Pointer to object's location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -355,29 +381,34 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") - /* Set metadata tag in dxpl_id */ - H5_BEGIN_TAG(H5AC_ind_read_dxpl_id, loc->addr, FAIL); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set metadata tag in API context */ + H5_BEGIN_TAG(loc->addr); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Check for attribute info stored */ ainfo.fheap_addr = HADDR_UNDEF; if(oh->version > H5O_VERSION_1) { /* Check for (& retrieve if available) attribute info */ - if(H5A_get_ainfo(loc->file, H5AC_ind_read_dxpl_id, oh, &ainfo) < 0) + if(H5A__get_ainfo(loc->file, oh, &ainfo) < 0) HGOTO_ERROR_TAG(H5E_ATTR, H5E_CANTGET, FAIL, "can't check for attribute info message") } /* end if */ /* Check for 'dense' attribute storage file addresses being defined */ if(!H5F_addr_defined(ainfo.fheap_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) if(!H5F_addr_defined(ainfo.name_bt2_addr)) - HGOTO_DONE_TAG(FAIL, FAIL) + HGOTO_DONE_TAG(FAIL) /* Open the name index v2 B-tree */ - if(NULL == (bt2_name = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.name_bt2_addr, NULL))) + if(NULL == (bt2_name = H5B2_open(loc->file, ainfo.name_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for name index") /* Retrieve # of records in name index */ @@ -387,7 +418,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) /* Check if there is a creation order index */ if(H5F_addr_defined(ainfo.corder_bt2_addr)) { /* Open the creation order index v2 B-tree */ - if(NULL == (bt2_corder = H5B2_open(loc->file, H5AC_ind_read_dxpl_id, ainfo.corder_bt2_addr, NULL))) + if(NULL == (bt2_corder = H5B2_open(loc->file, ainfo.corder_bt2_addr, NULL))) HGOTO_ERROR_TAG(H5E_OHDR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Retrieve # of records in creation order index */ @@ -397,17 +428,19 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); + /* Reset metadata tag in API context */ + H5_END_TAG done: /* Release resources */ - if(bt2_name && H5B2_close(bt2_name, H5AC_ind_read_dxpl_id) < 0) + if(bt2_name && H5B2_close(bt2_name) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for name index") - if(bt2_corder && H5B2_close(bt2_corder, H5AC_ind_read_dxpl_id) < 0) + if(bt2_corder && H5B2_close(bt2_corder) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_attr_dense_info_test() */ @@ -450,7 +483,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate "unknown" message */ @@ -469,7 +502,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "'unknown' message type not found") done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -482,9 +515,7 @@ done: PURPOSE Expunge all the chunks for an object header from the cache. USAGE - herr_t H5O_expunge_chunks_test(f, dxpl_id, loc) - H5F_t *f; IN: Pointer to file that object is within - hid_t dxpl_id; IN: DXPL to use for operation + herr_t H5O_expunge_chunks_test(loc) H5O_loc_t *loc; IN: Object location for object header to expunge RETURNS Non-negative on success, negative on failure @@ -498,7 +529,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) +H5O_expunge_chunks_test(const H5O_loc_t *loc) { H5O_t *oh = NULL; /* Object header */ haddr_t chk_addr[16]; /* Array of chunk addresses */ @@ -509,7 +540,7 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Safety check */ @@ -521,13 +552,13 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) chk_addr[u] = oh->chunk[u].addr; /* Release the object header */ - if(H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header") /* Iterate over all the saved chunk addresses, evicting them from the cache */ /* (in reverse order, so that chunk #0 is unpinned) */ for(u = nchunks - 1; u < nchunks; u--) - if(H5AC_expunge_entry(loc->file, dxpl_id, (u == 0 ? H5AC_OHDR : H5AC_OHDR_CHK), chk_addr[u], H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(loc->file, (u == 0 ? H5AC_OHDR : H5AC_OHDR_CHK), chk_addr[u], H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTEXPUNGE, FAIL, "unable to expunge object header chunk") done: @@ -541,9 +572,8 @@ done: PURPOSE Retrieve the refcount for the object header USAGE - herr_t H5O_expunge_chunks_test(loc, dxpl_id, rc) + herr_t H5O_expunge_chunks_test(loc, rc) const H5O_loc_t *loc; IN: Object location for object header to query - hid_t dxpl_id; IN: DXPL to use for operation unsigned *rc; OUT: Pointer to refcount for object header RETURNS Non-negative on success, negative on failure @@ -557,7 +587,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) +H5O_get_rc(const H5O_loc_t *loc, unsigned *rc) { H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ @@ -569,7 +599,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) HDassert(rc); /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header") /* Save the refcount for the object header */ @@ -577,7 +607,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) done: /* Release the object header */ - if(oh && H5O_unprotect(loc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header") FUNC_LEAVE_NOAPI(ret_value) @@ -612,6 +642,7 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *idx_msg; /* Pointer to message */ unsigned idx; /* Index of message */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -620,8 +651,13 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate first message of given type */ @@ -639,8 +675,10 @@ H5O_msg_get_chunkno_test(hid_t oid, unsigned msg_type, unsigned *chunk_num) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "message of type not found") done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ @@ -672,6 +710,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) H5O_loc_t *loc; /* Pointer to object's location */ H5O_mesg_t *curr_msg; /* Pointer to current message */ unsigned idx; /* Index of message */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -680,8 +719,13 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) if(NULL == (loc = H5O_get_loc(oid))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "object not found") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object header */ - if(NULL == (oh = H5O_protect(loc, H5AC_ind_read_dxpl_id, H5AC__NO_FLAGS_SET, FALSE))) + if(NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") /* Locate first message of given type */ @@ -731,7 +775,7 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) /* Allocate and initialize new chunk in the file, moving the found message */ /* (*new_idx returned from this routine is unused here) */ - if(H5O__alloc_chunk(loc->file, H5AC_ind_read_dxpl_id, oh, (curr_msg->raw_size + H5O_SIZEOF_MSGHDR_OH(oh)), oh->nmesgs, &found_msg, &new_idx) < 0) + if(H5O__alloc_chunk(loc->file, oh, (curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)), oh->nmesgs, &found_msg, &new_idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "can't allocate new object header chunk") /* Break out of loop, the message was found */ @@ -739,8 +783,10 @@ H5O_msg_move_to_new_chunk_test(hid_t oid, unsigned msg_type) } /* end if */ done: - if(oh && H5O_unprotect(loc, H5AC_ind_read_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(loc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* H5O_msg_get_chunkno_test() */ diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 1b3a997..dbab28c 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -32,7 +32,7 @@ /* PRIVATE PROTOTYPES */ -static herr_t H5O_unknown_free(void *_mesg); +static herr_t H5O__unknown_free(void *_mesg); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ @@ -45,7 +45,7 @@ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ NULL, /*copy the native value */ NULL, /*size of symbol table entry */ NULL, /*default reset method */ - H5O_unknown_free, /* free method */ + H5O__unknown_free, /* free method */ NULL, /* file delete method */ NULL, /* link method */ NULL, /*set share method */ @@ -63,9 +63,9 @@ H5FL_DEFINE(H5O_unknown_t); /*------------------------------------------------------------------------- - * Function: H5O_unknown_free + * Function: H5O__unknown_free * - * Purpose: Free's the message + * Purpose: Frees the message * * Return: Non-negative on success/Negative on failure * @@ -75,14 +75,14 @@ H5FL_DEFINE(H5O_unknown_t); *------------------------------------------------------------------------- */ static herr_t -H5O_unknown_free(void *mesg) +H5O__unknown_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(mesg); mesg = H5FL_FREE(H5O_unknown_t, mesg); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_unknown_free() */ +} /* end H5O__unknown_free() */ diff --git a/src/H5P.c b/src/H5P.c index 49bea0a..9243d41 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ @@ -96,6 +97,7 @@ hid_t H5Pcopy(hid_t id) { void *obj; /* Property object to copy */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value=FALSE; /* return value */ FUNC_ENTER_API(FAIL) @@ -109,6 +111,10 @@ H5Pcopy(hid_t id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not property object"); if(NULL == (obj = H5I_object(id))) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, FAIL, "property object doesn't exist"); +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Compare property lists */ if(H5I_GENPROP_LST == H5I_get_type(id)) { @@ -131,6 +137,8 @@ H5Pcopy(hid_t id) } /* end else */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pcopy() */ @@ -1501,6 +1509,7 @@ done: herr_t H5Pclose(hid_t plist_id) { +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -1511,6 +1520,10 @@ H5Pclose(hid_t plist_id) /* Check arguments. */ if(H5I_GENPROP_LST != H5I_get_type(plist_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Close the property list */ if(H5I_dec_app_ref(plist_id) < 0) @@ -1518,6 +1531,8 @@ H5Pclose(hid_t plist_id) } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* H5Pclose() */ diff --git a/src/H5PB.c b/src/H5PB.c index 63e5e7a..dab69f4 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -123,8 +123,8 @@ typedef struct { /* Local Prototypes */ /********************/ static herr_t H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry); -static htri_t H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, H5FD_mem_t inserted_type); -static herr_t H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry); +static htri_t H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type); +static herr_t H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry); /*********************/ @@ -369,18 +369,18 @@ static herr_t H5PB__flush_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) { H5PB_entry_t *page_entry = (H5PB_entry_t *)item; /* Pointer to page entry node */ - const H5F_io_info2_t *fio_info = (const H5F_io_info2_t *)_op_data; + H5F_t *f = (H5F_t *)_op_data; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC /* Sanity checks */ HDassert(page_entry); - HDassert(fio_info); + HDassert(f); /* Flush the page if it's dirty */ if(page_entry->is_dirty) - if(H5PB__write_entry(fio_info, page_entry) < 0) + if(H5PB__write_entry(f, page_entry) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") done: @@ -400,24 +400,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_flush(const H5F_io_info2_t *fio_info) +H5PB_flush(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(fio_info); - HDassert(fio_info->f); - HDassert(fio_info->meta_dxpl); - HDassert(fio_info->raw_dxpl); + HDassert(f); /* Flush all the entries in the PB skiplist, if we have write access on the file */ - if(fio_info->f->shared->page_buf && (H5F_ACC_RDWR & H5F_INTENT(fio_info->f))) { - H5PB_t *page_buf = fio_info->f->shared->page_buf; + if(f->shared->page_buf && (H5F_ACC_RDWR & H5F_INTENT(f))) { + H5PB_t *page_buf = f->shared->page_buf; /* Iterate over all entries in page buffer skip list */ - if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, (void *)fio_info)) + if(H5SL_iterate(page_buf->slist_ptr, H5PB__flush_cb, (void *)f)) HGOTO_ERROR(H5E_PAGEBUF, H5E_BADITER, FAIL, "can't flush page buffer skip list") } /* end if */ @@ -475,16 +472,13 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5PB_dest(const H5F_io_info2_t *fio_info) +H5PB_dest(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - H5F_t *f; /* file pointer */ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); - f = fio_info->f; HDassert(f); /* flush and destroy the page buffer, if it exists */ @@ -492,7 +486,7 @@ H5PB_dest(const H5F_io_info2_t *fio_info) H5PB_t *page_buf = f->shared->page_buf; H5PB_ud1_t op_data; /* Iteration context */ - if(H5PB_flush(fio_info)<0) + if(H5PB_flush(f) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer") /* Set up context info */ @@ -512,10 +506,6 @@ H5PB_dest(const H5F_io_info2_t *fio_info) if(H5FL_fac_term(page_buf->page_fac) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTRELEASE, FAIL, "can't destroy page buffer page factory") -#ifdef QAK -H5PB_print_stats(page_buf); -#endif /* QAK */ - f->shared->page_buf = H5FL_FREE(H5PB_t, page_buf); } /* end if */ @@ -693,12 +683,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, - size_t size, void *buf/*out*/) +H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/) { H5PB_t *page_buf; /* Page buffering info for this file */ H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ haddr_t first_page_addr, last_page_addr; /* Addresses of the first and last pages covered by I/O */ haddr_t offset; haddr_t search_addr; /* Address of current page */ @@ -711,20 +700,21 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); + HDassert(f); + HDassert(type != H5FD_MEM_GHEAP); /* Get pointer to page buffer info for this file */ - page_buf = fio_info->f->shared->page_buf; + page_buf = f->shared->page_buf; #ifdef H5_HAVE_PARALLEL - if(H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) { + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { #if 1 bypass_pb = TRUE; #else /* MSC - why this stopped working ? */ int mpi_size; - if((mpi_size = H5F_mpi_get_size(fio_info->f)) < 0) + if((mpi_size = H5F_mpi_get_size(f)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") if(1 != mpi_size) bypass_pb = TRUE; @@ -738,12 +728,12 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, */ if(NULL == page_buf || size >= page_buf->page_size || (bypass_pb && H5FD_MEM_DRAW == type)) { - if(H5F__accum_read(fio_info, type, addr, size, buf) < 0) + if(H5F__accum_read(f, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "read through metadata accumulator failed") /* Update statistics */ if(page_buf) { - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->bypasses[1] ++; else page_buf->bypasses[0] ++; @@ -759,7 +749,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, /* Update statistics */ if(page_buf) { - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->accesses[1]++; else page_buf->accesses[0]++; @@ -789,9 +779,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end else */ /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Copy raw data from dirty pages into the read buffer if the read request spans pages in the page buffer*/ @@ -890,7 +878,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, H5PB__MOVE_TO_TOP_LRU(page_buf, page_entry) /* Update statistics */ - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->hits[1]++; else page_buf->hits[0]++; @@ -906,7 +894,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, htri_t can_make_space; /* check if we can make space in page buffer */ - if((can_make_space = H5PB__make_space(fio_info, page_buf, type)) < 0) + if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed") /* if make_space returns 0, then we can't use the page @@ -916,7 +904,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HDassert(0 == i); /* read entire block from VFD and return */ - if(H5FD_read(&fdio_info, type, addr, size, buf) < 0) + if(H5FD_read(file, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Break out of loop */ @@ -931,7 +919,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, /* Read page through the VFD layer, but make sure we don't read past the EOA. */ /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the entire page falls outside the EOA, then fail */ @@ -943,7 +931,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_size = (size_t)(eoa - search_addr); /* Read page from VFD */ - if(H5FD_read(&fdio_info, type, search_addr, page_size, new_page_buf) < 0) + if(H5FD_read(file, type, search_addr, page_size, new_page_buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Copy the requested data from the page into the input buffer */ @@ -965,7 +953,7 @@ H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTSET, FAIL, "error inserting new page in page buffer") /* Update statistics */ - if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) + if(type == H5FD_MEM_DRAW) page_buf->misses[1]++; else page_buf->misses[0]++; @@ -992,12 +980,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, +H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { H5PB_t *page_buf; /* Page buffering info for this file */ H5PB_entry_t *page_entry; /* Pointer to the corresponding page entry */ - H5FD_io_info_t fdio_info; /* File driver I/O info */ + H5FD_t *file; /* File driver pointer */ haddr_t first_page_addr, last_page_addr; /* Addresses of the first and last pages covered by I/O */ haddr_t offset; haddr_t search_addr; /* Address of current page */ @@ -1010,21 +998,20 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(fio_info); - HDassert(fio_info->f); + HDassert(f); /* Get pointer to page buffer info for this file */ - page_buf = fio_info->f->shared->page_buf; + page_buf = f->shared->page_buf; #ifdef H5_HAVE_PARALLEL - if(H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) { + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { #if 1 bypass_pb = TRUE; #else /* MSC - why this stopped working ? */ int mpi_size; - if((mpi_size = H5F_mpi_get_size(fio_info->f)) < 0) + if((mpi_size = H5F_mpi_get_size(f)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "can't retrieve MPI communicator size") if(1 != mpi_size) bypass_pb = TRUE; @@ -1037,7 +1024,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, * buffering. */ if(NULL == page_buf || size >= page_buf->page_size || bypass_pb) { - if(H5F__accum_write(fio_info, type, addr, size, buf) < 0) + if(H5F__accum_write(f, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "write through metadata accumulator failed") /* Update statistics */ @@ -1096,9 +1083,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end else */ /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; /* Check if existing pages for raw data need to be updated since raw data access is not atomic */ if(H5FD_MEM_DRAW == type && size >= page_buf->page_size) { @@ -1210,7 +1195,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, htri_t can_make_space; /* Check if we can make space in page buffer */ - if((can_make_space = H5PB__make_space(fio_info, page_buf, type)) < 0) + if((can_make_space = H5PB__make_space(f, page_buf, type)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_NOSPACE, FAIL, "make space in Page buffer Failed") /* If make_space returns 0, then we can't use the page @@ -1220,7 +1205,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, HDassert(0 == i); /* Write to VFD and return */ - if(H5FD_write(&fdio_info, type, addr, size, buf) < 0) + if(H5FD_write(file, type, addr, size, buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "driver write request failed") /* Break out of loop */ @@ -1229,7 +1214,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, } /* end if */ /* Don't bother searching if there is no write access */ - if(H5F_ACC_RDWR & H5F_INTENT(fio_info->f)) + if(H5F_ACC_RDWR & H5F_INTENT(f)) /* Lookup & remove the page from the new skip list page if * it exists to see if this is a new page from the MF layer */ @@ -1272,7 +1257,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_entry->type = (H5F_mem_page_t)type; /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the entire page falls outside the EOA, then fail */ @@ -1283,8 +1268,8 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, * returned will most likely be HADDR_UNDEF, so skip * that check. */ - if(!H5F_HAS_FEATURE(fio_info->f, H5FD_FEAT_HAS_MPI)) - if(HADDR_UNDEF == (eof = H5FD_get_eof(fio_info->f->shared->lf, H5FD_MEM_DEFAULT))) + if(!H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) + if(HADDR_UNDEF == (eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eof request failed") /* Adjust the read size to not go beyond the EOA */ @@ -1292,7 +1277,7 @@ H5PB_write(const H5F_io_info2_t *fio_info, H5FD_mem_t type, haddr_t addr, page_size = (size_t)(eoa - search_addr); if(search_addr < eof) { - if(H5FD_read(&fdio_info, type, search_addr, page_size, new_page_buf) < 0) + if(H5FD_read(file, type, search_addr, page_size, new_page_buf) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_READERROR, FAIL, "driver read request failed") /* Update statistics */ @@ -1393,8 +1378,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, - H5FD_mem_t inserted_type) +H5PB__make_space(H5F_t *f, H5PB_t *page_buf, H5FD_mem_t inserted_type) { H5PB_entry_t *page_entry; /* Pointer to page eviction candidate */ htri_t ret_value = TRUE; /* Return value */ @@ -1402,7 +1386,7 @@ H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, FUNC_ENTER_STATIC /* Sanity check */ - HDassert(fio_info); + HDassert(f); HDassert(page_buf); /* Get oldest entry */ @@ -1459,7 +1443,7 @@ H5PB__make_space(const H5F_io_info2_t *fio_info, H5PB_t *page_buf, /* Flush page if dirty */ if(page_entry->is_dirty) - if(H5PB__write_entry(fio_info, page_entry) < 0) + if(H5PB__write_entry(f, page_entry) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") /* Update statistics */ @@ -1493,7 +1477,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) +H5PB__write_entry(H5F_t *f, H5PB_entry_t *page_entry) { haddr_t eoa; /* Current EOA for the file */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1501,31 +1485,28 @@ H5PB__write_entry(const H5F_io_info2_t *fio_info, H5PB_entry_t *page_entry) FUNC_ENTER_STATIC /* Sanity check */ - HDassert(fio_info); - HDassert(fio_info->f); + HDassert(f); HDassert(page_entry); /* Retrieve the 'eoa' for the file */ - if(HADDR_UNDEF == (eoa = H5F_get_eoa(fio_info->f, (H5FD_mem_t)page_entry->type))) + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, (H5FD_mem_t)page_entry->type))) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTGET, FAIL, "driver get_eoa request failed") /* If the starting address of the page is larger than * the EOA, then the entire page is discarded without writing. */ if(page_entry->addr <= eoa) { - H5FD_io_info_t fdio_info; /* File driver I/O info */ - size_t page_size = fio_info->f->shared->page_buf->page_size; + H5FD_t *file; /* File driver I/O info */ + size_t page_size = f->shared->page_buf->page_size; /* Adjust the page length if it exceeds the EOA */ if((page_entry->addr + page_size) > eoa) page_size = (size_t)(eoa - page_entry->addr); /* Translate to file driver I/O info object */ - fdio_info.file = fio_info->f->shared->lf; - fdio_info.meta_dxpl = fio_info->meta_dxpl; - fdio_info.raw_dxpl = fio_info->raw_dxpl; + file = f->shared->lf; - if(H5FD_write(&fdio_info, (H5FD_mem_t)page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0) + if(H5FD_write(file, (H5FD_mem_t)page_entry->type, page_entry->addr, page_size, page_entry->page_buf_ptr) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_WRITEERROR, FAIL, "file write failed") } /* end if */ diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index e6f2874..aef87e1 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -86,15 +86,15 @@ typedef struct H5PB_t { /* General routines */ H5_DLL herr_t H5PB_create(H5F_t *file, size_t page_buffer_size, unsigned page_buf_min_meta_perc, unsigned page_buf_min_raw_perc); -H5_DLL herr_t H5PB_flush(const H5F_io_info2_t *fio_info); -H5_DLL herr_t H5PB_dest(const H5F_io_info2_t *fio_info); +H5_DLL herr_t H5PB_flush(H5F_t *f); +H5_DLL herr_t H5PB_dest(H5F_t *f); H5_DLL herr_t H5PB_add_new_page(H5F_t *f, H5FD_mem_t type, haddr_t page_addr); H5_DLL herr_t H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf); H5_DLL herr_t H5PB_remove_entry(const H5F_t *f, haddr_t addr); -H5_DLL herr_t H5PB_read(const H5F_io_info2_t *fio_info, H5FD_mem_t type, - haddr_t addr, size_t size, void *buf/*out*/); -H5_DLL herr_t H5PB_write(const H5F_io_info2_t *f, H5FD_mem_t type, haddr_t addr, - size_t size, const void *buf); +H5_DLL herr_t H5PB_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + void *buf/*out*/); +H5_DLL herr_t H5PB_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, + const void *buf); /* Statistics routines */ H5_DLL herr_t H5PB_reset_stats(H5PB_t *page_buf); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 3b4c159..14701ff 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -34,6 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -3184,6 +3185,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) { H5P_genplist_t *plist; /* Property list pointer */ H5O_fill_t fill; /* Fill value to modify */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3192,6 +3194,10 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get the current fill value */ if(H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) @@ -3217,7 +3223,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HDmemcpy(fill.buf, value, (size_t)fill.size); /* Set up type conversion function */ - if(NULL == (tpath = H5T_path_find(type, type, NULL, NULL, H5AC_ind_read_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(type, type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types") /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ @@ -3229,7 +3235,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Convert the fill value */ - if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf, H5AC_ind_read_dxpl_id) < 0) { + if(H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf) < 0) { if(bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") @@ -3248,6 +3254,8 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pset_fill_value() */ @@ -3269,8 +3277,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, - hid_t dxpl_id) +H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/) { H5O_fill_t fill; /* Fill value to retrieve */ H5T_path_t *tpath; /*type conversion info */ @@ -3302,7 +3309,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, /* * Can we convert between the source and destination datatypes? */ - if(NULL == (tpath = H5T_path_find(fill.type, type, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(fill.type, type))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes") if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype") @@ -3328,7 +3335,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, /* Do the conversion */ if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_TRANSIENT), FALSE)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype") - if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "datatype conversion failed") if(buf != value) HDmemcpy(value, buf, H5T_get_size(type)); @@ -3368,6 +3375,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ H5T_t *type; /* Datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -3382,12 +3390,18 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* Get the fill value */ - if(H5P_get_fill_value(plist, type, value, H5AC_ind_read_dxpl_id) < 0) + if(H5P_get_fill_value(plist, type, value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Pget_fill_value() */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3c53c15..e33e762 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -129,14 +129,6 @@ /* Definitions for cause of broken collective io property */ #define H5D_MPIO_NO_COLLECTIVE_CAUSE_SIZE sizeof(uint32_t) #define H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF H5D_MPIO_COLLECTIVE -#ifdef H5_HAVE_PARALLEL -/* Definitions for memory MPI type property */ -#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype) -#define H5FD_MPI_XFER_MEM_MPI_TYPE_DEF MPI_DATATYPE_NULL -/* Definitions for file MPI type property */ -#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype) -#define H5FD_MPI_XFER_FILE_MPI_TYPE_DEF MPI_DATATYPE_NULL -#endif /* H5_HAVE_PARALLEL */ /* Definitions for EDC property */ #define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) @@ -176,22 +168,6 @@ #define H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF 0 #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_SIZE sizeof(hsize_t *) #define H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF NULL -/* Ring type - private property */ -#define H5AC_XFER_RING_SIZE sizeof(unsigned) -#define H5AC_XFER_RING_DEF H5AC_RING_USER -#define H5AC_XFER_RING_ENC H5P__encode_unsigned -#define H5AC_XFER_RING_DEC H5P__decode_unsigned -#ifdef H5_DEBUG_BUILD -/* dxpl I/O type - private property */ -#define H5FD_DXPL_TYPE_SIZE sizeof(H5FD_dxpl_type_t) -#endif /* H5_DEBUG_BUILD */ -#ifdef H5_HAVE_PARALLEL -/* Definition for reading metadata collectively */ -#define H5D_XFER_COLL_MD_READ_SIZE sizeof(H5P_coll_md_read_flag_t) -#define H5D_XFER_COLL_MD_READ_DEF H5P_USER_FALSE -#define H5D_XFER_COLL_MD_READ_ENC H5P__encode_coll_md_read_flag_t -#define H5D_XFER_COLL_MD_READ_DEC H5P__decode_coll_md_read_flag_t -#endif /* H5_HAVE_PARALLEL */ /******************/ @@ -278,7 +254,6 @@ static const void *H5D_def_vlen_alloc_info_g = H5D_XFER_VLEN_ALLOC_INFO_DEF; / static const H5MM_free_t H5D_def_vlen_free_g = H5D_XFER_VLEN_FREE_DEF; /* Default value for vlen free function */ static const void *H5D_def_vlen_free_info_g = H5D_XFER_VLEN_FREE_INFO_DEF; /* Default value for vlen free information */ static const size_t H5D_def_hyp_vec_size_g = H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */ -static const haddr_t H5D_def_tag_g = H5AC_TAG_DEF; /* Default value for cache entry tag */ static const H5FD_mpio_xfer_t H5D_def_io_xfer_mode_g = H5D_XFER_IO_XFER_MODE_DEF; /* Default value for I/O transfer mode */ static const H5FD_mpio_chunk_opt_t H5D_def_mpio_chunk_opt_mode_g = H5D_XFER_MPIO_CHUNK_OPT_HARD_DEF; static const H5FD_mpio_collective_opt_t H5D_def_mpio_collective_opt_mode_g = H5D_XFER_MPIO_COLLECTIVE_OPT_DEF; @@ -287,11 +262,6 @@ static const unsigned H5D_def_mpio_chunk_opt_ratio_g = H5D_XFER_MPIO_CHUNK_OPT_R static const H5D_mpio_actual_chunk_opt_mode_t H5D_def_mpio_actual_chunk_opt_mode_g = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; static const H5D_mpio_actual_io_mode_t H5D_def_mpio_actual_io_mode_g = H5D_MPIO_ACTUAL_IO_MODE_DEF; static const H5D_mpio_no_collective_cause_t H5D_def_mpio_no_collective_cause_g = H5D_MPIO_NO_COLLECTIVE_CAUSE_DEF; -#ifdef H5_HAVE_PARALLEL -static const MPI_Datatype H5D_def_btype_g = H5FD_MPI_XFER_MEM_MPI_TYPE_DEF; /* Default value for MPI buffer type */ -static const MPI_Datatype H5D_def_ftype_g = H5FD_MPI_XFER_FILE_MPI_TYPE_DEF; /* Default value for MPI file type */ -static const H5P_coll_md_read_flag_t H5D_def_coll_md_read_g = H5D_XFER_COLL_MD_READ_DEF; /* Default setting for the collective metedata read flag */ -#endif /* H5_HAVE_PARALLEL */ static const H5Z_EDC_t H5D_def_enable_edc_g = H5D_XFER_EDC_DEF; /* Default value for EDC property */ static const H5Z_cb_t H5D_def_filter_cb_g = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ static const H5T_conv_cb_t H5D_def_conv_cb_g = H5D_XFER_CONV_CB_DEF; /* Default value for datatype conversion callback */ @@ -303,10 +273,6 @@ static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WR static const hbool_t direct_chunk_read_flag = H5D_XFER_DIRECT_CHUNK_READ_FLAG_DEF; /* Default value for the flag of direct chunk read */ static const hsize_t *direct_chunk_read_offset = H5D_XFER_DIRECT_CHUNK_READ_OFFSET_DEF; /* Default value for the offset of direct chunk read */ static const uint32_t direct_chunk_read_filters = H5D_XFER_DIRECT_CHUNK_READ_FILTERS_DEF; /* Default value for the filters of direct chunk read */ -static const H5AC_ring_t H5D_ring_g = H5AC_XFER_RING_DEF; /* Default value for the cache entry ring type */ -#ifdef H5_DEBUG_BUILD -static const H5FD_dxpl_type_t H5D_dxpl_type_g = H5FD_NOIO_DXPL; /* Default value for the dxpl type */ -#endif /* H5_DEBUG_BUILD */ /*------------------------------------------------------------------------- @@ -333,11 +299,6 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the cache tag property */ - if(H5P_register_real(pclass, H5AC_TAG_NAME, H5AC_TAG_SIZE, &H5D_def_tag_g, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the type conversion buffer property */ /* (Note: this property should not have an encode/decode callback -QAK) */ if(H5P_register_real(pclass, H5D_XFER_TCONV_BUF_NAME, H5D_XFER_TCONV_BUF_SIZE, &H5D_def_tconv_buf_g, @@ -438,27 +399,6 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") -#ifdef H5_HAVE_PARALLEL - /* Register the MPI memory type property */ - /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE, &H5D_def_btype_g, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - - /* Register the MPI file type property */ - /* (Note: this property should not have an encode/decode callback -QAK) */ - if(H5P_register_real(pclass, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE, &H5D_def_ftype_g, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - - /* Register the metadata collective read flag */ - if(H5P_register_real(pclass, H5_COLL_MD_READ_FLAG_NAME, H5D_XFER_COLL_MD_READ_SIZE, - &H5D_def_coll_md_read_g, - NULL, NULL, NULL, H5D_XFER_COLL_MD_READ_ENC, H5D_XFER_COLL_MD_READ_DEC, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") -#endif /* H5_HAVE_PARALLEL */ - /* Register the EDC property */ if(H5P_register_real(pclass, H5D_XFER_EDC_NAME, H5D_XFER_EDC_SIZE, &H5D_def_enable_edc_g, NULL, NULL, NULL, H5D_XFER_EDC_ENC, H5D_XFER_EDC_DEC, @@ -525,19 +465,6 @@ H5P__dxfr_reg_prop(H5P_genclass_t *pclass) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the ring property (private) */ - if(H5P_register_real(pclass, H5AC_RING_NAME, H5AC_XFER_RING_SIZE, &H5D_ring_g, - NULL, NULL, NULL, H5AC_XFER_RING_ENC, H5AC_XFER_RING_DEC, - NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - -#ifdef H5_DEBUG_BUILD - /* Register the dxpl IO type property */ - if(H5P_register_real(pclass, H5FD_DXPL_TYPE_NAME, H5FD_DXPL_TYPE_SIZE, &H5D_dxpl_type_g, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") -#endif /* H5_DEBUG_BUILD */ - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__dxfr_reg_prop() */ diff --git a/src/H5Pint.c b/src/H5Pint.c index fe17a19..0e78463 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -273,16 +273,15 @@ const H5P_libclass_t H5P_CLS_TACC[1] = {{ /* Library property list classes defined in other code modules */ +/* (And not present in src/H5Pprivate.h) */ H5_DLLVAR const H5P_libclass_t H5P_CLS_OCRT[1]; /* Object creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_STRCRT[1]; /* String create */ H5_DLLVAR const H5P_libclass_t H5P_CLS_GCRT[1]; /* Group create */ -H5_DLLVAR const H5P_libclass_t H5P_CLS_OCPY[1]; /* Object copy */ H5_DLLVAR const H5P_libclass_t H5P_CLS_FCRT[1]; /* File creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_DCRT[1]; /* Dataset creation */ H5_DLLVAR const H5P_libclass_t H5P_CLS_DXFR[1]; /* Data transfer */ H5_DLLVAR const H5P_libclass_t H5P_CLS_FMNT[1]; /* File mount */ H5_DLLVAR const H5P_libclass_t H5P_CLS_ACRT[1]; /* Attribute creation */ -H5_DLLVAR const H5P_libclass_t H5P_CLS_LCRT[1]; /* Link creation */ /*****************************/ @@ -2858,6 +2857,7 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ void *tmp_value = NULL; /* Temporary value for property */ + const void *prp_value = NULL; /* Property value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2881,10 +2881,13 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Call user's callback */ if((*(prop->set))(plist->plist_id, name, prop->size, tmp_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value") + + /* Set the pointer for copying */ + prp_value = tmp_value; } /* end if */ /* No 'set' callback, just copy value */ else - tmp_value = (void *)udata->value; /* Casting away const OK -QAK */ + prp_value = udata->value; /* Free any previous value for the property */ if(NULL != prop->del) { @@ -2894,11 +2897,11 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, } /* end if */ /* Copy new [possibly unchanged] value into property value */ - HDmemcpy(prop->value, tmp_value, prop->size); + HDmemcpy(prop->value, prp_value, prop->size); done: /* Free the temporary value buffer */ - if(tmp_value != NULL && tmp_value != udata->value) + if(tmp_value != NULL) H5MM_xfree(tmp_value); FUNC_LEAVE_NOAPI(ret_value) @@ -2933,6 +2936,7 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ H5P_genprop_t *pcopy = NULL; /* Copy of property to insert into skip list */ void *tmp_value = NULL; /* Temporary value for property */ + const void *prp_value = NULL; /* Property value */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -2957,16 +2961,19 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, /* Call user's callback */ if((*(prop->set))(plist->plist_id, name, prop->size, tmp_value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set property value") + + /* Set the pointer for copying */ + prp_value = tmp_value; } /* end if */ /* No 'set' callback, just copy value */ else - tmp_value = (void *)udata->value; /* Casting away const OK -QAK */ + prp_value = udata->value; /* Make a copy of the class's property */ if(NULL == (pcopy = H5P_dup_prop(prop, H5P_PROP_WITHIN_LIST))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "Can't copy property") - HDmemcpy(pcopy->value, tmp_value, pcopy->size); + HDmemcpy(pcopy->value, prp_value, pcopy->size); /* Insert the changed property into the property list */ if(H5P_add_prop(plist->props, pcopy) < 0) @@ -2974,7 +2981,7 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, done: /* Free the temporary value buffer */ - if(tmp_value != NULL && tmp_value != udata->value) + if(tmp_value != NULL) H5MM_xfree(tmp_value); /* Cleanup on failure */ @@ -5435,90 +5442,30 @@ H5P_get_class(const H5P_genplist_t *plist) /*------------------------------------------------------------------------- - * Function: H5P_verify_apl_and_dxpl + * Function: H5P_get_default * - * Purpose: Validate access property list and/or switch from generic - * property list to default of correct type. + * Purpose: Get the default property list ID, for a property class. * - * Also, if using internal DXPL and collective flag is set, - * switch to internal collective DXPL. - * - * Return: Non-negative on success/Negative on failure + * Return: Success: Non-negative ID of property list. + * Failure: negative. * - * Programmer: Mohamad Chaarawi - * Sunday, June 21, 2015 + * Programmer: Quincey Koziol + * December 29, 2017 * *------------------------------------------------------------------------- */ -herr_t -H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, hid_t *dxpl_id, - hid_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - loc_id, hbool_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* H5_HAVE_PARALLEL */ - is_collective) +hid_t +H5P_get_default(const H5P_libclass_t *libclass) { - herr_t ret_value = SUCCEED; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI(H5I_INVALID_HID) - /* Sanity check */ - HDassert(acspl_id); HDassert(libclass); - HDassert(dxpl_id); -#ifdef H5_HAVE_PARALLEL - /* If parallel is enabled and the file driver used in the MPI-IO - VFD, issue an MPI barrier for easier debugging if the API function - calling this is supposed to be called collectively. Note that this - happens only when the environment variable H5_COLL_BARRIER is set - to non 0. */ - if(is_collective && H5_coll_api_sanity_check_g) { - MPI_Comm mpi_comm; /* file communicator */ - - /* retrieve the MPI communicator from the loc_id or the fapl_id */ - if(H5F_mpi_retrieve_comm(loc_id, *acspl_id, &mpi_comm) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") - - /* issue the barrier */ - if(mpi_comm != MPI_COMM_NULL) - MPI_Barrier(mpi_comm); - } -#endif /* H5_HAVE_PARALLEL */ - - /* Set access plist to the default property list of the appropriate class if it's the generic default */ - if(H5P_DEFAULT == *acspl_id) - *acspl_id = *libclass->def_plist_id; - else { -#ifdef H5_HAVE_PARALLEL - H5P_coll_md_read_flag_t md_coll_read; /* Collective metadata read flag */ - H5P_genplist_t *plist; /* Property list pointer */ -#endif /* H5_HAVE_PARALLEL */ - - /* Sanity check the access property list class */ - if(TRUE != H5P_isa_class(*acspl_id, *libclass->class_id)) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not the required access property list") - -#ifdef H5_HAVE_PARALLEL - /* Get the plist structure for the access property list */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(*acspl_id))) - HGOTO_ERROR(H5E_PLIST, H5E_BADATOM, FAIL, "can't find object for ID") - - /* Get the collective metadata read flag */ - if(H5P_peek(plist, H5_COLL_MD_READ_FLAG_NAME, &md_coll_read) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get core collective metadata read flag") - - /* If collective metadata read requested and using internal DXPL, switch to internal collective DXPL */ - if(H5P_USER_TRUE == md_coll_read) - *dxpl_id = H5AC_coll_read_dxpl_id; -#endif /* H5_HAVE_PARALLEL */ - } /* end else */ + ret_value = *libclass->def_plist_id; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_verify_apl_and_dxpl() */ +} /* end H5P_get_default() */ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a468464..efd6cde 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -134,12 +134,14 @@ H5_DLLVAR H5P_genclass_t *H5P_CLS_LINK_ACCESS_g; H5_DLLVAR H5P_genclass_t *H5P_CLS_STRING_CREATE_g; /* Internal property list classes */ +H5_DLLVAR const struct H5P_libclass_t H5P_CLS_LCRT[1]; /* Link creation */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_LACC[1]; /* Link access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_AACC[1]; /* Attribute access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_DACC[1]; /* Dataset access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_GACC[1]; /* Group access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_TACC[1]; /* Named datatype access */ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */ +H5_DLLVAR const struct H5P_libclass_t H5P_CLS_OCPY[1]; /* Object copy */ /******************************/ /* Library Private Prototypes */ @@ -186,8 +188,7 @@ H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); -H5_DLL herr_t H5P_verify_apl_and_dxpl(hid_t *acspl_id, const H5P_libclass_t *libclass, - hid_t *dxpl_id, hid_t loc_id, hbool_t is_collective); +H5_DLL hid_t H5P_get_default(const H5P_libclass_t *pclass); /* Query internal fields of the property list struct */ H5_DLL hid_t H5P_get_plist_id(const H5P_genplist_t *plist); @@ -201,7 +202,7 @@ H5_DLL H5P_genplist_t *H5P_object_verify(hid_t plist_id, hid_t pclass_id); H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status); H5_DLL herr_t H5P_get_fill_value(H5P_genplist_t *plist, const struct H5T_t *type, - void *value, hid_t dxpl_id); + void *value); #endif /* _H5Pprivate_H */ diff --git a/src/H5R.c b/src/H5R.c index 8b42b35..86a94bf 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -23,6 +23,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ @@ -92,6 +93,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t { H5G_loc_t loc; /* File location */ H5S_t *space = NULL; /* Pointer to dataspace containing region */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -113,11 +115,21 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t if (space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Create reference */ - if ((ret_value = H5R_create(ref, &loc, name, ref_type, space, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to create reference") + if((ret_value = H5R__create(ref, &loc, name, ref_type, space)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rcreate() */ @@ -154,34 +166,40 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "iiRt*x", obj_id, oapl_id, ref_type, _ref); /* Check args */ if (H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (oapl_id < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a property list") if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (_ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") - /* Verify access property list and get correct dxpl */ - if (H5P_verify_apl_and_dxpl(&oapl_id, H5P_CLS_DACC, &dxpl_id, obj_id, FALSE) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&oapl_id, H5P_CLS_DACC, obj_id, FALSE) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set access property list info") /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if ((ret_value = H5R_dereference(file, oapl_id, dxpl_id, ref_type, _ref, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") + if((ret_value = H5R__dereference(file, oapl_id, ref_type, _ref)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to dereference object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference2() */ @@ -214,28 +232,36 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object's group location */ H5S_t *space = NULL; /* Dataspace object */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iRt*x", id, ref_type, ref); /* Check args */ if (H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (ref_type != H5R_DATASET_REGION) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Get the dataspace with the correct region selected */ - if ((space = H5R_get_region(loc.oloc->file, H5AC_ind_read_dxpl_id, ref)) == NULL) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create dataspace") + if(NULL == (space = H5R__get_region(loc.oloc->file, ref))) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, H5I_INVALID_HID, "unable to retrieve dataspace") /* Atomize */ if ((ret_value = H5I_register(H5I_DATASPACE, space, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_region() */ @@ -268,6 +294,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj_type) { H5G_loc_t loc; /* Object location */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -281,11 +308,18 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object information */ - if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, obj_type) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object type") + if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, obj_type) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type2() */ @@ -329,6 +363,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, { H5G_loc_t loc; /* Group location */ H5F_t *file; /* File object */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -342,14 +377,21 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, if (_ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the file pointer from the entry */ file = loc.oloc->file; /* Get name */ - if ((ret_value = H5R_get_name(file, H5P_DEFAULT, H5AC_ind_read_dxpl_id, id, ref_type, _ref, name, size)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to determine object path") + if((ret_value = H5R__get_name(file, id, ref_type, _ref, name, size)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_name() */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 699f8df..ccb4798 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -37,11 +37,12 @@ #include "H5Ppublic.h" /* Property lists */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Oprivate.h" /* Object headers */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ #include "H5Rpkg.h" /* References */ @@ -103,6 +104,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) { H5G_loc_t loc; /* Object location */ H5O_type_t obj_type; /* Object type */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ H5G_obj_t ret_value; /* Return value */ FUNC_ENTER_API(H5G_UNKNOWN) @@ -116,14 +118,21 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) if (ref == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5G_UNKNOWN, "invalid reference pointer") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5G_UNKNOWN, "can't set API context") +api_ctx_pushed = TRUE; + /* Get the object information */ - if (H5R_get_obj_type(loc.oloc->file, H5AC_ind_read_dxpl_id, ref_type, ref, &obj_type) < 0) + if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, &obj_type) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type") /* Set return value */ ret_value = H5G_map_obj_type(obj_type); done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5G_UNKNOWN, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ @@ -149,27 +158,35 @@ H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ - hid_t ret_value; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); /* Check args */ if (H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if (ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference type") if (_ref == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid reference pointer") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Get the file pointer from the entry */ file = loc.oloc->file; /* Create reference */ - if ((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id, ref_type, _ref, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") + if((ret_value = H5R__dereference(file, H5P_DATASET_ACCESS_DEFAULT, ref_type, _ref)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5I_INVALID_HID, "unable dereference object") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_REFERENCE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Rdereference1() */ diff --git a/src/H5Rint.c b/src/H5Rint.c index 716a573..02f7778 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -195,11 +195,11 @@ H5R_term_package(void) /*-------------------------------------------------------------------------- NAME - H5R_create + H5R__create PURPOSE Creates a particular kind of reference for the user USAGE - herr_t H5R_create(ref, loc, name, ref_type, space) + herr_t H5R__create(ref, loc, name, ref_type, space) void *ref; OUT: Reference created H5G_loc_t *loc; IN: File location used to locate object pointed to const char *name; IN: Name of object at location LOC_ID of object @@ -221,7 +221,8 @@ H5R_term_package(void) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id) +H5R__create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, + H5S_t *space) { H5G_loc_t obj_loc; /* Group hier. location of object */ H5G_name_t path; /* Object group hier. path */ @@ -229,7 +230,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 hbool_t obj_found = FALSE; /* Object location found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(loc); @@ -242,7 +243,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 H5G_loc_reset(&obj_loc); /* Find the object */ - if (H5G_loc_find(loc, name, &obj_loc, H5P_DEFAULT, dxpl_id) < 0) + if(H5G_loc_find(loc, name, &obj_loc) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_NOTFOUND, FAIL, "object not found") obj_found = TRUE; @@ -310,7 +311,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 /* Save the serialized buffer for later */ H5_CHECK_OVERFLOW(buf_size, hssize_t, size_t); - if (H5HG_insert(loc->oloc->file, dxpl_id, (size_t)buf_size, buf, &hobjid) < 0) + if(H5HG_insert(loc->oloc->file, (size_t)buf_size, buf, &hobjid) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection") /* Serialize the heap ID and index for storage in the file */ @@ -334,19 +335,20 @@ done: if (obj_found) H5G_loc_free(&obj_loc); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_create() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__create() */ /*-------------------------------------------------------------------------- NAME - H5R_dereference + H5R__dereference PURPOSE Opens the HDF5 object referenced. USAGE - hid_t H5R_dereference(ref) + hid_t H5R__dereference(ref, oapl_id, ref_type, ref) H5F_t *file; IN: File the object being dereferenced is within - H5R_type_t ref_type; IN: Type of reference + hid_t oapl_id; IN: Object access property list ID + H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to open. RETURNS @@ -369,7 +371,8 @@ done: Added a check for undefined reference pointer. --------------------------------------------------------------------------*/ hid_t -H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) +H5R__dereference(H5F_t *file, hid_t oapl_id, H5R_type_t ref_type, + const void *_ref) { H5O_loc_t oloc; /* Object location */ H5G_name_t path; /* Path of object */ @@ -378,7 +381,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, H5O_type_t obj_type; /* Type of object */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(ref_type > H5R_BADTYPE && ref_type < H5R_MAXTYPE); @@ -393,7 +396,7 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { oloc.addr = *(const hobj_ref_t *)_ref; /* Only object references currently supported */ if (!H5F_addr_defined(oloc.addr) || oloc.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "Undefined reference pointer") break; } @@ -409,11 +412,11 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, UINT32DECODE(p, hobjid.idx); if (!H5F_addr_defined(hobjid.addr) || hobjid.addr == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Undefined reference pointer") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "Undefined reference pointer") /* Get the dataset region from the heap (allocate inside routine) */ - if (NULL == (buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL))) - HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) + HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, H5I_INVALID_HID, "Unable to read dataset region information") /* Get the object oid for the dataset */ p = buf; @@ -428,15 +431,15 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, case H5R_MAXTYPE: default: HDassert("unknown reference type" && 0); - HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") + HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, H5I_INVALID_HID, "internal error (unknown reference type)") } /* end switch */ /* Get the # of links for object, and its type * (To check to make certain that this object hasn't been deleted * since the reference was created) */ - if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, &obj_type) < 0 || 0 == rc) - HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") + if(H5O_get_rc_and_type(&oloc, &rc, &obj_type) < 0 || 0 == rc) + HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, H5I_INVALID_HID, "dereferencing deleted object") /* Construct a group location for opening the object */ H5G_name_reset(&path); @@ -449,14 +452,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { H5G_t *group; /* Pointer to group to open */ - if (NULL == (group = H5G_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (group = H5G_open(&loc))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the group */ - if ((ret_value = H5I_register(H5I_GROUP, group, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_GROUP, group, TRUE)) < 0) { H5G_close(group); - HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, FAIL, "can't register group") - } + HGOTO_ERROR(H5E_SYM, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register group") + } /* end if */ break; } @@ -465,14 +468,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, { H5T_t *type; /* Pointer to datatype to open */ - if (NULL == (type = H5T_open(&loc, dxpl_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (type = H5T_open(&loc))) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the datatype */ - if ((ret_value = H5I_register(H5I_DATATYPE, type, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) { H5T_close(type); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "can't register datatype") - } + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register datatype") + } /* end if */ break; } @@ -482,14 +485,14 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, H5D_t *dset; /* Pointer to dataset to open */ /* Open the dataset */ - if (NULL == (dset = H5D_open(&loc, oapl_id, dxpl_id))) - HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") + if(NULL == (dset = H5D_open(&loc, oapl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, H5I_INVALID_HID, "not found") /* Create an atom for the dataset */ - if ((ret_value = H5I_register(H5I_DATASET, dset, app_ref)) < 0) { + if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) { H5D_close(dset); - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "can't register dataset") - } + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register dataset") + } /* end if */ break; } @@ -497,21 +500,21 @@ H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, FAIL, "can't identify type of object referenced") + HGOTO_ERROR(H5E_REFERENCE, H5E_BADTYPE, H5I_INVALID_HID, "can't identify type of object referenced") } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_dereference() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__dereference() */ /*-------------------------------------------------------------------------- NAME - H5R_get_region + H5R__get_region PURPOSE Retrieves a dataspace with the region pointed to selected. USAGE - H5S_t *H5R_get_region(file, ref_type, ref) + H5S_t *H5R__get_region(file, ref) H5F_t *file; IN: File the object being dereferenced is within void *ref; IN: Reference to open. @@ -527,15 +530,15 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5S_t * -H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) +H5R__get_region(H5F_t *file, const void *_ref) { H5O_loc_t oloc; /* Object location */ const uint8_t *p; /* Pointer to OID to store */ H5HG_t hobjid; /* Heap object ID */ uint8_t *buf = NULL; /* Buffer to store serialized selection in */ - H5S_t *ret_value; + H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(_ref); HDassert(file); @@ -550,7 +553,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, NULL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -558,36 +561,36 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) H5F_addr_decode(oloc.file, &p, &(oloc.addr)); /* Open and copy the dataset's dataspace */ - if ((ret_value = H5S_read(&oloc, dxpl_id)) == NULL) + if(NULL == (ret_value = H5S_read(&oloc))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, NULL, "not found") /* Unserialize the selection */ - if (H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) + if(H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, NULL, "can't deserialize selection") done: /* Free the buffer allocated in H5HG_read() */ - if (buf) + if(buf) H5MM_xfree(buf); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_region() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_region() */ /*-------------------------------------------------------------------------- NAME - H5R_get_obj_type + H5R__get_obj_type PURPOSE Retrieves the type of object that an object reference points to USAGE - H5O_type_t H5R_get_obj_type(file, ref_type, ref) + H5O_type_t H5R__get_obj_type(file, ref_type, ref) H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. + H5O_type_t *obj_type; OUT: The type of the object, set on success RETURNS - Success: An object type defined in H5Gpublic.h - Failure: H5G_UNKNOWN + Non-negative on success/Negative on failure DESCRIPTION Given a reference to some object, this function returns the type of object pointed to. @@ -597,14 +600,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type) +H5R__get_obj_type(H5F_t *file, H5R_type_t ref_type, const void *_ref, + H5O_type_t *obj_type) { H5O_loc_t oloc; /* Object location */ unsigned rc; /* Reference count of object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL HDassert(file); HDassert(_ref); @@ -633,7 +636,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if(NULL == (buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL))) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -655,25 +658,24 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, /* Get the # of links for object, and its type */ /* (To check to make certain that this object hasn't been deleted since the reference was created) */ - if (H5O_get_rc_and_type(&oloc, dxpl_id, &rc, obj_type) < 0 || 0 == rc) + if(H5O_get_rc_and_type(&oloc, &rc, obj_type) < 0 || 0 == rc) HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_obj_type() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_obj_type() */ /*-------------------------------------------------------------------------- NAME - H5R_get_name + H5R__get_name PURPOSE Internal routine to determine a name for the object referenced USAGE - ssize_t H5R_get_name(f, dxpl_id, ref_type, ref, name, size) + ssize_t H5R__get_name(f, ref_type, ref, name, size) H5F_t *f; IN: Pointer to the file that the reference is pointing into hid_t lapl_id; IN: LAPL to use for operation - hid_t dxpl_id; IN: DXPL to use for operation hid_t id; IN: Location ID given for reference H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to query. @@ -692,14 +694,14 @@ done: REVISION LOG --------------------------------------------------------------------------*/ ssize_t -H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, - const void *_ref, char *name, size_t size) +H5R__get_name(H5F_t *f, hid_t id, H5R_type_t ref_type, const void *_ref, + char *name, size_t size) { hid_t file_id = H5I_INVALID_HID; /* ID for file that the reference is in */ H5O_loc_t oloc; /* Object location describing object for reference */ ssize_t ret_value = -1; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE_VOL /* Check args */ HDassert(f); @@ -729,7 +731,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty UINT32DECODE(p, hobjid.idx); /* Get the dataset region from the heap (allocate inside routine) */ - if ((buf = (uint8_t *)H5HG_read(oloc.file, dxpl_id, &hobjid, NULL, NULL)) == NULL) + if ((buf = (uint8_t *)H5HG_read(oloc.file, &hobjid, NULL, NULL)) == NULL) HGOTO_ERROR(H5E_REFERENCE, H5E_READERROR, FAIL, "Unable to read dataset region information") /* Get the object oid for the dataset */ @@ -754,7 +756,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't retrieve file ID") /* Get name, length, etc. */ - if ((ret_value = H5G_get_name_by_addr(file_id, lapl_id, dxpl_id, &oloc, name, size)) < 0) + if ((ret_value = H5G_get_name_by_addr(file_id, &oloc, name, size)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't determine name") done: @@ -762,6 +764,6 @@ done: if (file_id > 0 && H5I_dec_ref(file_id) < 0) HDONE_ERROR(H5E_REFERENCE, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID") - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5R_get_name() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5R__get_name() */ diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 129f944..49261eb 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -45,6 +45,15 @@ /******************************/ /* Package Private Prototypes */ /******************************/ +H5_DLL herr_t H5R__create(void *ref, H5G_loc_t *loc, const char *name, + H5R_type_t ref_type, H5S_t *space); +H5_DLL hid_t H5R__dereference(H5F_t *file, hid_t dapl_id, H5R_type_t ref_type, + const void *_ref); +H5_DLL H5S_t *H5R__get_region(H5F_t *file, const void *_ref); +H5_DLL herr_t H5R__get_obj_type(H5F_t *file, H5R_type_t ref_type, + const void *_ref, H5O_type_t *obj_type); +H5_DLL ssize_t H5R__get_name(H5F_t *file, hid_t id, H5R_type_t ref_type, + const void *_ref, char *name, size_t size); #endif /* _H5Rpkg_H */ diff --git a/src/H5Rprivate.h b/src/H5Rprivate.h index 35e63d2..8c0ba8f 100644 --- a/src/H5Rprivate.h +++ b/src/H5Rprivate.h @@ -45,15 +45,6 @@ /* Library Private Prototypes */ /******************************/ -H5_DLL herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, - H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); -H5_DLL H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); -H5_DLL ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, - H5R_type_t ref_type, const void *_ref, char *name, size_t size); -H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, H5O_type_t *obj_type); -H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, hbool_t app_ref); #endif /* _H5Rprivate_H */ diff --git a/src/H5S.c b/src/H5S.c index 9ac40a7..1694fd2 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1067,7 +1067,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) +H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1079,7 +1079,7 @@ H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Write the current dataspace extent to the dataspace message */ - if(H5O_msg_write_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) + if(H5O_msg_write_oh(f, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple dataspace message") done: @@ -1108,7 +1108,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) +H5S_append(H5F_t *f, H5O_t *oh, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1120,7 +1120,7 @@ H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Add the dataspace message to the object header */ - if(H5O_msg_append_oh(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) + if(H5O_msg_append_oh(f, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't add simple dataspace message") done: @@ -1143,7 +1143,7 @@ done: *------------------------------------------------------------------------- */ H5S_t * -H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) +H5S_read(const H5O_loc_t *loc) { H5S_t *ds = NULL; /* Dataspace to return */ H5S_t *ret_value = NULL; /* Return value */ @@ -1156,7 +1156,7 @@ H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) if(NULL == (ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(H5O_msg_read(loc, H5O_SDSPACE_ID, &(ds->extent), dxpl_id) == NULL) + if(NULL == H5O_msg_read(loc, H5O_SDSPACE_ID, &(ds->extent))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, NULL, "unable to load dataspace info from dataset header") /* Default to entire dataspace being selected */ @@ -1723,7 +1723,7 @@ H5S_decode(const unsigned char **p) /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, pp))==NULL) + if(NULL == (extent = (H5S_extent_t *)H5O_msg_decode(f, NULL, H5O_SDSPACE_ID, pp))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") pp += extent_size; @@ -2192,68 +2192,3 @@ H5S_set_latest_version(H5S_t *ds) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_set_latest_version() */ -#ifndef H5_NO_DEPRECATED_SYMBOLS - -/*------------------------------------------------------------------------- - * Function: H5S_extend - * - * Purpose: Extend the dimensions of a dataspace. - * - * Return: Success: Number of dimensions whose size increased. - * - * Failure: Negative - * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5S_extend(H5S_t *space, const hsize_t *size) -{ - unsigned u; - int ret_value = 0; - - FUNC_ENTER_NOAPI(FAIL) - - /* Check args */ - HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); - HDassert(size); - - /* Check through all the dimensions to see if modifying the dataspace is allowed */ - for(u = 0; u < space->extent.rank; u++) - if(space->extent.size[u] < size[u]) { - if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && - space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be increased") - ret_value++; - } /* end if */ - - /* Update */ - if(ret_value) { - hsize_t nelem; /* Number of elements in extent */ - - /* Change the dataspace size & re-compute the number of elements in the extent */ - for(u = 0, nelem = 1; u < space->extent.rank; u++) { - if(space->extent.size[u] < size[u]) - space->extent.size[u] = size[u]; - - nelem *= space->extent.size[u]; - } /* end for */ - space->extent.nelem = nelem; - - /* If the selection is 'all', update the number of elements selected */ - if(H5S_GET_SELECT_TYPE(space) == H5S_SEL_ALL) - if(H5S_select_all(space, FALSE) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") - - /* Mark the dataspace as no longer shared if it was before */ - if(H5O_msg_reset_share(H5O_SDSPACE_ID, space) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5S_extend() */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - diff --git a/src/H5SM.c b/src/H5SM.c index d5ede7e..22ea227 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -41,7 +41,7 @@ /* Local Typedefs */ /******************/ -/* Udata struct for calls to H5SM_read_iter_op */ +/* Udata struct for calls to H5SM__read_iter_op */ typedef struct H5SM_read_udata_t { H5F_t *file; /* File in which sharing is happening (in) */ H5O_msg_crt_idx_t idx; /* Creation index of this message (in) */ @@ -53,31 +53,27 @@ typedef struct H5SM_read_udata_t { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, - hid_t dxpl_id); -static herr_t H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, - hid_t dxpl_id, hbool_t delete_heap); -static haddr_t H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id); +static herr_t H5SM__create_index(H5F_t *f, H5SM_index_header_t *header); +static herr_t H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, + hbool_t delete_heap); +static haddr_t H5SM__create_list(H5F_t *f, H5SM_index_header_t *header); static herr_t H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, - size_t *empty_pos, size_t *list_pos); -static herr_t H5SM_convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, - H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh, hid_t dxpl_id); -static herr_t H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_id); -static herr_t H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed); -static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, - unsigned *cache_flags_ptr); -static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed); -static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, const H5O_shared_t * mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg); -static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag); -static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, + size_t *empty_pos, size_t *list_pos); +static herr_t H5SM__convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header, + H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh); +static herr_t H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header); +static herr_t H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed); +static herr_t H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr); +static herr_t H5SM__decr_ref(void *record, void *op_data, hbool_t *changed); +static herr_t H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + const H5O_shared_t * mesg, unsigned *cache_flags, void ** /*out*/ encoded_mesg); +static herr_t H5SM__type_to_flag(unsigned type_id, unsigned *type_flag); +static herr_t H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, unsigned *oh_modified, void *_udata); -static herr_t H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata); -static herr_t H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, - H5O_t * open_oh, hid_t dxpl_id, size_t *encoding_size /*out*/, - void ** encoded_mesg /*out*/); +static herr_t H5SM__read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata); +static herr_t H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, + H5O_t * open_oh, size_t *encoding_size /*out*/, void ** encoded_mesg /*out*/); /*********************/ @@ -121,12 +117,11 @@ H5FL_ARR_DEFINE(H5SM_sohm_t, H5O_SHMESG_MAX_LIST_SIZE); *------------------------------------------------------------------------- */ herr_t -H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t dxpl_id) +H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc) { H5O_shmesg_table_t sohm_table; /* SOHM message for superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table for file */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ - H5AC_ring_t ring, orig_ring = H5AC_RING_INV; /* Original ring value */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ haddr_t table_addr = HADDR_UNDEF; /* Address of SOHM master table in file */ unsigned list_max, btree_min; /* Phase change limits for SOHM indices */ unsigned index_type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Messages types stored in each index */ @@ -135,15 +130,14 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d unsigned x; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); /* File should not already have a SOHM table */ HDassert(!H5F_addr_defined(H5F_SOHM_ADDR(f))); /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_USER, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(H5AC_RING_USER, &orig_ring); /* Initialize master table */ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) @@ -213,11 +207,11 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d } /* end for */ /* Allocate space for the table on disk */ - if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, dxpl_id, (hsize_t)table->table_size))) + if(HADDR_UNDEF == (table_addr = H5MF_alloc(f, H5FD_MEM_SOHM_TABLE, (hsize_t)table->table_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "file allocation failed for SOHM table") /* Cache the new table */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINS, FAIL, "can't add SOHM table to cache") /* Record the address of the master table in the file */ @@ -230,35 +224,33 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); /* Set the ring type to superblock extension */ - ring = H5AC_RING_SBE; - if((H5P_set(dxpl, H5AC_RING_NAME, &ring)) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + H5AC_set_ring(H5AC_RING_SBE, NULL); /* Write shared message information to the superblock extension */ sohm_table.addr = H5F_SOHM_ADDR(f); sohm_table.version = H5F_SOHM_VERS(f); sohm_table.nindexes = H5F_SOHM_NINDEXES(f); - if(H5O_msg_create(ext_loc, H5O_SHMESG_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &sohm_table, dxpl_id) < 0) + if(H5O_msg_create(ext_loc, H5O_SHMESG_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &sohm_table) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to update SOHM header message") done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); if(ret_value < 0) { if(table_addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)table->table_size); + H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, table_addr, (hsize_t)table->table_size); if(table != NULL) table = H5FL_FREE(H5SM_master_table_t, table); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_init() */ /*------------------------------------------------------------------------- - * Function: H5SM_type_to_flag + * Function: H5SM__type_to_flag * * Purpose: Get the shared message flag for a given message type. * @@ -270,11 +262,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_type_to_flag(unsigned type_id, unsigned *type_flag) +H5SM__type_to_flag(unsigned type_id, unsigned *type_flag) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Translate the H5O type_id into an H5SM type flag */ switch(type_id) { @@ -296,7 +288,7 @@ H5SM_type_to_flag(unsigned type_id, unsigned *type_flag) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_type_to_flag() */ +} /* end H5SM__type_to_flag() */ /*------------------------------------------------------------------------- @@ -325,7 +317,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) FUNC_ENTER_NOAPI_NOINIT /* Translate the H5O type_id into an H5SM type flag */ - if(H5SM_type_to_flag(type_id, &type_flag) < 0) + if(H5SM__type_to_flag(type_id, &type_flag) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't map message type to flag") /* Search the indexes until we find one that matches this flag or we've @@ -356,17 +348,17 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) +H5SM_type_shared(H5F_t *f, unsigned type_id) { H5SM_master_table_t *table = NULL; /* Shared object master table */ unsigned type_flag; /* Flag corresponding to message type */ size_t u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) /* Translate the H5O type_id into an H5SM type flag */ - if(H5SM_type_to_flag(type_id, &type_flag) < 0) + if(H5SM__type_to_flag(type_id, &type_flag) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't map message type to flag") /* Look up the master SOHM table */ @@ -376,7 +368,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -392,10 +384,10 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_type_shared() */ @@ -413,14 +405,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_addr) +H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr) { H5SM_master_table_t *table = NULL; /* Shared object master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Which index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity checks */ HDassert(f); @@ -430,7 +422,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -442,15 +434,15 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_fheap_addr() */ /*------------------------------------------------------------------------- - * Function: H5SM_create_index + * Function: H5SM__create_index * * Purpose: Allocates storage for an index, populating the HEADER struct. * @@ -462,14 +454,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) +H5SM__create_index(H5F_t *f, H5SM_index_header_t *header) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(header); @@ -481,7 +473,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) haddr_t list_addr = HADDR_UNDEF; /* Address of SOHM list */ /* Create the list index */ - if((list_addr = H5SM_create_list(f, header, dxpl_id)) == HADDR_UNDEF) + if(HADDR_UNDEF == (list_addr = H5SM__create_list(f, header))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "list creation failed for SOHM index") /* Set the index type & address */ @@ -499,7 +491,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) + if(NULL == (bt2 = H5B2_create(f, &bt2_cparam, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -521,7 +513,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) fheap_cparam.checksum_dblocks = H5O_FHEAP_CHECKSUM_DBLOCKS; fheap_cparam.id_len = 0; fheap_cparam.max_man_size = H5O_FHEAP_MAX_MAN_SIZE; - if(NULL == (fheap = H5HF_create(f, dxpl_id, &fheap_cparam))) + if(NULL == (fheap = H5HF_create(f, &fheap_cparam))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create fractal heap") if(H5HF_get_heap_addr(fheap, &(header->heap_addr)) < 0) @@ -540,17 +532,17 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_create_index */ +} /* end H5SM__create_index */ /*------------------------------------------------------------------------- - * Function: H5SM_delete_index + * Function: H5SM__delete_index * * Purpose: De-allocates storage for an index whose header is HEADER. * @@ -569,12 +561,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, - hbool_t delete_heap) +H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Determine whether index is a list or a B-tree. */ if(header->index_type == H5SM_LIST) { @@ -591,7 +582,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, HDassert(!(index_status & H5AC_ES__IS_PROTECTED)); /* Evict the index list from the metadata cache */ - if(H5AC_expunge_entry(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(H5AC_expunge_entry(f, H5AC_SOHM_LIST, header->index_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to remove list index from cache") } /* end if */ } /* end if */ @@ -599,7 +590,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, HDassert(header->index_type == H5SM_BTREE); /* Delete the B-tree. */ - if(H5B2_delete(f, dxpl_id, header->index_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, header->index_addr, f, NULL, NULL) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") /* Revert to list unless B-trees can have zero records */ @@ -609,7 +600,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, /* Free the index's heap if requested. */ if(delete_heap == TRUE) { - if(H5HF_delete(f, dxpl_id, header->heap_addr) < 0) + if(H5HF_delete(f, header->heap_addr) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete fractal heap") header->heap_addr = HADDR_UNDEF; } /* end if */ @@ -620,11 +611,11 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_delete_index */ +} /* end H5SM__delete_index */ /*------------------------------------------------------------------------- - * Function: H5SM_create_list + * Function: H5SM__create_list * * Purpose: Creates a list of SOHM messages. * @@ -639,7 +630,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) +H5SM__create_list(H5F_t *f, H5SM_index_header_t *header) { H5SM_list_t *list = NULL; /* List of messages */ hsize_t x; /* Counter variable */ @@ -647,7 +638,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, HADDR_UNDEF) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) HDassert(f); HDassert(header); @@ -668,11 +659,11 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) list->header = header; /* Allocate space for the list on disk */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, dxpl_id, (hsize_t)header->list_size))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_SOHM_INDEX, (hsize_t)header->list_size))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed for SOHM list") /* Put the list into the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_SOHM_LIST, addr, list, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, H5AC_SOHM_LIST, addr, list, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINS, HADDR_UNDEF, "can't add SOHM list to cache") /* Set return value */ @@ -686,15 +677,15 @@ done: list = H5FL_FREE(H5SM_list_t, list); } /* end if */ if(addr != HADDR_UNDEF) - H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, dxpl_id, addr, (hsize_t)header->list_size); + H5MF_xfree(f, H5FD_MEM_SOHM_INDEX, addr, (hsize_t)header->list_size); } /* end if */ - FUNC_LEAVE_NOAPI_TAG(ret_value, HADDR_UNDEF) -} /* end H5SM_create_list */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__create_list */ /*------------------------------------------------------------------------- - * Function: H5SM_convert_list_to_btree + * Function: H5SM__convert_list_to_btree * * Purpose: Given a list index, turns it into a B-tree index. This is * done when too many messages are added to the list. @@ -715,8 +706,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, - H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh, hid_t dxpl_id) +H5SM__convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, + H5SM_list_t **_list, H5HF_t *fheap, H5O_t *open_oh) { H5SM_list_t *list; /* Pointer to the existing message list */ H5SM_mesg_key_t key; /* Key for inserting records in v2 B-tree */ @@ -728,7 +719,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, void * encoding_buf = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(_list && *_list); HDassert(header); @@ -742,7 +733,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; - if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) + if(NULL == (bt2 = H5B2_create(f, &bt2_cparam, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTCREATE, FAIL, "B-tree creation failed for SOHM index") /* Retrieve the v2 B-tree's address in the file */ @@ -753,7 +744,6 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, * are in the heap, they have a heap ID and no encoding or type_id. */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding_size = 0; key.encoding = NULL; @@ -765,23 +755,23 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, key.message = list->messages[x]; /* Get the encoded message */ - if(H5SM_read_mesg(f, &(key.message), fheap, open_oh, dxpl_id, &key.encoding_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &(key.message), fheap, open_oh, &key.encoding_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "Couldn't read SOHM message in list") key.encoding = encoding_buf; /* Insert the message into the B-tree */ - if(H5B2_insert(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") - /* Free buffer from H5SM_read_mesg */ + /* Free buffer from H5SM__read_mesg */ if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); } /* end if */ } /* end for */ /* Unprotect list in cache and release heap */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") *_list = list = NULL; @@ -789,7 +779,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, * still using!) */ num_messages = header->num_messages; /* preserve this across the index deletion */ - if(H5SM_delete_index(f, header, dxpl_id, FALSE) < 0) + if(H5SM__delete_index(f, header, FALSE) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't free list index") /* Set/restore header info */ @@ -799,17 +789,17 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, done: /* Release resources */ - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* H5SM_convert_list_to_btree() */ +} /* H5SM__convert_list_to_btree() */ /*------------------------------------------------------------------------- - * Function: H5SM_convert_btree_to_list + * Function: H5SM__convert_btree_to_list * * Purpose: Given a B-tree index, turns it into a list index. This is * done when too many messages are deleted from the B-tree. @@ -823,14 +813,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_id) +H5SM__convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header) { H5SM_list_t *list = NULL; H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ haddr_t btree_addr; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Remember the address of the old B-tree, but change the header over to be * a list.. @@ -841,7 +831,7 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i header->index_type = H5SM_LIST; /* Create a new list index */ - if(HADDR_UNDEF == (header->index_addr = H5SM_create_list(f, header, dxpl_id))) + if(HADDR_UNDEF == (header->index_addr = H5SM__create_list(f, header))) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create shared message list") /* Set up user data for metadata cache callback */ @@ -849,22 +839,22 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i cache_udata.header = header; /* Protect the SOHM list */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM list index") /* Delete the B-tree and have messages copy themselves to the * list as they're deleted */ - if(H5B2_delete(f, dxpl_id, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) + if(H5B2_delete(f, btree_addr, f, H5SM_bt2_convert_to_list_op, list) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete B-tree") done: /* Release the SOHM list from the cache */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to unprotect SOHM index") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_convert_btree_to_list() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__convert_btree_to_list() */ /*------------------------------------------------------------------------- @@ -930,7 +920,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, +H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, unsigned type_id, const void *mesg) { size_t mesg_size; @@ -939,7 +929,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) @@ -957,7 +947,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -981,10 +971,10 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, done: /* Release the master SOHM table, if we protected it */ - if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), my_table, H5AC__NO_FLAGS_SET) < 0) + if(my_table && my_table != table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), my_table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_can_share() */ @@ -1049,7 +1039,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, +H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, void *mesg, unsigned *mesg_flags) { H5SM_master_table_t *table = NULL; @@ -1062,7 +1052,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, #endif htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* If we previously deferred this operation, the saved message type should * be the same as the one we get here. In debug mode, we make sure this @@ -1089,11 +1079,11 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ - if((tri_ret = H5SM_can_share(f, dxpl_id, table, &index_num, type_id, mesg)) < 0) + if((tri_ret = H5SM_can_share(f, table, &index_num, type_id, mesg)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'complex' sharing checks returned error") if(tri_ret == FALSE) HGOTO_DONE(FALSE) @@ -1102,7 +1092,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, /* If the index hasn't been allocated yet, create it */ if(table->indexes[index_num].index_addr == HADDR_UNDEF) { - if(H5SM_create_index(f, &(table->indexes[index_num]), dxpl_id) < 0) + if(H5SM__create_index(f, &(table->indexes[index_num])) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to create SOHM index") cache_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -1110,7 +1100,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, /* Write the message as a shared message. This may or may not cause the * message to become shared (if it is unique, it will not be shared). */ - if(H5SM_write_mesg(f, dxpl_id, open_oh, &(table->indexes[index_num]), + if(H5SM__write_mesg(f, open_oh, &(table->indexes[index_num]), (defer_flags & H5SM_DEFER) != 0, type_id, mesg, &cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "can't write shared message") @@ -1138,15 +1128,15 @@ done: #endif /* NDEBUG */ /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_try_share() */ /*------------------------------------------------------------------------- - * Function: H5SM_incr_ref + * Function: H5SM__incr_ref * * Purpose: Increment the reference count for a SOHM message and return * the message's heap ID. @@ -1163,13 +1153,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) +H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *) record; H5SM_incr_ref_opdata *op_data = (H5SM_incr_ref_opdata *) _op_data; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(record); HDassert(op_data); @@ -1182,7 +1172,7 @@ H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) HDassert(op_data->key && op_data->key->fheap); /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(op_data->key->fheap, op_data->dxpl_id, op_data->key->encoding_size, op_data->key->encoding, &message->u.heap_loc.fheap_id) < 0) + if(H5HF_insert(op_data->key->fheap, op_data->key->encoding_size, op_data->key->encoding, &message->u.heap_loc.fheap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") message->location = H5SM_IN_HEAP; @@ -1203,11 +1193,11 @@ H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_incr_ref() */ +} /* end H5SM__incr_ref() */ /*------------------------------------------------------------------------- - * Function: H5SM_write_mesg + * Function: H5SM__write_mesg * * Purpose: This routine adds a shareable message to an index. * The behavior is controlled by the DEFER parameter: @@ -1217,7 +1207,7 @@ done: * be with DEFER set the FALSE and updates the shared message * info, but does not actually add the message to a heap, list, * or b-tree. Assumes that an open object header will be - * available when H5SM_write_mesg is called with DEFER set to + * available when H5SM__write_mesg is called with DEFER set to * FALSE. * * If DEFER is FALSE, this routine adds a shareable message to @@ -1239,9 +1229,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, - unsigned *cache_flags_ptr) +H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr) { H5SM_list_t *list = NULL; /* List index */ H5SM_mesg_key_t key; /* Key used to search the index */ @@ -1255,7 +1244,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, size_t empty_pos = UFAIL; /* Empty entry in list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(header); @@ -1271,11 +1260,10 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HGOTO_ERROR(H5E_SOHM, H5E_CANTENCODE, FAIL, "can't encode message to be shared") /* Open the fractal heap for this index */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up a key for the message to be written */ - key.dxpl_id = dxpl_id; key.file = f; key.fheap = fheap; key.encoding = encoding_buf; @@ -1295,7 +1283,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* The index is a list; get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC__READ_ONLY_FLAG : H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC__READ_ONLY_FLAG : H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* See if the message is already in the index and get its location. @@ -1316,7 +1304,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, */ if(list->messages[list_pos].location == H5SM_IN_OH) { /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + if(H5HF_insert(fheap, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") list->messages[list_pos].location = H5SM_IN_HEAP; @@ -1340,7 +1328,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") if(defer) { @@ -1351,7 +1339,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * return a heap ID, since a message with a reference count greater * than 1 is always shared in the heap. */ - if((bt2_find = H5B2_find(bt2, dxpl_id, &key, NULL, NULL)) < 0) + if((bt2_find = H5B2_find(bt2, &key, NULL, NULL)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "can't search for message in index") found = (hbool_t)bt2_find; } /* end if */ @@ -1360,14 +1348,13 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Set up callback info */ op_data.key = &key; - op_data.dxpl_id = dxpl_id; /* If this returns failure, it means that the message wasn't found. */ /* If it succeeds, set the heap_id in the shared struct. It will * return a heap ID, since a message with a reference count greater * than 1 is always shared in the heap. */ - if(H5B2_modify(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { + if(H5B2_modify(bt2, &key, H5SM__incr_ref, &op_data) >= 0) { shared.u.heap_id = op_data.fheap_id; found = TRUE; } /* end if */ @@ -1444,7 +1431,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(!defer) { /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + if(H5HF_insert(fheap, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") key.message.location = H5SM_IN_HEAP; @@ -1459,7 +1446,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Check whether the list has grown enough that it needs to become a B-tree */ if(header->index_type == H5SM_LIST && header->num_messages >= header->list_max) - if(H5SM_convert_list_to_btree(f, header, &list, fheap, open_oh, dxpl_id) < 0) + if(H5SM__convert_list_to_btree(f, header, &list, fheap, open_oh) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to convert list to B-tree") /* Insert the new message into the SOHM index */ @@ -1485,11 +1472,11 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Open the index v2 B-tree, if it isn't already */ if(NULL == bt2) { - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_insert(bt2, dxpl_id, &key) < 0) + if(H5B2_insert(bt2, &key) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") } /* end else */ @@ -1508,20 +1495,20 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, done: /* Release the fractal heap & v2 B-tree if we opened them */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") /* If we got a list out of the cache, release it (it is always dirty after writing a message) */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, defer ? H5AC__NO_FLAGS_SET : H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, defer ? H5AC__NO_FLAGS_SET : H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_write_mesg() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__write_mesg() */ /*------------------------------------------------------------------------- @@ -1543,7 +1530,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) +H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg) { H5SM_master_table_t *table = NULL; unsigned cache_flags = H5AC__NO_FLAGS_SET; @@ -1554,7 +1541,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) unsigned type_id; /* Message type ID to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(H5F_addr_defined(H5F_SOHM_ADDR(f))); @@ -1567,7 +1554,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1578,11 +1565,11 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * zero and any file space it uses needs to be freed. mesg_buf holds the * serialized form of the message. */ - if(H5SM_delete_from_index(f, dxpl_id, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) + if(H5SM__delete_from_index(f, open_oh, &(table->indexes[index_num]), sh_mesg, &cache_flags, &mesg_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) + if(H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") table = NULL; @@ -1591,16 +1578,16 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) * master table needs to be unprotected when we do this. */ if(mesg_buf) { - if(NULL == (native_mesg = H5O_msg_decode(f, dxpl_id, open_oh, type_id, (const unsigned char *)mesg_buf))) + if(NULL == (native_mesg = H5O_msg_decode(f, open_oh, type_id, (const unsigned char *)mesg_buf))) HGOTO_ERROR(H5E_SOHM, H5E_CANTDECODE, FAIL, "can't decode shared message.") - if(H5O_msg_delete(f, dxpl_id, open_oh, type_id, native_mesg) < 0) + if(H5O_msg_delete(f, open_oh, type_id, native_mesg) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "can't delete shared message.") } /* end if */ done: /* Release the master SOHM table (should only happen on error) */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") /* Release any native message we decoded */ @@ -1611,7 +1598,7 @@ done: if(mesg_buf) mesg_buf = H5MM_xfree(mesg_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_delete() */ @@ -1713,7 +1700,7 @@ H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) /*------------------------------------------------------------------------- - * Function: H5SM_decr_ref + * Function: H5SM__decr_ref * * Purpose: Decrement the reference count for a SOHM message. Doesn't * remove the record from the B-tree even if the refcount @@ -1732,11 +1719,11 @@ H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) +H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *) record; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(record); HDassert(op_data); @@ -1755,11 +1742,11 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) *(H5SM_sohm_t *)op_data = *message; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_decr_ref() */ +} /* end H5SM__decr_ref() */ /*------------------------------------------------------------------------- - * Function: H5SM_delete_from_index + * Function: H5SM__delete_from_index * * Purpose: Decrement the reference count for a particular message in this * index. If the reference count reaches zero, allocate a buffer @@ -1776,9 +1763,8 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) *------------------------------------------------------------------------- */ static herr_t -H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, const H5O_shared_t *mesg, - unsigned *cache_flags, void ** /*out*/ encoded_mesg) +H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, + const H5O_shared_t *mesg, unsigned *cache_flags, void ** /*out*/ encoded_mesg) { H5SM_list_t *list = NULL; H5SM_mesg_key_t key; @@ -1791,7 +1777,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id; /* Message type to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -1804,7 +1790,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, type_id = mesg->msg_type_id; /* Open the heap for this type of message. */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get the message size and encoded message for the message to be deleted, @@ -1823,12 +1809,11 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, } /* end else */ /* Get the encoded message */ - if(H5SM_read_mesg(f, &key.message, fheap, open_oh, dxpl_id, &buf_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &key.message, fheap, open_oh, &buf_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up key for message to be deleted. */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding = encoding_buf; key.encoding_size = buf_size; @@ -1844,7 +1829,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -1864,13 +1849,13 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* If this returns failure, it means that the message wasn't found. * If it succeeds, a copy of the modified message will be returned. */ - if(H5B2_modify(bt2, dxpl_id, &key, H5SM_decr_ref, &message) < 0) + if(H5B2_modify(bt2, &key, H5SM__decr_ref, &message) < 0) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") /* Point to the message */ @@ -1894,17 +1879,17 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, else { /* Open the index v2 B-tree, if it isn't already */ if(NULL == bt2) { - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") } /* end if */ - if(H5B2_remove(bt2, dxpl_id, &key, NULL, NULL) < 0) + if(H5B2_remove(bt2, &key, NULL, NULL) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to delete message from index") } /* end else */ /* Remove the message from the heap if it was stored in the heap*/ if(old_loc == H5SM_IN_HEAP) - if(H5HF_remove(fheap, dxpl_id, &(message_ptr->u.heap_loc.fheap_id)) < 0) + if(H5HF_remove(fheap, &(message_ptr->u.heap_loc.fheap_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTREMOVE, FAIL, "unable to remove message from heap") @@ -1915,37 +1900,37 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, if(header->num_messages == 0) { /* Unprotect cache and release heap */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") list = NULL; HDassert(fheap); - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") fheap = NULL; /* Delete the index and its heap */ - if(H5SM_delete_index(f, header, dxpl_id, TRUE) < 0) + if(H5SM__delete_index(f, header, TRUE) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "can't delete empty index") } /* end if */ else if(header->index_type == H5SM_BTREE && header->num_messages < header->btree_min) { /* Otherwise, if we've just passed the btree-to-list cutoff, convert * this B-tree into a list */ - if(H5SM_convert_btree_to_list(f, header, dxpl_id) < 0) + if(H5SM__convert_btree_to_list(f, header) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to convert btree to list") } /* end if */ } /* end if */ done: /* Release the SOHM list */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") /* Release the fractal heap & v2 B-tree if we opened them */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") /* Free the message encoding, if we're not returning it in encoded_mesg @@ -1954,8 +1939,8 @@ done: if(encoding_buf && (NULL == *encoded_mesg || ret_value < 0)) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_delete_from_index() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__delete_from_index() */ /*------------------------------------------------------------------------- @@ -1971,18 +1956,17 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) +H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) { H5F_t *f = ext_loc->file; /* File pointer (convenience variable) */ H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table */ - H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ unsigned tmp_sohm_nindexes; /* Number of shared messages indexes in the table */ htri_t status; /* Status for message existing */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(ext_loc); @@ -1990,7 +1974,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDassert(fc_plist); /* Check for the extension having a 'shared message info' message */ - if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0) + if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "unable to read object header") if(status) { H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ @@ -2001,7 +1985,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) unsigned u; /* Local index variable */ /* Retrieve the 'shared message info' structure */ - if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table, dxpl_id)) + if(NULL == H5O_msg_read(ext_loc, H5O_SHMESG_ID, &sohm_table)) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "shared message info message not present") /* Portably initialize the arrays */ @@ -2019,11 +2003,10 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) cache_udata.f = f; /* Set the ring type in the DXPL */ - if(H5AC_set_ring(dxpl_id, H5AC_RING_USER, &dxpl, &orig_ring) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set ring value") + H5AC_set_ring(H5AC_RING_USER, &orig_ring); /* Read the rest of the SOHM table information from the cache */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ @@ -2073,15 +2056,15 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) } /* end else */ done: - /* Reset the ring in the DXPL */ - if(H5AC_reset_ring(dxpl, orig_ring) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "unable to set property value") + /* Reset the ring in the API context */ + if(orig_ring != H5AC_RING_INV) + H5AC_set_ring(orig_ring, NULL); /* Release the master SOHM table if we took it out of the cache */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_info() */ @@ -2163,8 +2146,8 @@ H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) *------------------------------------------------------------------------- */ herr_t -H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, - const H5O_shared_t *sh_mesg, hsize_t *ref_count) +H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, + hsize_t *ref_count) { H5HF_t *fheap = NULL; /* Fractal heap that contains shared messages */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ @@ -2179,7 +2162,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, void * encoding_buf = NULL; /* Buffer for encoded message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -2190,7 +2173,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2199,7 +2182,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, header = &(table->indexes[index_num]); /* Open the heap for this message type */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, header->heap_addr))) + if(NULL == (fheap = H5HF_open(f, header->heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up a SOHM message to correspond to the shared message passed in */ @@ -2208,12 +2191,11 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, key.message.u.heap_loc.ref_count = 0; /* Ref count isn't needed to find message */ /* Get the encoded message */ - if(H5SM_read_mesg(f, &key.message, fheap, NULL, dxpl_id, &buf_size, &encoding_buf) < 0) + if(H5SM__read_mesg(f, &key.message, fheap, NULL, &buf_size, &encoding_buf) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Set up key for message to locate */ key.file = f; - key.dxpl_id = dxpl_id; key.fheap = fheap; key.encoding = encoding_buf; key.encoding_size = buf_size; @@ -2229,7 +2211,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, lst_cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -2248,11 +2230,11 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") /* Look up the message in the v2 B-tree */ - if((msg_exists = H5B2_find(bt2, dxpl_id, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) + if((msg_exists = H5B2_find(bt2, &key, H5SM_get_refcount_bt2_cb, &message)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "error finding message in index") if(!msg_exists) HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "message not in index") @@ -2264,23 +2246,23 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") if(encoding_buf) encoding_buf = H5MM_xfree(encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_get_refcount() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_iter_op + * Function: H5SM__read_iter_op * * Purpose: OH iteration callback to get the encoded version of a message * by index. @@ -2298,13 +2280,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, +H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, unsigned H5_ATTR_UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Check arguments. @@ -2338,13 +2320,13 @@ H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_read_iter_op() */ +} /* end H5SM__read_iter_op() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_mesg_fh_cb + * Function: H5SM__read_mesg_fh_cb * - * Purpose: Callback for H5HF_op, used in H5SM_read_mesg below. + * Purpose: Callback for H5HF_op, used in H5SM__read_mesg below. * Makes a copy of the message in the heap data, returned in the * UDATA struct. * @@ -2356,12 +2338,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) +H5SM__read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *)_udata; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate a buffer to hold the message */ if(NULL == (udata->encoding_buf = H5MM_malloc(obj_len))) @@ -2373,11 +2355,11 @@ H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_read_mesg_fh_cb() */ +} /* end H5SM__read_mesg_fh_cb() */ /*------------------------------------------------------------------------- - * Function: H5SM_read_mesg + * Function: H5SM__read_mesg * * Purpose: Given an H5SM_sohm_t sohm, encodes the message into a buffer. * This buffer should then be freed. @@ -2390,16 +2372,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, - H5O_t *open_oh, hid_t dxpl_id, size_t *encoding_size /*out*/, - void ** encoded_mesg /*out*/) +H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, + H5O_t *open_oh, size_t *encoding_size /*out*/, void ** encoded_mesg /*out*/) { H5SM_read_udata_t udata; /* User data for callbacks */ H5O_loc_t oloc; /* Object location for message in object header */ H5O_t *oh = NULL; /* Object header for message in object header */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(H5AC__SOHM_TAG) HDassert(f); HDassert(mesg); @@ -2434,7 +2415,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "unable to open object header") /* Load the object header from the cache */ - if(NULL == (oh = H5O_protect(&oloc, dxpl_id, H5AC__READ_ONLY_FLAG, FALSE))) + if(NULL == (oh = H5O_protect(&oloc, H5AC__READ_ONLY_FLAG, FALSE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load object header") } /* end if */ else @@ -2442,15 +2423,15 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, /* Use the "real" iterate routine so it doesn't try to protect the OH */ op.op_type = H5O_MESG_OP_LIB; - op.u.lib_op = H5SM_read_iter_op; - if((ret_value = H5O_msg_iterate_real(f, oh, type, &op, &udata, dxpl_id)) < 0) + op.u.lib_op = H5SM__read_iter_op; + if((ret_value = H5O__msg_iterate_real(f, oh, type, &op, &udata)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADITER, FAIL, "unable to iterate over object header messages") } /* end if */ else { HDassert(mesg->location == H5SM_IN_HEAP); /* Copy the message from the heap */ - if(H5HF_op(fheap, dxpl_id, &(mesg->u.heap_loc.fheap_id), H5SM_read_mesg_fh_cb, &udata) < 0) + if(H5HF_op(fheap, &(mesg->u.heap_loc.fheap_id), H5SM__read_mesg_fh_cb, &udata) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "can't read message from fractal heap.") } /* end else */ HDassert(udata.encoding_buf); @@ -2463,7 +2444,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, done: /* Close the object header if we opened one and had an error */ if(oh && oh != open_oh) { - if(oh && H5O_unprotect(&oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) + if(oh && H5O_unprotect(&oloc, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") if(H5O_close(&oloc, NULL) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close object header") @@ -2473,8 +2454,8 @@ done: if(ret_value < 0 && udata.encoding_buf) udata.encoding_buf = H5MM_xfree(udata.encoding_buf); - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_read_mesg */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__read_mesg */ /*------------------------------------------------------------------------- @@ -2550,16 +2531,15 @@ H5SM_list_free(H5SM_list_t *list) *------------------------------------------------------------------------- */ herr_t -H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, - FILE *stream, int indent, int fwidth, - unsigned table_vers, unsigned num_indexes) +H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, + int fwidth, unsigned table_vers, unsigned num_indexes) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(table_addr != HADDR_UNDEF); @@ -2589,7 +2569,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") HDfprintf(stream, "%*sShared Message Master Table...\n", indent, ""); @@ -2617,10 +2597,10 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, } /* end for */ done: - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_table_debug() */ @@ -2639,8 +2619,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, - int indent, int fwidth, haddr_t table_addr) +H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, + int fwidth, haddr_t table_addr) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ @@ -2651,7 +2631,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(list_addr != HADDR_UNDEF); @@ -2663,7 +2643,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, table_addr, &tbl_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Determine which index the list is part of */ @@ -2682,12 +2662,12 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, lst_cache_udata.header = &(table->indexes[index_num]); /* Get the list from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, H5AC_SOHM_LIST, list_addr, &lst_cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Open the heap, if one exists */ if(H5F_addr_defined(table->indexes[index_num].heap_addr)) - if(NULL == (fh = H5HF_open(f, dxpl_id, table->indexes[index_num].heap_addr))) + if(NULL == (fh = H5HF_open(f, table->indexes[index_num].heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open SOHM heap") HDfprintf(stream, "%*sShared Message List Index...\n", indent, ""); @@ -2721,14 +2701,14 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, FILE *stream, } /* end for */ done: - if(fh && H5HF_close(fh, dxpl_id) < 0) + if(fh && H5HF_close(fh) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close SOHM heap") - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) + if(list && H5AC_unprotect(f, H5AC_SOHM_LIST, list_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, table_addr, table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_list_debug() */ @@ -2749,7 +2729,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) +H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info) { H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ @@ -2758,7 +2738,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); @@ -2770,7 +2750,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ @@ -2782,14 +2762,14 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) if(table->indexes[u].index_type == H5SM_BTREE) { if(H5F_addr_defined(table->indexes[u].index_addr)) { /* Open the index v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl_id, table->indexes[u].index_addr, f))) + if(NULL == (bt2 = H5B2_open(f, table->indexes[u].index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") - if(H5B2_size(bt2, dxpl_id, &(ih_info->index_size)) < 0) + if(H5B2_size(bt2, &(ih_info->index_size)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't retrieve B-tree storage info") /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl_id) < 0) + if(H5B2_close(bt2) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") bt2 = NULL; } /* end if */ @@ -2802,15 +2782,15 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) /* Check for heap for this index */ if(H5F_addr_defined(table->indexes[u].heap_addr)) { /* Open the fractal heap for this index */ - if(NULL == (fheap = H5HF_open(f, dxpl_id, table->indexes[u].heap_addr))) + if(NULL == (fheap = H5HF_open(f, table->indexes[u].heap_addr))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open fractal heap") /* Get heap storage size */ - if(H5HF_size(fheap, dxpl_id, &(ih_info->heap_size)) < 0) + if(H5HF_size(fheap, &(ih_info->heap_size)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't retrieve fractal heap storage info") /* Close the fractal heap */ - if(H5HF_close(fheap, dxpl_id) < 0) + if(H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") fheap = NULL; } /* end if */ @@ -2818,13 +2798,13 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) done: /* Release resources */ - if(fheap && H5HF_close(fheap, dxpl_id) < 0) + if(fheap && H5HF_close(fheap) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") - if(bt2 && H5B2_close(bt2, dxpl_id) < 0) + if(bt2 && H5B2_close(bt2) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) + FUNC_LEAVE_NOAPI_TAG(ret_value) } /* end H5SM_ih_size() */ diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 7df9f8f..ad84b24 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -236,7 +236,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) */ if(mesg->location == H5SM_IN_HEAP) { /* Call heap op routine with comparison callback */ - if(H5HF_op(key->fheap, key->dxpl_id, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) + if(H5HF_op(key->fheap, &(mesg->u.heap_loc.fheap_id), H5SM_compare_cb, &udata) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPARE, FAIL, "can't compare btree2 records") } /* end if */ else { @@ -261,7 +261,7 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) /* Locate the right message and compare with it */ op.op_type = H5O_MESG_OP_LIB; op.u.lib_op = H5SM_compare_iter_op; - if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata, key->dxpl_id) < 0) + if(H5O_msg_iterate(&oloc, mesg->msg_type_id, &op, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over links") } /* end else */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 6dea7ae..a9a4fd9 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -199,7 +199,6 @@ struct H5SM_master_table_t { /* Typedef for searching an index (list or B-tree) */ typedef struct { H5F_t *file; /* File in which sharing is happening */ - hid_t dxpl_id; /* DXPL for sharing messages in heap */ H5HF_t *fheap; /* The heap for this message type, open. */ void *encoding; /* The message encoded, or NULL */ size_t encoding_size; /* Size of the encoding, or 0 */ @@ -224,7 +223,6 @@ typedef struct { typedef struct { H5SM_mesg_key_t *key; /* IN: key for message being incremented */ H5O_fheap_id_t fheap_id; /* OUT: fheap ID of record */ - hid_t dxpl_id; } H5SM_incr_ref_opdata; /* v2 B-tree client callback context */ @@ -280,8 +278,7 @@ herr_t H5SM_list_free(H5SM_list_t *list); /* Testing functions */ #ifdef H5SM_TESTING -H5_DLL herr_t H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, - size_t *mesg_count); +H5_DLL herr_t H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count); #endif /* H5SM_TESTING */ #endif /* _H5SMpkg_H */ diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 8f9f533..e6776f3 100644 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -47,32 +47,27 @@ typedef struct H5SM_master_table_t H5SM_master_table_t; /******************************/ /* Generally useful shared message routines */ -H5_DLL herr_t H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, - const H5O_loc_t *ext_loc, hid_t dxpl_id); -H5_DLL htri_t H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, +H5_DLL herr_t H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, const H5O_loc_t *ext_loc); +H5_DLL htri_t H5SM_can_share(H5F_t *f, H5SM_master_table_t *table, ssize_t *sohm_index_num, unsigned type_id, const void *mesg); -H5_DLL htri_t H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned defer_flags, unsigned type_id, void *mesg, unsigned *mesg_flags); -H5_DLL herr_t H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5O_shared_t *sh_mesg); -H5_DLL herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, - hid_t dxpl_id); -H5_DLL htri_t H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id); -H5_DLL herr_t H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, - haddr_t *fheap_addr); +H5_DLL htri_t H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, + unsigned type_id, void *mesg, unsigned *mesg_flags); +H5_DLL herr_t H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg); +H5_DLL herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist); +H5_DLL htri_t H5SM_type_shared(H5F_t *f, unsigned type_id); +H5_DLL herr_t H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr); H5_DLL herr_t H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, H5O_fheap_id_t heap_id); -H5_DLL herr_t H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, +H5_DLL herr_t H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize_t *ref_count); -H5_DLL herr_t H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info); +H5_DLL herr_t H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info); /* Debugging routines */ -H5_DLL herr_t H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, - FILE *stream, int indent, int fwidth, unsigned table_vers, - unsigned num_indexes); -H5_DLL herr_t H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, - FILE *stream, int indent, int fwidth, haddr_t table_addr); +H5_DLL herr_t H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, + int indent, int fwidth, unsigned table_vers, unsigned num_indexes); +H5_DLL herr_t H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, + int indent, int fwidth, haddr_t table_addr); #endif /*_H5SMprivate_H*/ diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 6a4b63a..490265c 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -62,7 +62,7 @@ /*------------------------------------------------------------------------- - * Function: H5SM_get_mesg_count_test + * Function: H5SM__get_mesg_count_test * * Purpose: Retrieve the number of messages tracked of a certain type * @@ -74,13 +74,12 @@ *------------------------------------------------------------------------- */ herr_t -H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, - size_t *mesg_count) +H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count) { H5SM_master_table_t *table = NULL; /* SOHM master table */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC__SOHM_TAG) /* Sanity check */ HDassert(f); @@ -96,7 +95,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ @@ -113,9 +112,9 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") - FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5SM_get_mesg_count_test() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5SM__get_mesg_count_test() */ diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index c9103f7..f3b8f4b 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -86,8 +86,7 @@ *------------------------------------------------------------------------- */ herr_t -H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, - int fwidth) +H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth) { const H5S_t *mesg = (const H5S_t*)_mesg; @@ -107,8 +106,7 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, case H5S_SIMPLE: fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, "Space class:"); - H5O_debug_id(H5O_SDSPACE_ID, f, dxpl_id, &(mesg->extent), stream, - indent + 3, MAX(0, fwidth - 3)); + H5O_debug_id(H5O_SDSPACE_ID, f, &(mesg->extent), stream, indent + 3, MAX(0, fwidth - 3)); break; case H5S_NO_CLASS: diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index f125035..d62a1b6 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -208,10 +208,9 @@ H5_DLL hbool_t H5S_has_extent(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[]/*out*/, hsize_t max_dims[]/*out*/); -H5_DLL herr_t H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, - H5S_t *ds); -H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, H5S_t *ds); -H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id); +H5_DLL herr_t H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds); +H5_DLL herr_t H5S_append(H5F_t *f, struct H5O_t *oh, H5S_t *ds); +H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc); H5_DLL htri_t H5S_set_extent(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_simple(H5S_t *space, unsigned rank, @@ -222,11 +221,8 @@ H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], H5_DLL herr_t H5S_set_latest_version(H5S_t *ds); H5_DLL herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); H5_DLL H5S_t *H5S_decode(const unsigned char **p); -H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); -#ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +H5_DLL herr_t H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, + int fwidth); /* Operations on dataspace extents */ H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); diff --git a/src/H5T.c b/src/H5T.c index a525cd5..d4d67f1 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ @@ -291,12 +292,17 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id); -static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, - H5T_t *dst, H5T_conv_t func, hid_t dxpl_id, hbool_t api_call); -static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst); -static herr_t H5T_set_size(H5T_t *dt, size_t size); +static herr_t H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_lib_conv_t func); +static herr_t H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_conv_func_t *conv); +static herr_t H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, + H5T_t *dst, H5T_conv_t func); +static htri_t H5T__compiler_conv(H5T_t *src, H5T_t *dst); +static herr_t H5T__set_size(H5T_t *dt, size_t size); +static herr_t H5T__close_cb(H5T_t *dt); +static H5T_path_t *H5T__path_find_real(const H5T_t *src, const H5T_t *dst, + const char *name, H5T_conv_func_t *conv); /*****************************/ @@ -533,10 +539,10 @@ H5FL_DEFINE_STATIC(H5T_path_t); /* Datatype ID class */ static const H5I_class_t H5I_DATATYPE_CLS[1] = {{ - H5I_DATATYPE, /* ID class value */ - 0, /* Class flags */ - 8, /* # of reserved IDs for class */ - (H5I_free_t)H5T_close /* Callback routine for closing objects of this class */ + H5I_DATATYPE, /* ID class value */ + 0, /* Class flags */ + 8, /* # of reserved IDs for class */ + (H5I_free_t)H5T__close_cb /* Callback routine for closing objects of this class */ }}; /* Flag indicating "top" of interface has been initialized */ @@ -732,7 +738,7 @@ H5T__init_package(void) H5T_t *objref=NULL; /* Datatype structure for object reference objects */ hsize_t dim[1]={1}; /* Dimension info for array datatype */ herr_t status; - unsigned copied_dtype=1; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ + hbool_t copied_dtype = TRUE; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1004,24 +1010,24 @@ H5T__init_package(void) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; - status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T__conv_array, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i); + status |= H5T__register_int(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f); + status |= H5T__register_int(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f); + status |= H5T__register_int(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i); + status |= H5T__register_int(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s); + status |= H5T__register_int(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b); + status |= H5T__register_int(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order); + status |= H5T__register_int(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order); + status |= H5T__register_int(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct); + status |= H5T__register_int(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt); + status |= H5T__register_int(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum); + status |= H5T__register_int(H5T_PERS_SOFT, "enum_i", enum_type, fixedpt, H5T__conv_enum_numeric); + status |= H5T__register_int(H5T_PERS_SOFT, "enum_f", enum_type, floatpt, H5T__conv_enum_numeric); + status |= H5T__register_int(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen); + status |= H5T__register_int(H5T_PERS_SOFT, "array", array, array, H5T__conv_array); + status |= H5T__register_int(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt); /* * Native conversions should be listed last since we can use hardware to @@ -1032,221 +1038,221 @@ H5T__init_package(void) */ /* floating point */ - status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float); #if H5_SIZEOF_LONG_DOUBLE != 0 - status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double); #endif /* H5_SIZEOF_LONG_DOUBLE != 0 */ /* from long long */ - status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong); + status |= H5T__register_int(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int); + status |= H5T__register_int(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar); /* From long */ - status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong); + status |= H5T__register_int(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long); + status |= H5T__register_int(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short); + status |= H5T__register_int(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int); + status |= H5T__register_int(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint); + status |= H5T__register_int(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar); + status |= H5T__register_int(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar); /* From short */ - status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong); + status |= H5T__register_int(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long); + status |= H5T__register_int(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short); + status |= H5T__register_int(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int); + status |= H5T__register_int(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint); + status |= H5T__register_int(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar); + status |= H5T__register_int(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar); /* From int */ - status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong); + status |= H5T__register_int(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long); + status |= H5T__register_int(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short); + status |= H5T__register_int(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint); + status |= H5T__register_int(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int); + status |= H5T__register_int(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar); + status |= H5T__register_int(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar); + status |= H5T__register_int(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar); /* From char */ - status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int); + status |= H5T__register_int(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint); + status |= H5T__register_int(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar); /* From char to floats */ - status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float); + status |= H5T__register_int(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double); + status |= H5T__register_int(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble); /* From unsigned char to floats */ - status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double); + status |= H5T__register_int(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble); /* From short to floats */ - status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float); + status |= H5T__register_int(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double); + status |= H5T__register_int(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble); /* From unsigned short to floats */ - status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double); + status |= H5T__register_int(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble); /* From int to floats */ - status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float); + status |= H5T__register_int(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double); + status |= H5T__register_int(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble); /* From unsigned int to floats */ - status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float); + status |= H5T__register_int(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double); + status |= H5T__register_int(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble); /* From long to floats */ - status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float); + status |= H5T__register_int(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double); + status |= H5T__register_int(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble); /* From unsigned long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double); + status |= H5T__register_int(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble); /* From long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float); + status |= H5T__register_int(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double); #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble); #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double); #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ /* From floats to char */ - status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar); /* From floats to unsigned char */ - status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar); /* From floats to short */ - status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short); /* From floats to unsigned short */ - status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort); /* From floats to int */ - status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int); /* From floats to unsigned int */ - status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint); /* From floats to long */ - status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long); /* From floats to unsigned long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong); /* From floats to long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong); #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_noio_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong); #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ /* @@ -1254,7 +1260,7 @@ H5T__init_package(void) * data types we use are not important as long as the source and * destination are equal. */ - status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_noio_dxpl_id, FALSE); + status |= H5T__register_int(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop); /* Initialize the +/- Infinity values for floating-point types */ status |= H5T__init_inf(); @@ -1282,20 +1288,20 @@ H5T__init_package(void) done: /* General cleanup */ if(compound != NULL) - H5T_close(compound); + (void)H5T_close_real(compound); if(enum_type != NULL) - H5T_close(enum_type); + (void)H5T_close_real(enum_type); if(vlen != NULL) - H5T_close(vlen); + (void)H5T_close_real(vlen); if(array != NULL) - H5T_close(array); + (void)H5T_close_real(array); /* Error cleanup */ if(ret_value < 0) { if(dt) { - /* Check if we should call H5T_close or H5FL_FREE */ + /* Check if we should call H5T_close_real or H5FL_FREE */ if(copied_dtype) - H5T_close(dt); + (void)H5T_close_real(dt); else { dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); dt = H5FL_FREE(H5T_t, dt); @@ -1371,27 +1377,41 @@ H5T_top_term_package(void) path = H5T_g.path[i]; HDassert(path); - if(path->func) { + if(path->conv.u.app_func) { H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; - if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL,H5AC_noio_dxpl_id) < 0) { + if(path->conv.is_app) { + if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function " - "0x%08lx failed to free private data for " - "%s (ignored)\n", - (unsigned long)(path->func), path->name); - } /* end if */ + if (H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function " + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->conv.u.app_func), path->name); + } /* end if */ #endif - H5E_clear_stack(NULL); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ } /* end if */ + else { + if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { +#ifdef H5T_DEBUG + if (H5DEBUG(T)) { + fprintf(H5DEBUG(T), "H5T: conversion function " + "0x%08lx failed to free private data for " + "%s (ignored)\n", + (unsigned long)(path->conv.u.lib_func), path->name); + } /* end if */ +#endif + H5E_clear_stack(NULL); /*ignore the error*/ + } /* end if */ + } /* end else */ } /* end if */ if(path->src) - H5T_close(path->src); + (void)H5T_close_real(path->src); if(path->dst) - H5T_close(path->dst); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); H5T_g.path[i] = NULL; } /* end for */ @@ -1645,14 +1665,14 @@ H5Tcopy(hid_t type_id) H5T_t *new_dt = NULL; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", type_id); switch(H5I_get_type(type_id)) { case H5I_DATATYPE: /* The argument is a datatype handle */ if(NULL == (dt = (H5T_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype") break; case H5I_DATASET: @@ -1661,9 +1681,9 @@ H5Tcopy(hid_t type_id) /* The argument is a dataset handle */ if(NULL == (dset = (H5D_t *)H5I_object(type_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a dataset") if(NULL == (dt = H5D_typeof(dset))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get the dataset datatype") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, H5I_INVALID_HID, "unable to get the dataset datatype") } break; @@ -1682,21 +1702,21 @@ H5Tcopy(hid_t type_id) case H5I_ERROR_STACK: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype or dataset") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype or dataset") } /* end switch */ /* Copy datatype */ if(NULL == (new_dt = H5T_copy(dt, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy"); /* Atomize result */ if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype atom") done: if(ret_value < 0) - if(new_dt && H5T_close(new_dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release datatype info") + if(new_dt && H5T_close_real(new_dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release datatype info") FUNC_LEAVE_API(ret_value) } /* end H5Tcopy() */ @@ -1717,6 +1737,7 @@ herr_t H5Tclose(hid_t type_id) { H5T_t *dt; /* Pointer to datatype to close */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -1727,12 +1748,18 @@ H5Tclose(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if(H5T_STATE_IMMUTABLE == dt->shared->state) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; /* When the reference count reaches zero the resources are freed */ if(H5I_dec_app_ref(type_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tclose() */ @@ -1777,8 +1804,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Tlock * - * Purpose: Locks a type, making it read only and non-destructable. This - * is normally done by the library for predefined datatypes so + * Purpose: Locks a type, making it read only and non-destructable. + * This is normally done by the library for predefined datatypes so * the application doesn't inadvertently change or delete a * predefined type. * @@ -2159,7 +2186,7 @@ H5Tset_size(hid_t type_id, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) + if(H5T__set_size(dt, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for datatype") done: @@ -2188,20 +2215,20 @@ H5Tget_super(hid_t type) H5T_t *super = NULL; /* Supertype */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", type); if(NULL == (dt = (H5T_t *)H5I_object_verify(type,H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a datatype") if(NULL == (super = H5T_get_super(dt))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "not a datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "not a datatype") if((ret_value = H5I_register(H5I_DATATYPE, super, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register parent datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register parent datatype") done: if(ret_value < 0) - if(super && H5T_close(super) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release super datatype info") + if(super && H5T_close_real(super) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "unable to release super datatype info") FUNC_LEAVE_API(ret_value) } /* end H5Tget_super() */ @@ -2242,7 +2269,47 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_register + * Function: H5T__register_int + * + * Purpose: Register a library internal datatype conversion routine. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Wednesday, March 7, 1998 + *------------------------------------------------------------------------- + */ +static herr_t +H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_lib_conv_t func) +{ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + /* Check args */ + HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); + HDassert(name && *name); + HDassert(src); + HDassert(dst); + HDassert(func); + + /* Set up conversion function wrapper */ + conv_func.is_app = FALSE; + conv_func.u.lib_func = func; + + /* Register conversion */ + if(H5T__register(pers, name, src, dst, &conv_func) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to register internal datatype conversion routine") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T__register_int() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__register * * Purpose: Register a hard or soft conversion function for a data type * conversion path. The path is specified by the source and @@ -2260,8 +2327,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id, hbool_t api_call) +H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_conv_func_t *conv) { hid_t tmp_sid = -1, tmp_did = -1; /*temporary data type IDs */ H5T_path_t *old_path = NULL; /*existing conversion path */ @@ -2271,12 +2338,12 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, int i; /*counter */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(src); HDassert(dst); - HDassert(func); + HDassert(conv); HDassert(H5T_PERS_HARD==pers || H5T_PERS_SOFT==pers); HDassert(name && *name); @@ -2284,7 +2351,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Only bother to register the path if it's not a no-op path (for this machine) */ if(H5T_cmp(src, dst, FALSE)) { /* Locate or create a new conversion path */ - if(NULL == (new_path = H5T_path_find(src, dst, name, func, dxpl_id, api_call))) + if(NULL == (new_path = H5T__path_find_real(src, dst, name, conv))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path") /* @@ -2314,7 +2381,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_g.soft[H5T_g.nsoft].name[H5T_NAMELEN - 1] = '\0'; H5T_g.soft[H5T_g.nsoft].src = src->shared->type; H5T_g.soft[H5T_g.nsoft].dst = dst->shared->type; - H5T_g.soft[H5T_g.nsoft].func = func; + H5T_g.soft[H5T_g.nsoft].conv = *conv; H5T_g.nsoft++; /* @@ -2322,29 +2389,38 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, * conversion function applies should be replaced by a new path that * uses this function. */ - for (i=1; iis_hard || - old_path->src->shared->type!=src->shared->type || - old_path->dst->shared->type!=dst->shared->type) { + if(old_path->is_hard || + old_path->src->shared->type != src->shared->type || + old_path->dst->shared->type != dst->shared->type) continue; - } + if((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), FALSE)) < 0 || (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data types for conv query") HDmemset(&cdata, 0, sizeof cdata); cdata.command = H5T_CONV_INIT; - if((func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, - NULL, NULL, dxpl_id) < 0) { - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); - tmp_sid = tmp_did = -1; - H5E_clear_stack(NULL); - continue; + if(conv->is_app) { + if((conv->u.app_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + H5I_dec_ref(tmp_sid); + H5I_dec_ref(tmp_did); + tmp_sid = tmp_did = -1; + H5E_clear_stack(NULL); + continue; + } /* end if */ } /* end if */ + else + if((conv->u.lib_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { + H5I_dec_ref(tmp_sid); + H5I_dec_ref(tmp_did); + tmp_sid = tmp_did = -1; + H5E_clear_stack(NULL); + continue; + } /* end if */ /* Create a new conversion path */ if(NULL == (new_path = H5FL_CALLOC(H5T_path_t))) @@ -2354,7 +2430,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, if(NULL == (new_path->src = H5T_copy(old_path->src, H5T_COPY_ALL)) || NULL == (new_path->dst=H5T_copy(old_path->dst, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data types") - new_path->func = func; + new_path->conv = *conv; new_path->is_hard = FALSE; new_path->cdata = cdata; @@ -2365,18 +2441,27 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Free old path */ H5T__print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; - if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), - (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { + if(old_path->conv.is_app) { + if((old_path->conv.u.app_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " - "failed to free private data for %s (ignored)\n", - (unsigned long)(old_path->func), old_path->name); - } + if(H5DEBUG(T)) + fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " + "failed to free private data for %s (ignored)\n", + (unsigned long)(old_path->conv.u.app_func), old_path->name); #endif + } /* end if */ } /* end if */ - H5T_close(old_path->src); - H5T_close(old_path->dst); + else + if((old_path->conv.u.lib_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { +#ifdef H5T_DEBUG + if(H5DEBUG(T)) + fprintf (H5DEBUG(T), "H5T: conversion function 0x%08lx " + "failed to free private data for %s (ignored)\n", + (unsigned long)(old_path->conv.u.lib_func), old_path->name); +#endif + } /* end if */ + (void)H5T_close_real(old_path->src); + (void)H5T_close_real(old_path->dst); old_path = H5FL_FREE(H5T_path_t, old_path); /* Release temporary atoms */ @@ -2393,9 +2478,9 @@ done: if(ret_value < 0) { if(new_path) { if(new_path->src) - H5T_close(new_path->src); + (void)H5T_close_real(new_path->src); if(new_path->dst) - H5T_close(new_path->dst); + (void)H5T_close_real(new_path->dst); new_path = H5FL_FREE(H5T_path_t, new_path); } /* end if */ if(tmp_sid >= 0) @@ -2405,7 +2490,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_register() */ +} /* end H5T__register() */ /*------------------------------------------------------------------------- @@ -2429,10 +2514,12 @@ done: */ herr_t H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { H5T_t *src; /*source data type descriptor */ H5T_t *dst; /*destination data type desc */ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_API(FAIL) @@ -2449,45 +2536,51 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") if(!func) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no conversion function specified") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + + /* Set up conversion function wrapper */ + conv_func.is_app = TRUE; + conv_func.u.app_func = func; /* Go register the function */ - if(H5T_register(pers, name, src, dst, func, H5AC_noio_dxpl_id, TRUE) < 0) + if(H5T__register(pers, name, src, dst, &conv_func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register conversion function") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tregister() */ /*------------------------------------------------------------------------- - * Function: H5T_unregister + * Function: H5T__unregister * * Purpose: Removes conversion paths that match the specified criteria. * All arguments are optional. Missing arguments are wild cards. * The special no-op path cannot be removed. * * Return: Succeess: non-negative - * * Failure: negative * * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * Adapted to non-API function - QAK, 11/17/99 - * *------------------------------------------------------------------------- */ static herr_t -H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, - H5T_conv_t func, hid_t dxpl_id) +H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, + H5T_conv_t func) { H5T_path_t *path = NULL; /*conversion path */ H5T_soft_t *soft = NULL; /*soft conversion information */ int nprint = 0; /*number of paths shut down */ int i; /*counter */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Remove matching entries from the soft list */ if(H5T_PERS_DONTCARE == pers || H5T_PERS_SOFT == pers) { @@ -2500,7 +2593,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, continue; if(dst && dst->shared->type != soft->dst) continue; - if(func && func != soft->func) + if(func && func != soft->conv.u.app_func) continue; HDmemmove(H5T_g.soft + i, H5T_g.soft + i + 1, (size_t)(H5T_g.nsoft - (i + 1)) * sizeof(H5T_soft_t)); @@ -2519,7 +2612,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, (name && *name && HDstrcmp(name, path->name)) || (src && H5T_cmp(src, path->src, FALSE)) || (dst && H5T_cmp(dst, path->dst, FALSE)) || - (func && func!=path->func)) { + (func && func != path->conv.u.app_func)) { /* * Notify all other functions to recalculate private data since some * functions might cache a list of conversion functions. For @@ -2537,25 +2630,34 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Shut down path */ H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; - if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), - (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(path->conv.is_app) { + if((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed " - "to free private data for %s (ignored)\n", - (unsigned long)(path->func), path->name); - } + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed " + "to free private data for %s (ignored)\n", + (unsigned long)(path->conv.u.app_func), path->name); #endif - } - H5T_close(path->src); - H5T_close(path->dst); + } /* end if */ + } /* end if */ + else + if((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { +#ifdef H5T_DEBUG + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx failed " + "to free private data for %s (ignored)\n", + (unsigned long)(path->conv.u.lib_func), path->name); +#endif + } /* end if */ + (void)H5T_close_real(path->src); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); H5E_clear_stack(NULL); /*ignore all shutdown errors*/ } /* end else */ } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_unregister() */ +} /* end H5T__unregister() */ /*------------------------------------------------------------------------- @@ -2576,9 +2678,10 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, */ herr_t H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, - H5T_conv_t func) + H5T_conv_t func) { H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2589,11 +2692,17 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "src is not a data type") if(dst_id > 0 && (NULL == (dst = (H5T_t *)H5I_object_verify(dst_id, H5I_DATATYPE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dst is not a data type") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; - if(H5T_unregister(pers, name, src, dst, func, H5AC_noio_dxpl_id) < 0) + if(H5T__unregister(pers, name, src, dst, func) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "internal unregister function failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tunregister() */ @@ -2634,14 +2743,14 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer") /* Find it */ - if(NULL == (path = H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (path = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found") if(pcdata) *pcdata = &(path->cdata); /* Set return value */ - ret_value = path->func; + ret_value = path->conv.u.app_func; done: FUNC_LEAVE_API(ret_value) @@ -2680,7 +2789,7 @@ H5Tcompiler_conv(hid_t src_id, hid_t dst_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") /* Find it */ - if((ret_value = H5T_compiler_conv(src, dst)) < 0) + if((ret_value = H5T__compiler_conv(src, dst)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") done: @@ -2717,6 +2826,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, { H5T_path_t *tpath; /* type conversion info */ H5T_t *src, *dst; /* unatomized types */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -2731,15 +2841,23 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, else if(TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset transfer property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set DXPL for operation */ +H5CX_set_dxpl(dxpl_id); /* Find the conversion function */ - if(NULL == (tpath = H5T_path_find(src, dst, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types") - if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background, dxpl_id) < 0) + if(H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tconvert() */ @@ -2925,7 +3043,7 @@ H5T_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATATYPE, H5E_VERSION, NULL, "unknown version of encoded datatype") /* Decode the serialized datatype message */ - if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, H5AC_noio_dxpl_id, NULL, H5O_DTYPE_ID, buf))) + if(NULL == (ret_value = (H5T_t *)H5O_msg_decode(f, NULL, H5O_DTYPE_ID, buf))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, NULL, "can't decode object") /* Mark datatype as being in memory now */ @@ -2985,7 +3103,7 @@ H5T__create(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); /* Modify the datatype */ - if(H5T_set_size(dt, size) < 0) + if(H5T__set_size(dt, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") } break; @@ -3476,7 +3594,7 @@ done: * * Purpose: Frees all memory associated with a datatype, but does not * free the H5T_t or H5T_shared_t structures (which should - * be done in H5T_close). + * be done in H5T_close / H5T_close_real). * * Return: Non-negative on success/Negative on failure * @@ -3495,25 +3613,6 @@ H5T__free(H5T_t *dt) HDassert(dt && dt->shared); - /* - * If a named type is being closed then close the object header and - * remove from the list of open objects in the file. - */ - if(H5T_STATE_OPEN == dt->shared->state) { - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); - HDassert(H5F_addr_defined(dt->sh_loc.u.loc.oh_addr)); - HDassert(H5F_addr_defined(dt->oloc.addr)); - - /* Remove the datatype from the list of opened objects in the file */ - if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dt->sh_loc.file, H5AC_ind_read_dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't remove datatype from list of open objects") - if(H5O_close(&dt->oloc, NULL) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close data type object header") - dt->shared->state = H5T_STATE_NAMED; - } /* end if */ - /* Free the ID to name info */ H5G_name_free(&(dt->path)); @@ -3528,7 +3627,7 @@ H5T__free(H5T_t *dt) case H5T_COMPOUND: for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { dt->shared->u.compnd.memb[i].name = (char *)H5MM_xfree(dt->shared->u.compnd.memb[i].name); - H5T_close(dt->shared->u.compnd.memb[i].type); + (void)H5T_close_real(dt->shared->u.compnd.memb[i].type); } /* end for */ dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_xfree(dt->shared->u.compnd.memb); dt->shared->u.compnd.nmembs = 0; @@ -3563,7 +3662,7 @@ H5T__free(H5T_t *dt) /* Close the parent */ HDassert(dt->shared->parent != dt); - if(dt->shared->parent && H5T_close(dt->shared->parent) < 0) + if(dt->shared->parent && H5T_close_real(dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") dt->shared->parent = NULL; @@ -3573,15 +3672,87 @@ done: /*------------------------------------------------------------------------- + * Function: H5T_close_real + * + * Purpose: Frees a datatype and all associated memory. + * + * Hote: Does _not_ deal with open hamed datatypes, etc. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Monday, February 12, 2018 + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_close_real(H5T_t *dt) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(dt && dt->shared); + + /* Clean up resources, depending on shared state */ + if(dt->shared->state != H5T_STATE_OPEN) { + if(H5T__free(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); + + dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); + } /* end if */ + else + /* Free the group hier. path since we're not calling H5T__free() */ + H5G_name_free(&(dt->path)); + + /* Free the 'top' datatype struct */ + dt = H5FL_FREE(H5T_t, dt); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_close_real() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__close_cb + * + * Purpose: Callback routine for closing a datatype ID. Closes the datatype + * object that was attached to the ID. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__close_cb(H5T_t *dt) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* check args */ + HDassert(dt && dt->shared); + + /* Call actual datatype close routine */ + if(H5T_close(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype"); + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__close_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5T_close * - * Purpose: Frees a data type and all associated memory. If the data - * type is locked then nothing happens. + * Purpose: Frees a data type and all associated memory. Deals with + * open named datatypes appropriately. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Monday, December 8, 1997 + * Programmer: Robb Matzke + * Monday, December 8, 1997 * *------------------------------------------------------------------------- */ @@ -3592,40 +3763,49 @@ H5T_close(H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) + /* Sanity check */ HDassert(dt && dt->shared); - if(dt->shared->state == H5T_STATE_OPEN) + /* Named datatype cleanups */ + if(dt->shared->state == H5T_STATE_OPEN) { + /* Decrement refcount count on open named datatype */ dt->shared->fo_count--; - if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 0) { - /* Uncork cache entries with object address tag for named datatype only */ - if(dt->shared->state == H5T_STATE_OPEN && dt->shared->fo_count == 0) { - hbool_t corked; /* Whether the named datatype is corked or not */ + /* Sanity checks */ + HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + HDassert(H5F_addr_defined(dt->sh_loc.u.loc.oh_addr)); + HDassert(H5F_addr_defined(dt->oloc.addr)); + + /* + * If a named type is being closed then close the object header and + * remove from the list of open objects in the file. + */ + + /* Decrement the ref. count for this object in the top file */ + if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + /* Close things down if this is the last reference to the open named datatype */ + if(0 == dt->shared->fo_count) { + hbool_t corked; /* Whether the named datatype is corked or not */ + + /* Uncork cache entries with object address tag for named datatype */ if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__GET_CORKED, &corked) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve an object's cork status") if(corked) if(H5AC_cork(dt->oloc.file, dt->oloc.addr, H5AC__UNCORK, NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTUNCORK, FAIL, "unable to uncork an object") - } /* end if */ - - if(H5T__free(dt) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); - - dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); - } /* end if */ - else { - /* - * If a named type is being closed then close the object header and - * remove from the list of open objects in the file. - */ - if(H5T_STATE_OPEN == dt->shared->state) { - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); - /* Decrement the ref. count for this object in the top file */ - if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + /* Remove the datatype from the list of opened objects in the file */ + if(H5FO_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't remove datatype from list of open objects") + if(H5O_close(&dt->oloc, NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close data type object header") + /* Mark named datatype closed now */ + dt->shared->state = H5T_STATE_NAMED; + } /* end if */ + else { /* Check reference count for this object in the top file */ if(H5FO_top_count(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) == 0) { /* Close object location for named datatype */ @@ -3633,18 +3813,15 @@ H5T_close(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ else - /* Free object location (i.e. "unhold" the file if appropriate) - */ + /* Free object location (i.e. "unhold" the file if appropriate) */ if(H5O_loc_free(&(dt->oloc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location") - } /* end if */ - - /* Free the group hier. path since we're not calling H5T__free() */ - H5G_name_free(&(dt->path)); - } /* end else */ + } /* end else */ + } /* end if */ - /* Free the datatype struct */ - dt = H5FL_FREE(H5T_t, dt); + /* Clean up resources */ + if(H5T_close_real(dt) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to free datatype"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3652,7 +3829,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_set_size + * Function: H5T__set_size * * Purpose: Sets the total size in bytes for a data type (this operation * is not permitted on reference data types). If the size is @@ -3675,19 +3852,15 @@ done: * Programmer: Robb Matzke * Tuesday, December 22, 1998 * - * Modifications: - * Robb Matzke, 22 Dec 1998 - * Also works with derived data types. - * *------------------------------------------------------------------------- */ static herr_t -H5T_set_size(H5T_t *dt, size_t size) +H5T__set_size(H5T_t *dt, size_t size) { size_t prec, offset; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dt); @@ -3695,8 +3868,8 @@ H5T_set_size(H5T_t *dt, size_t size) HDassert(H5T_REFERENCE!=dt->shared->type); HDassert(!(H5T_ENUM==dt->shared->type && 0==dt->shared->u.enumer.nmembs)); - if (dt->shared->parent) { - if (H5T_set_size(dt->shared->parent, size)<0) + if(dt->shared->parent) { + if(H5T__set_size(dt->shared->parent, size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set size for parent data type"); /* Adjust size of datatype appropriately */ @@ -3704,7 +3877,7 @@ H5T_set_size(H5T_t *dt, size_t size) dt->shared->size = dt->shared->parent->shared->size * dt->shared->u.array.nelem; else if(dt->shared->type!=H5T_VLEN) dt->shared->size = dt->shared->parent->shared->size; - } + } /* end if */ else { if (H5T_IS_ATOMIC(dt->shared)) { offset = dt->shared->u.atomic.offset; @@ -3718,12 +3891,11 @@ H5T_set_size(H5T_t *dt, size_t size) offset = 8 * size - prec; if (prec > 8*size) prec = 8 * size; - } - else { + } /* end if */ + else prec = offset = 0; - } - switch (dt->shared->type) { + switch(dt->shared->type) { case H5T_INTEGER: case H5T_TIME: case H5T_BITFIELD: @@ -3748,20 +3920,20 @@ H5T_set_size(H5T_t *dt, size_t size) if(memb_offset > max_offset) { max_offset = memb_offset; max_index = i; - } - } + } /* end if */ + } /* end for */ max_size = H5T__get_member_size(dt, max_index); if(size < (max_offset + max_size)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); - } + } /* end if */ /* Compound must not have been packed previously */ /* We will check if resizing changed the packed state of * this type at the end of this function */ HDassert(!dt->shared->u.compnd.packed); - } + } /* end if */ break; @@ -3801,8 +3973,7 @@ H5T_set_size(H5T_t *dt, size_t size) /* Set up VL information */ if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype location"); - - } + } /* end if */ else { prec = 8 * size; offset = 0; @@ -3814,11 +3985,11 @@ H5T_set_size(H5T_t *dt, size_t size) * The sign, mantissa, and exponent fields should be adjusted * first when decreasing the size of a floating point type. */ - if (dt->shared->u.atomic.u.f.sign >= prec+offset || + if(dt->shared->u.atomic.u.f.sign >= prec+offset || dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset || dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first"); - } + } /* end if */ break; case H5T_ENUM: @@ -3827,14 +3998,16 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_REFERENCE: HDassert("can't happen" && 0); break; + case H5T_NO_CLASS: case H5T_NCLASSES: HDassert("invalid type" && 0); break; + default: HDassert("not implemented yet" && 0); break; - } + } /* end switch */ /* Commit (if we didn't convert this type to a VL string) */ if(dt->shared->type != H5T_VLEN) { @@ -3842,17 +4015,17 @@ H5T_set_size(H5T_t *dt, size_t size) if (H5T_IS_ATOMIC(dt->shared)) { dt->shared->u.atomic.offset = offset; dt->shared->u.atomic.prec = prec; - } + } /* end if */ } /* end if */ /* Check if the new compound type is packed */ if(dt->shared->type == H5T_COMPOUND) H5T__update_packed(dt); - } + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__set_size() */ /*------------------------------------------------------------------------- @@ -4348,6 +4521,53 @@ done: /*------------------------------------------------------------------------- * Function: H5T_path_find * + * Purpose: Library-internal wrapper to find the path which converts type + * SRC_ID to type DST_ID. + * + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. + * + * Return: Success: Pointer to the path, valid until the path + * database is modified. + * + * Failure: NULL if the path does not exist and no + * function can be found to apply to the new path. + * + * Programmer: Quincey Koziol + * Monday, March 5, 2018 + * + *------------------------------------------------------------------------- + */ +H5T_path_t * +H5T_path_find(const H5T_t *src, const H5T_t *dst) +{ + H5T_conv_func_t conv_func; /* Conversion function wrapper */ + H5T_path_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Sanity check */ + HDassert(src); + HDassert(src->shared); + HDassert(dst); + HDassert(dst->shared); + + /* Set up conversion function wrapper */ + conv_func.is_app = FALSE; + conv_func.u.lib_func = NULL; + + /* Call the internal routine, with additional parameters */ + if(NULL == (ret_value = H5T__path_find_real(src, dst, NULL, &conv_func))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't find datatype conversion path") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_path_find() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__path_find_real + * * Purpose: Finds the path which converts type SRC_ID to type DST_ID, * creating a new path if necessary. If FUNC is non-zero then * it is set as the hard conversion function for that path @@ -4361,30 +4581,19 @@ done: * first path in the path table. * * Return: Success: Pointer to the path, valid until the path - * database is modified. + * database is modified. * * Failure: NULL if the path does not exist and no - * function can be found to apply to the new - * path. + * function can be found to apply to the new path. * - * Programmer: Robb Matzke - * Tuesday, January 13, 1998 - * - * Modifications: - * Added a parameter IS_API to indicate whether to an API - * function issued a call to this function. If a API - * function like H5Tregister() is calling this function to - * register a new hard conversion function, IS_API is TRUE - * and the old path is replaced. If a private function like - * H5T__init_package() is trying to register hard conversions, - * IS_API is FALSE and the old hard path is not replaced. - * Tuesday, Sept 13, 2005 + * Programmer: Robb Matzke + * Tuesday, January 13, 1998 * *------------------------------------------------------------------------- */ -H5T_path_t * -H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, - H5T_conv_t func, hid_t dxpl_id, hbool_t is_api) +static H5T_path_t * +H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, + H5T_conv_func_t *conv) { int lt, rt; /* left and right edges */ int md; /* middle */ @@ -4397,7 +4606,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, int nprint = 0; /* lines of output printed */ H5T_path_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC /* Sanity check */ HDassert(src); @@ -4415,12 +4624,13 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); - H5T_g.path[0]->func = H5T__conv_noop; + H5T_g.path[0]->conv.is_app = FALSE; + H5T_g.path[0]->conv.u.lib_func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) - fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); + fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); #endif H5E_clear_stack(NULL); /*ignore the error*/ } /* end if */ @@ -4474,7 +4684,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * specifying a new hard conversion and the path is a soft conversion, then * create a new path and add the new function to the path. */ - if(!table || (table && func && is_api) || (table && !table->is_hard && func && !is_api)) { + if(!table || (table && conv->is_app && conv->u.app_func) || (table && !table->is_hard && !conv->is_app && conv->u.lib_func)) { if(NULL == (path = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for type conversion path") if(name && *name) { @@ -4497,22 +4707,27 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * the existing path is a soft function, then add the new conversion to the path * and initialize its conversion data. */ - if(func && (!table || (table && is_api) || (table && !table->is_hard && !is_api))) { + if(conv->u.app_func && (!table || (table && conv->is_app) || (table && !table->is_hard && !conv->is_app))) { HDassert(path != table); - HDassert(NULL == path->func); + HDassert(NULL == path->conv.u.app_func); if(path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") if(path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register destination conversion type for query") path->cdata.command = H5T_CONV_INIT; - if((func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") + if(conv->is_app) { + if((conv->u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") + } /* end if */ + else + if((conv->u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function") if(src_id >= 0) H5I_dec_ref(src_id); if(dst_id >= 0) H5I_dec_ref(dst_id); src_id = dst_id = -1; - path->func = func; + path->conv = *conv; path->is_hard = TRUE; } /* end if */ @@ -4522,8 +4737,10 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, * for an applicable function and add it to the path. This can't happen * for the no-op conversion path. */ - HDassert(path->func || (src && dst)); - for(i = H5T_g.nsoft - 1; i >= 0 && !path->func; --i) { + HDassert(path->conv.u.app_func || (src && dst)); + for(i = H5T_g.nsoft - 1; i >= 0 && !path->conv.u.app_func; --i) { + hbool_t path_init_error = FALSE; + if(src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) continue; if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) @@ -4531,21 +4748,32 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register dst conversion type for query") path->cdata.command = H5T_CONV_INIT; - if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { - HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + if(H5T_g.soft[i].conv.is_app) { + if((H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + path_init_error = TRUE; + } /* end if */ } /* end if */ - else { + else + if((H5T_g.soft[i].conv.u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { + HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + path_init_error = TRUE; + } /* end if */ + + /* Finish operation, if no error */ + if(!path_init_error) { HDstrncpy(path->name, H5T_g.soft[i].name, (size_t)H5T_NAMELEN); path->name[H5T_NAMELEN - 1] = '\0'; - path->func = H5T_g.soft[i].func; + path->conv = H5T_g.soft[i].conv; path->is_hard = FALSE; } /* end else */ H5I_dec_ref(src_id); H5I_dec_ref(dst_id); src_id = dst_id = -1; } /* end for */ - if(!path->func) + if(!path->conv.u.app_func) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path") /* Check if paths were inserted into the table through a recursive call @@ -4576,24 +4804,33 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, HDassert(table == H5T_g.path[md]); H5T__print_stats(table, &nprint/*in,out*/); table->cdata.command = H5T_CONV_FREE; - if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(table->conv.is_app) { + if((table->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG - if(H5DEBUG(T)) { - fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " - "failed for %s (ignored)\n", - (unsigned long)(path->func), path->name); - } /* end if */ + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n", + (unsigned long)(path->conv.u.app_func), path->name); #endif - H5E_clear_stack(NULL); /*ignore the failure*/ + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ } /* end if */ + else + if((table->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { +#ifdef H5T_DEBUG + if(H5DEBUG(T)) + fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free failed for %s (ignored)\n", + (unsigned long)(path->conv.u.lib_func), path->name); +#endif + H5E_clear_stack(NULL); /*ignore the failure*/ + } /* end if */ if(table->src) - H5T_close(table->src); + (void)H5T_close_real(table->src); if(table->dst) - H5T_close(table->dst); + (void)H5T_close_real(table->dst); table = H5FL_FREE(H5T_path_t, table); table = path; H5T_g.path[md] = path; - } + } /* end if */ else if(path != table) { HDassert(cmp); if((size_t)H5T_g.npaths >= H5T_g.apaths) { @@ -4624,9 +4861,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, done: if(!ret_value && path && path != table) { if(path->src) - H5T_close(path->src); + (void)H5T_close_real(path->src); if(path->dst) - H5T_close(path->dst); + (void)H5T_close_real(path->dst); path = H5FL_FREE(H5T_path_t, path); } /* end if */ if(src_id >= 0) @@ -4635,7 +4872,7 @@ done: H5I_dec_ref(dst_id); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_path_find() */ +} /* end H5T__path_find_real() */ /*------------------------------------------------------------------------- @@ -4730,7 +4967,7 @@ H5T_path_bkg(const H5T_path_t *p) /*------------------------------------------------------------------------- - * Function: H5T_compiler_conv + * Function: H5T__compiler_conv * * Purpose: Private function for H5Tcompiler_conv. Finds out whether the * library's conversion function from type SRC to type DST @@ -4745,22 +4982,22 @@ H5T_path_bkg(const H5T_path_t *p) *------------------------------------------------------------------------- */ static htri_t -H5T_compiler_conv(H5T_t *src, H5T_t *dst) +H5T__compiler_conv(H5T_t *src, H5T_t *dst) { H5T_path_t *path; htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Find it */ - if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (path = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "conversion function not found") ret_value = (htri_t)path->is_hard; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__compiler_conv() */ /*------------------------------------------------------------------------- @@ -4776,64 +5013,42 @@ done: * Programmer: Robb Matzke * Tuesday, December 15, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * The timers are updated only if H5T debugging is enabled at - * runtime in addition to compile time. - * - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. - * - * Quincey Koziol, 1999-07-01 - * Added dataset transfer properties, to allow custom VL - * datatype allocation function to be passed down to VL - * conversion routine. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument which gets passed to all the - * conversion functions. If BUF_STRIDE is non-zero then each - * data element is at a multiple of BUF_STRIDE bytes in BUF - * (on both input and output). If BKG_STRIDE is also set then - * the BKG buffer is used in such a way that temporary space - * for each element is aligned on a BKG_STRIDE byte boundary. - * If either BUF_STRIDE or BKG_STRIDE are zero then the BKG - * buffer will be accessed as though it were a packed array - * of destination datatype. *------------------------------------------------------------------------- */ herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist) + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { #ifdef H5T_DEBUG H5_timer_t timer; #endif - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) #ifdef H5T_DEBUG - if (H5DEBUG(T)) H5_timer_begin(&timer); + if(H5DEBUG(T)) + H5_timer_begin(&timer); #endif tpath->cdata.command = H5T_CONV_CONV; - if ((tpath->func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, - bkg_stride, buf, bkg, dset_xfer_plist)<0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed"); + if(tpath->conv.is_app) { + if((tpath->conv.u.app_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, H5CX_get_dxpl()) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed") + } /* end if */ + else + if((tpath->conv.u.lib_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed") #ifdef H5T_DEBUG - if (H5DEBUG(T)) { + if(H5DEBUG(T)) { H5_timer_end(&(tpath->stats.timer), &timer); tpath->stats.ncalls++; tpath->stats.nelmts += nelmts; - } + } /* end if */ #endif done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T_convert() */ /*------------------------------------------------------------------------- @@ -5013,7 +5228,7 @@ H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to reset path") dt->shared->state = H5T_STATE_TRANSIENT; - } + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -5497,75 +5712,3 @@ H5T_patch_vlen_file(H5T_t *dt, H5F_t *f) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T_patch_vlen_file() */ - -/*------------------------------------------------------------------------- - * Function: H5Tflush - * - * Purpose: Flushes all buffers associated with a named datatype to disk. - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Mike McGreevy - * May 19, 2010 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Tflush(hid_t type_id) -{ - H5T_t *dt; /* Datatype for this operation */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE1("e", "i", type_id); - - /* Check args */ - if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(!H5T_is_named(dt)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") - - /* To flush metadata and invoke flush callback if there is */ - if(H5O_flush_common(&dt->oloc, type_id, H5AC_ind_read_dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype and object flush callback") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Tflush */ - - -/*------------------------------------------------------------------------- - * Function: H5Trefresh - * - * Purpose: Refreshes all buffers associated with a named datatype. - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Mike McGreevy - * July 21, 2010 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Trefresh(hid_t type_id) -{ - H5T_t * dt = NULL; - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(FAIL) - H5TRACE1("e", "i", type_id); - - /* Check args */ - if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if(!H5T_is_named(dt)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") - - /* Call private function to refresh datatype object */ - if ((H5O_refresh_metadata(type_id, dt->oloc, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") - -done: - FUNC_LEAVE_API(ret_value) -} /* H5Trefresh */ - diff --git a/src/H5TS.c b/src/H5TS.c index a0ca134..69fdbeb 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -34,6 +34,7 @@ H5TS_once_t H5TS_first_init_g = PTHREAD_ONCE_INIT; #endif /* H5_HAVE_WIN_THREADS */ H5TS_key_t H5TS_errstk_key_g; H5TS_key_t H5TS_funcstk_key_g; +H5TS_key_t H5TS_apictx_key_g; H5TS_key_t H5TS_cancel_key_g; @@ -109,6 +110,9 @@ H5TS_pthread_first_thread_init(void) /* initialize key for thread-specific function stacks */ pthread_key_create(&H5TS_funcstk_key_g, H5TS_key_destructor); + /* initialize key for thread-specific API contexts */ + pthread_key_create(&H5TS_apictx_key_g, H5TS_key_destructor); + /* initialize key for thread cancellability mechanism */ pthread_key_create(&H5TS_cancel_key_g, H5TS_key_destructor); } @@ -356,6 +360,10 @@ H5TS_win32_process_enter(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContex) ret_value = FALSE; #endif /* H5_HAVE_CODESTACK */ + /* Set up thread local storage */ + if(TLS_OUT_OF_INDEXES == (H5TS_apictx_key_g = TlsAlloc())) + ret_value = FALSE; + return ret_value; } /* H5TS_win32_process_enter() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -426,6 +434,9 @@ H5TS_win32_process_exit(void) TlsFree(H5TS_funcstk_key_g); #endif /* H5_HAVE_CODESTACK */ + /* Clean up per-process thread local storage */ + TlsFree(H5TS_apictx_key_g); + return; } /* H5TS_win32_process_exit() */ #endif /* H5_HAVE_WIN_THREADS */ @@ -469,6 +480,11 @@ H5TS_win32_thread_exit(void) LocalFree((HLOCAL)lpvData); #endif /* H5_HAVE_CODESTACK */ + /* Clean up per-thread thread local storage */ + lpvData = TlsGetValue(H5TS_apictx_key_g); + if(lpvData) + LocalFree((HLOCAL)lpvData); + return ret_value; } /* H5TS_win32_thread_exit() */ #endif /* H5_HAVE_WIN_THREADS */ diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index e5c41af..8d74676 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -109,6 +109,7 @@ typedef pthread_once_t H5TS_once_t; extern H5TS_once_t H5TS_first_init_g; extern H5TS_key_t H5TS_errstk_key_g; extern H5TS_key_t H5TS_funcstk_key_g; +extern H5TS_key_t H5TS_apictx_key_g; #if defined c_plusplus || defined __cplusplus extern "C" diff --git a/src/H5Tarray.c b/src/H5Tarray.c index beccfdb..60b3d43 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -100,33 +100,32 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "iIu*h", base_id, ndims, dim); /* Check args */ if(ndims < 1 || ndims > H5S_MAX_RANK) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality") if(!dim) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified") for(u = 0; u < ndims; u++) if(!(dim[u] > 0)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified") if(NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype") /* Create the array datatype */ if(NULL == (dt = H5T__array_create(base, ndims, dim))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype") /* Atomize the type */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(ret_value < 0) { - if(dt && H5T_close(dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype") - } /* end if */ + if(ret_value < 0) + if(dt && H5T_close_real(dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype") FUNC_LEAVE_API(ret_value) } /* end H5Tarray_create2() */ @@ -356,33 +355,32 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE4("i", "iIs*h*Is", base_id, ndims, dim, perm); /* Check args */ if(ndims < 1 || ndims > H5S_MAX_RANK) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimensionality") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid dimensionality") if(!dim) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no dimensions specified") for(u = 0; u < (unsigned)ndims; u++) if(!(dim[u] > 0)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "zero-sized dimension specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "zero-sized dimension specified") if(NULL == (base = (H5T_t *)H5I_object_verify(base_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an valid base datatype") /* Create the array datatype */ if(NULL == (dt = H5T__array_create(base, (unsigned)ndims, dim))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to create datatype") /* Atomize the type */ if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(ret_value < 0) { - if(dt && H5T_close(dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't release datatype") - } /* end if */ + if(ret_value < 0) + if(dt && H5T_close_real(dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, H5I_INVALID_HID, "can't release datatype") FUNC_LEAVE_API(ret_value) } /* end H5Tarray_create1() */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 30fbeeb..57e6271 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -28,6 +28,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ @@ -55,7 +56,11 @@ /********************/ /* Local Prototypes */ /********************/ -static H5T_t *H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id); +static herr_t H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id); +static hid_t H5T__get_create_plist(const H5T_t *type); +static H5T_t *H5T__open_oid(const H5G_loc_t *loc); +static herr_t H5T__flush(H5T_t *dt, hid_t type_id); +static herr_t H5T__refresh(H5T_t *dt, hid_t type_id); /*********************/ @@ -98,7 +103,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -126,15 +131,21 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Commit the type */ - if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id, tapl_id, dxpl_id) < 0) + if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit2() */ @@ -154,14 +165,14 @@ done: */ herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, - hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id) + hid_t lcpl_id, hid_t tcpl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5T_obj_create_t tcrt_info; /* Information for named datatype creation */ H5T_state_t old_state; /* The state of the datatype before H5T__commit. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE + FUNC_ENTER_PACKAGE_VOL /* Sanity checks */ HDassert(loc); @@ -169,8 +180,6 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, HDassert(dt); HDassert(lcpl_id != H5P_DEFAULT); HDassert(tcpl_id != H5P_DEFAULT); - HDassert(tapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); /* Record the type's state so that we can revert to it if linking fails */ old_state = dt->shared->state; @@ -185,7 +194,7 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, ocrt_info.new_obj = NULL; /* Create the new named datatype and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, tapl_id, dxpl_id) < 0) + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create and link to named datatype") HDassert(ocrt_info.new_obj); @@ -198,7 +207,7 @@ done: /* Remove the datatype from the list of opened objects in the file */ if(H5FO_top_decr(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(dt->sh_loc.file, dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) + if(H5FO_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") /* Close the datatype object */ @@ -206,7 +215,7 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Remove the datatype's object header from the file */ - if(H5O_delete(dt->sh_loc.file, dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) + if(H5O_delete(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") /* Mark datatype as being back in memory */ @@ -217,7 +226,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI_VOL(ret_value) } /* end H5T__commit_named() */ @@ -245,7 +254,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) { H5G_loc_t loc; /* Group location for location */ H5T_t *type = NULL; /* Datatype created */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -264,30 +273,67 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype creation property list") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, TRUE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Commit the type */ + if(H5T__commit_anon(loc.oloc->file, type, tcpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Tcommit_anon() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__commit_anon + * + * Purpose: Create an anonymous committed datatype. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, December 12, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id) +{ + H5O_loc_t *oloc; /* Object location for datatype */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity checks */ + HDassert(file); + HDassert(type); + HDassert(tcpl_id != H5P_DEFAULT); /* Commit the type */ - if(H5T__commit(loc.oloc->file, type, tcpl_id, dxpl_id) < 0) + if(H5T__commit(file, type, tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") /* Release the datatype's object header */ - { - H5O_loc_t *oloc; /* Object location for datatype */ - /* Get the new committed datatype's object location */ - if(NULL == (oloc = H5T_oloc(type))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype") + /* Get the new committed datatype's object location */ + if(NULL == (oloc = H5T_oloc(type))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get object location of committed datatype") - /* Decrement refcount on committed datatype's object header in memory */ - if(H5O_dec_rc_by_loc(oloc, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") - } /* end if */ + /* Decrement refcount on committed datatype's object header in memory */ + if(H5O_dec_rc_by_loc(oloc) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") done: - FUNC_LEAVE_API(ret_value) -} /* end H5Tcommit_anon() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__commit_anon() */ /*------------------------------------------------------------------------- @@ -304,7 +350,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) +H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) { H5O_loc_t temp_oloc; /* Temporary object header location */ H5G_name_t temp_path; /* Temporary path */ @@ -362,9 +408,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) * Create the object header and open it for write access. Insert the data * type message and then give the object header a name. */ - if(H5O_create(file, dxpl_id, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) + if(H5O_create(file, dtype_size, (size_t)1, tcpl_id, &temp_oloc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header") - if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type, dxpl_id) < 0) + if(H5O_msg_create(&temp_oloc, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, type) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message") /* Copy the new object header's location into the datatype, taking ownership of it */ @@ -398,11 +444,11 @@ done: H5G_name_free(&temp_path); } /* end if */ if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) { - if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0) + if(H5O_dec_rc_by_loc(&(type->oloc)) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") if(H5O_close(&(type->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") - if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0) + if(H5O_delete(file, type->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") type->sh_loc.type = H5O_SHARE_TYPE_UNSHARED; } /* end if */ @@ -486,7 +532,7 @@ H5T_committed(const H5T_t *type) *------------------------------------------------------------------------- */ int -H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) +H5T_link(const H5T_t *type, int adjust) { int ret_value = -1; /* Return value */ @@ -496,7 +542,7 @@ H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) HDassert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); /* Adjust the link count on the named datatype */ - if((ret_value = H5O_link(&type->oloc, adjust, dxpl_id)) < 0) + if((ret_value = H5O_link(&type->oloc, adjust)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_LINKCOUNT, FAIL, "unable to adjust named datatype link count") done: @@ -521,66 +567,44 @@ done: hid_t H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) { - H5T_t *type = NULL; /* Datatype opened in file */ + H5T_t *type = NULL; /* Datatype opened in file */ H5G_loc_t loc; /* Group location of object to open */ - H5G_name_t path; /* Datatype group hier. path */ - H5O_loc_t oloc; /* Datatype object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_loc_t type_loc; /* Group object for datatype */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datatype */ - hid_t ret_value = FAIL; /* Return value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE3("i", "i*si", loc_id, name, tapl_id); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") - /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&tapl_id, H5P_CLS_TACC, &dxpl_id, loc_id, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - - /* Set up datatype location to fill in */ - type_loc.oloc = &oloc; - type_loc.path = &path; - H5G_loc_reset(&type_loc); - - /* - * Find the named datatype object header and read the datatype message - * from it. - */ - if(H5G_loc_find(&loc, name, &type_loc/*out*/, tapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - obj_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_NAMED_DATATYPE) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Verify access property list and set up collective metadata if appropriate */ +if(H5CX_set_apl(&tapl_id, H5P_CLS_TACC, loc_id, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") /* Open it */ - if(NULL == (type = H5T_open(&type_loc, dxpl_id))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") + if(NULL == (type = H5T__open_name(&loc, name))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype") done: - if(ret_value < 0) { + /* Cleanup on error */ + if(ret_value < 0) if(type != NULL) - H5T_close(type); - else { - if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) - H5G_loc_free(&type_loc); - } /* end else */ - } /* end if */ + (void)H5T_close(type); +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen2() */ @@ -590,6 +614,9 @@ done: * * Purpose: Returns a copy of the datatype creation property list. * + * Note: There are no datatype creation properties currently, just + * object creation ones. + * * Return: Success: ID for a copy of the datatype creation * property list. The property list ID should be * released by calling H5Pclose(). @@ -604,11 +631,10 @@ done: hid_t H5Tget_create_plist(hid_t dtype_id) { - H5T_t *type; /* Datatype object for ID */ - H5P_genplist_t *tcpl_plist; /* Existing datatype creation propertty list */ - hid_t new_tcpl_id = FAIL; /* New datatype creation property list */ - herr_t status; /* Generic status value */ - hid_t ret_value; /* Return value */ + H5T_t *type; /* Datatype object for ID */ + herr_t status; /* Generic status value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = FAIL; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dtype_id); @@ -617,29 +643,169 @@ H5Tget_create_plist(hid_t dtype_id) if(NULL == (type = (H5T_t *)H5I_object_verify(dtype_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - /* Copy the default datatype creation property list */ - if(NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default creation property list") - if((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list") - /* Check if the datatype is committed */ if((status = H5T_committed(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't check whether datatype is committed") /* Retrieve further information, if the datatype is committed */ if(status > 0) { - H5P_genplist_t *new_plist; /* New datatype creation property list */ - - /* Get property list object for new TCPL */ - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; - /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&type->oloc, H5AC_ind_read_dxpl_id, new_plist) < 0) + /* Retrieve datatype creation properties */ + if((ret_value = H5T__get_create_plist(type)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") } /* end if */ +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* end H5Tget_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5Tflush + * + * Purpose: Flushes all buffers associated with a named datatype to disk. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * May 19, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Tflush(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Flush metadata for named datatype */ + if(H5T__flush(dt, type_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* H5Tflush */ + + +/*------------------------------------------------------------------------- + * Function: H5Trefresh + * + * Purpose: Refreshes all buffers associated with a named datatype. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * July 21, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Trefresh(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(type_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + + /* Call private function to refresh datatype object */ + if((H5T__refresh(dt, type_id)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") + FUNC_LEAVE_API(ret_value) +} /* H5Trefresh */ + + +/*------------------------------------------------------------------------- + * Function: H5T__get_create_plist + * + * Purpose: Returns a copy of the datatype creation property list. + * + * Note: There are no datatype creation properties currently, just + * object creation ones. + * + * Return: Success: ID for a copy of the datatype creation + * property list. The property list ID should be + * released by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Wednesday, December 13, 2017 + * + *------------------------------------------------------------------------- + */ +static hid_t +H5T__get_create_plist(const H5T_t *type) +{ + H5P_genplist_t *tcpl_plist; /* Existing datatype creation propertty list */ + H5P_genplist_t *new_plist; /* New datatype creation property list */ + hid_t new_tcpl_id = FAIL; /* New datatype creation property list */ + hid_t ret_value = FAIL; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(type); + + /* Copy the default datatype creation property list */ + if(NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "can't get default creation property list") + if((new_tcpl_id = H5P_copy_plist(tcpl_plist, TRUE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to copy the creation property list") + + /* Get property list object for new TCPL */ + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_tcpl_id))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "can't get property list") + + /* Retrieve any object creation properties */ + if(H5O_get_create_plist(&type->oloc, new_plist) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object creation info") + /* Set the return value */ ret_value = new_tcpl_id; @@ -649,8 +815,74 @@ done: if(H5I_dec_app_ref(new_tcpl_id) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to close temporary object") - FUNC_LEAVE_API(ret_value) -} /* end H5Tget_create_plist() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__get_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5T__open_name + * + * Purpose: Open a named datatype. + * + * Return: Success: Ptr to a new datatype. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Wednesday, December 13, 2017 + * + *------------------------------------------------------------------------- + */ +H5T_t * +H5T__open_name(const H5G_loc_t *loc, const char *name) +{ + H5T_t *dt = NULL; /* Datatype opened in file */ + H5G_name_t path; /* Datatype group hier. path */ + H5O_loc_t oloc; /* Datatype object location */ + H5G_loc_t type_loc; /* Group object for datatype */ + H5O_type_t obj_type; /* Type of object at location */ + hbool_t obj_found = FALSE; /* Object at 'name' found */ + H5T_t *ret_value = NULL; /* Return value */ + + FUNC_ENTER_PACKAGE_VOL + + /* Sanity check */ + HDassert(loc); + HDassert(name); + + /* Set up datatype location to fill in */ + type_loc.oloc = &oloc; + type_loc.path = &path; + H5G_loc_reset(&type_loc); + + /* + * Find the named datatype object header and read the datatype message + * from it. + */ + if(H5G_loc_find(loc, name, &type_loc/*out*/) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found") + obj_found = TRUE; + + /* Check that the object found is the correct type */ + if(H5O_obj_type(&oloc, &obj_type) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "can't get object type") + if(obj_type != H5O_TYPE_NAMED_DATATYPE) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "not a named datatype") + + /* Open it */ + if(NULL == (dt = H5T_open(&type_loc))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype") + + ret_value = dt; + +done: + /* Error cleanup */ + if(NULL == ret_value) + if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) + if(H5G_loc_free(&type_loc) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, NULL, "can't free location") + + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5T__open_name() */ /*------------------------------------------------------------------------- @@ -668,7 +900,7 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) +H5T_open(const H5G_loc_t *loc) { H5T_shared_t *shared_fo = NULL; H5T_t *dt = NULL; @@ -684,7 +916,7 @@ H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the datatype object */ - if(NULL == (dt = H5T_open_oid(loc, dxpl_id))) + if(NULL == (dt = H5T__open_oid(loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "not found") /* Add the datatype to the list of opened objects in the file */ @@ -771,7 +1003,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_open_oid + * Function: H5T__open_oid * * Purpose: Open a named datatype. * @@ -785,12 +1017,12 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) +H5T__open_oid(const H5G_loc_t *loc) { H5T_t *dt = NULL; /* Datatype from the file */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_TAG(loc->oloc->addr) HDassert(loc); @@ -799,7 +1031,7 @@ H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named datatype") /* Deserialize the datatype message into a datatype in memory */ - if(NULL == (dt = (H5T_t *)H5O_msg_read(loc->oloc, H5O_DTYPE_ID, NULL, dxpl_id))) + if(NULL == (dt = (H5T_t *)H5O_msg_read(loc->oloc, H5O_DTYPE_ID, NULL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to load type message from object header") /* Mark the type as named and open */ @@ -824,8 +1056,8 @@ done: if(dt == NULL) H5O_close(loc->oloc, NULL); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_open_oid() */ + FUNC_LEAVE_NOAPI_TAG(ret_value) +} /* end H5T__open_oid() */ /*------------------------------------------------------------------------- @@ -853,3 +1085,73 @@ H5T_update_shared(H5T_t *dt) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5T_update_shared() */ + +/*------------------------------------------------------------------------- + * Function: H5T__flush + * + * Purpose: Internal routine to flushes a named datatype to disk. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__flush(H5T_t *dt, hid_t type_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(dt); + + /* To flush metadata and invoke flush callback if there is */ + if(H5O_flush_common(&dt->oloc, type_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype and object flush callback") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__flush */ + + +/*------------------------------------------------------------------------- + * Function: H5T__refresh + * + * Purpose: Internal routine to refresh a named datatype. + * + * Note: This routine is needed so that there's a non-API routine + * that can set up VOL / SWMR info (which need a DXPL). + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * December 18, 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__refresh(H5T_t *dt, hid_t type_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC_VOL + + /* Sanity check */ + HDassert(dt); + + /* Call private function to refresh datatype object */ + if((H5O_refresh_metadata(type_id, dt->oloc)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* H5T__refresh */ + diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 169c146..3daf365 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -27,6 +27,7 @@ /* Headers */ /***********/ #include "H5private.h" /*generic functions */ +#include "H5CXprivate.h" /*API Contexts */ #include "H5Eprivate.h" /*error handling */ #include "H5Iprivate.h" /*ID functions */ #include "H5MMprivate.h" /*memory management */ @@ -213,25 +214,37 @@ H5Tget_member_type(hid_t type_id, unsigned membno) { H5T_t *dt; /* Datatype to query */ H5T_t *memb_dt = NULL; /* Member datatype */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "iIu", type_id, membno); /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a compound datatype") if(membno >= dt->shared->u.compnd.nmembs) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid member number") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + /* Retrieve the datatype for the member */ if(NULL == (memb_dt = H5T_get_member_type(dt, membno, H5T_COPY_REOPEN))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to retrieve member type") + + /* Get an ID for the datatype */ if((ret_value = H5I_register(H5I_DATATYPE, memb_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable register datatype atom") done: if(ret_value < 0) if(memb_dt && H5T_close(memb_dt) < 0) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype") + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tget_member_type() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 3f4b489..f3af9e1 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -26,6 +26,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -677,7 +678,6 @@ hbool_t s_mv, d_mv; /*move data to align it? */ \ ssize_t s_stride, d_stride; /*src and dst strides */ \ size_t safe; /*how many elements are safe to process in each pass */ \ - H5P_genplist_t *plist; /*Property list pointer */ \ H5T_conv_cb_t cb_struct; /*conversion callback structure */ \ \ switch (cdata->command) { \ @@ -722,13 +722,9 @@ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ - /* Get the plist structure */ \ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) \ - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") \ - \ /* Get conversion exception callback property */ \ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) \ - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \ + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") \ \ /* Get source and destination datatypes */ \ if(NULL == (st = (H5T_t *)H5I_object(src_id)) || NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ @@ -1039,9 +1035,9 @@ H5FL_BLK_DEFINE_STATIC(array_seq); */ herr_t H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cdata_t *cdata, - size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, + void H5_ATTR_UNUSED *background) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1082,15 +1078,13 @@ done: * Programmer: Robb Matzke * Friday, January 25, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1496,20 +1490,12 @@ done: * Programmer: Robb Matzke * Tuesday, January 13, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added the `stride' argument. If its value is non-zero then we - * stride through memory converting one value at each location; - * otherwise we assume that the values should be packed. - * - * Robb Matzke, 1999-06-16 - * Added support for bitfields. *------------------------------------------------------------------------- */ herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL; @@ -1603,18 +1589,12 @@ done: * Programmer: Robb Matzke * Thursday, May 20, 1999 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. *------------------------------------------------------------------------- */ herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background, hid_t dxpl_id) + void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t*)_buf; H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ @@ -1627,7 +1607,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t msb_pad_offset; /*offset for dest MSB padding */ size_t i; uint8_t *src_rev=NULL; /*order-reversed source buffer */ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -1683,13 +1662,9 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src->shared->size); @@ -1857,8 +1832,6 @@ done: * Programmer: Neil Fortner * Wednesday, October 1, 2008 * - * Modifications: - * *------------------------------------------------------------------------- */ static H5T_conv_struct_t * @@ -1908,16 +1881,9 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) * source member doesn't have a corresponding destination member * then the src2dst[i]=-1. * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 26, 1998 - * - * Modifications: - * Raymond Lu, 3 May 2007 - * Added the detection for a special optimization case when the - * source and destination members are a subset of each other, and - * the order is the same, and no conversion is needed. For example: + * Special optimization case when the source and destination + * members are a subset of each other, and the order is the same, + * and no conversion is needed. For example: * struct source { struct destination { * TYPE1 A; --> TYPE1 A; * TYPE2 B; --> TYPE2 B; @@ -1936,10 +1902,15 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) * The optimization is simply moving data to the appropriate * places in the buffer. * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 26, 1998 + * *------------------------------------------------------------------------- */ static herr_t -H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) +H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) { H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv); int *src2dst = NULL; @@ -2024,7 +1995,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) for(i = 0; i < src_nmembs; i++) { if(src2dst[i] >= 0) { - H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type, NULL, NULL, dxpl_id, FALSE); + H5T_path_t *tpath = H5T_path_find(src->shared->u.compnd.memb[i].type, dst->shared->u.compnd.memb[src2dst[i]].type); if(NULL == (priv->memb_path[i] = tpath)) { cdata->priv = H5T_conv_struct_free(priv); @@ -2151,7 +2122,7 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) */ herr_t H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ @@ -2187,7 +2158,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") - if(H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") break; @@ -2207,7 +2178,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDassert(priv); HDassert(bkg && cdata->need_bkg); - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") /* @@ -2261,8 +2232,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_convert(priv->memb_path[u], priv->src_memb_id[u], priv->dst_memb_id[src2dst[u]], (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ - xbuf + src_memb->offset, xbkg + dst_memb->offset, - dxpl_id) < 0) + xbuf + src_memb->offset, xbkg + dst_memb->offset) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") HDmemmove(xbuf + offset, xbuf + src_memb->offset, dst_memb->size); offset += dst_memb->size; @@ -2293,8 +2263,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_convert(priv->memb_path[i], priv->src_memb_id[i], priv->dst_memb_id[src2dst[i]], (size_t)1, (size_t)0, (size_t)0, /*no striding (packed array)*/ - xbuf + offset, xbkg + dst_memb->offset, - dxpl_id) < 0) + xbuf + offset, xbkg + dst_memb->offset) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") } /* end if */ else @@ -2358,37 +2327,7 @@ done: * * Copy BKG to BUF for all elements * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Thursday, January 22, 1998 - * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is - * non-zero then convert one value at each memory location - * advancing BUF_STRIDE bytes each time; otherwise assume both - * source and destination values are packed. - * - * Robb Matzke, 1999-06-16 - * If the source and destination data structs are the same size - * then we can convert on a field-by-field basis instead of an - * element by element basis. In other words, for all struct - * elements being converted by this function call, first convert - * all of the field1's, then all field2's, etc. This can - * drastically reduce the number of calls to H5T_convert() and - * thereby eliminate most of the conversion constant overhead. - * - * Robb Matzke, 2000-05-17 - * Added the BKG_STRIDE argument to fix a design bug. If - * BUF_STRIDE and BKG_STRIDE are both non-zero then each - * data element converted will be placed temporarily at a - * multiple of BKG_STRIDE in the BKG buffer; otherwise the - * BKG buffer is assumed to be a packed array of destination - * datatype. - * - * Raymond Lu, 3 May 2007 - * Optimize a special case when the source and destination members + * Special case when the source and destination members * are a subset of each other, and the order is the same, and no * conversion is needed. For example: * struct source { struct destination { @@ -2401,12 +2340,16 @@ done: * The optimization is simply moving data to the appropriate * places in the buffer. * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Thursday, January 22, 1998 + * *------------------------------------------------------------------------- */ herr_t H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, - void *_bkg, hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ @@ -2444,7 +2387,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype") /* Initialize data which is relatively constant */ - if(H5T_conv_struct_init(src, dst, cdata, dxpl_id) < 0) + if(H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; @@ -2500,7 +2443,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Update cached data if necessary */ - if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata, dxpl_id)<0) + if(cdata->recalc && H5T_conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); HDassert(priv); @@ -2565,7 +2508,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, xbkg = bkg + dst_memb->offset; if(H5T_convert(priv->memb_path[u], priv->src_memb_id[u], priv->dst_memb_id[src2dst[u]], nelmts, - buf_stride, bkg_stride, xbuf, xbkg, dxpl_id) < 0) + buf_stride, bkg_stride, xbuf, xbkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") for(elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbkg, xbuf, dst_memb->size); @@ -2601,7 +2544,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, xbkg = bkg + dst_memb->offset; if(H5T_convert(priv->memb_path[i], priv->src_memb_id[i], priv->dst_memb_id[src2dst[i]], nelmts, - buf_stride, bkg_stride, xbuf, xbkg, dxpl_id) < 0) + buf_stride, bkg_stride, xbuf, xbkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert compound datatype member") for(elmtno = 0; elmtno < nelmts; elmtno++) { HDmemmove(xbkg, xbuf, dst_memb->size); @@ -2645,8 +2588,6 @@ done: * Programmer: Robb Matzke * Monday, January 4, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -2792,8 +2733,8 @@ done: */ herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *bkg) { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ @@ -2801,7 +2742,6 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ size_t i; /*counters */ @@ -2879,13 +2819,9 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d = buf + (nelmts - 1) * dst->shared->size; } - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") for(i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { if(priv->length) { @@ -2990,7 +2926,7 @@ done: herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + void H5_ATTR_UNUSED *bkg) { H5T_t *src, *dst; /*src and dst datatypes */ H5T_t *src_parent; /*parent type for src */ @@ -3025,14 +2961,14 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne src_parent = src->shared->parent; - if(NULL == (tpath = H5T_path_find(src_parent, dst, NULL, NULL, dxpl_id, FALSE))) { + if(NULL == (tpath = H5T_path_find(src_parent, dst))) { HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype") } else if(!H5T_path_noop(tpath)) { if((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion") /* Convert the data */ - if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg, dxpl_id) < 0) + if(H5T_convert(tpath, src_parent_id, dst_id, nelmts, buf_stride, bkg_stride, _buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } break; @@ -3073,30 +3009,13 @@ done: * Programmer: Quincey Koziol * Wednesday, May 26, 1999 * - * Modifications: - * - * Quincey Koziol, 2 July, 1999 - * Enabled support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. - * - * Raymond Lu, 26 June, 2002 - * Background buffer is used for freeing heap objects storing - * old data. At this moment, it only frees the first level of - * VL datatype. It doesn't handle nested VL datatypes. - * - * Raymond Lu, 8 November 2011 - * I put a condition check to prevent the conversion of VL strings - * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ + H5T_vlen_alloc_info_t vl_alloc_info;/* VL allocation info */ H5T_path_t *tpath = NULL; /* Type conversion path */ hbool_t noop_conv = FALSE; /* Flag to indicate a noop conversion */ hbool_t write_to_file = FALSE; /* Flag to indicate writing to file */ @@ -3187,7 +3106,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_base_size = H5T_get_size(dst->shared->parent); /* Set up conversion path for base elements */ - if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent))) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") else if(!H5T_path_noop(tpath)) { if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || @@ -3208,7 +3127,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Get the allocation info */ - if(H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Set flags to indicate we are writing to or reading from the file */ @@ -3263,7 +3182,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Check for "nil" source sequence */ if((*(src->shared->u.vlen.isnull))(src->shared->u.vlen.f, s)) { /* Write "nil" sequence to destination location */ - if((*(dst->shared->u.vlen.setnull))(dst->shared->u.vlen.f, dxpl_id, d, b) < 0) + if((*(dst->shared->u.vlen.setnull))(dst->shared->u.vlen.f, d, b) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't set VL data to 'nil'") } /* end if */ else { @@ -3304,7 +3223,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Read in VL sequence */ - if((*(src->shared->u.vlen.read))(src->shared->u.vlen.f, dxpl_id, s, conv_buf, src_size) < 0) + if((*(src->shared->u.vlen.read))(src->shared->u.vlen.f, s, conv_buf, src_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL data") } /* end else */ @@ -3334,7 +3253,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(bg_hobjid.addr)); UINT32DECODE(tmp, bg_hobjid.idx); - if(NULL == H5HG_read(dst->shared->u.vlen.f, dxpl_id, &bg_hobjid, tmp_buf, NULL)) + if(NULL == H5HG_read(dst->shared->u.vlen.f, &bg_hobjid, tmp_buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "can't read VL sequence into background buffer") } /* end if */ @@ -3344,12 +3263,12 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ /* Convert VL sequence */ - if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ /* Write sequence to destination location */ - if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, dxpl_id, vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) + if((*(dst->shared->u.vlen.write))(dst->shared->u.vlen.f, &vl_alloc_info, d, conv_buf, b, seq_len, dst_base_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "can't write VL data") if(!noop_conv) { @@ -3366,7 +3285,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(parent_seq_len > 0) { H5F_addr_decode(dst->shared->u.vlen.f, &tmp, &(parent_hobjid.addr)); UINT32DECODE(tmp, parent_hobjid.idx); - if(H5HG_remove(dst->shared->u.vlen.f, dxpl_id, &parent_hobjid) < 0) + if(H5HG_remove(dst->shared->u.vlen.f, &parent_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ } /* end for */ @@ -3421,14 +3340,11 @@ done: * Programmer: Quincey Koziol * Monday, November 6, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *_buf, - void H5_ATTR_UNUSED *_bkg, hid_t dxpl_id) + size_t buf_stride, size_t bkg_stride, void *_buf, void H5_ATTR_UNUSED *_bkg) { H5T_path_t *tpath; /* Type conversion path */ hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */ @@ -3507,7 +3423,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); /* Set up conversion path for base elements */ - if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent, NULL, NULL, dxpl_id, FALSE))) { + if(NULL == (tpath = H5T_path_find(src->shared->parent, dst->shared->parent))) { HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes") } else if (!H5T_path_noop(tpath)) { if((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), FALSE)) < 0 || @@ -3531,7 +3447,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemmove(dp, sp, src->shared->size); /* Convert array */ - if(H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, dp, bkg_buf, dxpl_id) < 0) + if(H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, dp, bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") /* Advance the source & destination pointers */ @@ -3571,26 +3487,11 @@ done: * Programmer: Robb Matzke * Wednesday, June 10, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. - * - * Raymond Lu - * Wednesday, April 21, 2004 - * There is a new design for exception handling like overflow, - * which is passed in as a transfer property. *------------------------------------------------------------------------- */ herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_t *src = NULL; /*source datatype */ H5T_t *dst = NULL; /*destination datatype */ @@ -3605,7 +3506,6 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t first; ssize_t sfirst; /*a signed version of `first' */ size_t i; /*Local index variables */ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -3668,13 +3568,9 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src->shared->size); @@ -3982,29 +3878,11 @@ done: * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. - * - * Robb Matzke, 2001-02-02 - * Oops, forgot to increment the exponent when rounding the - * significand resulted in a carry. Thanks to Guillaume Colin - * de Verdiere for finding this one! - * - * Raymond Lu, 2006-03-13 - * Added support for VAX floating-point types. *------------------------------------------------------------------------- */ herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -4034,7 +3912,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t implied; /*destination implied bits */ hbool_t denormalized = FALSE; /*is either source or destination denormalized?*/ - H5P_genplist_t *plist; /*property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -4105,13 +3982,9 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -4590,22 +4463,12 @@ done: * Programmer: Robb Matzke * Friday, August 7, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. - * - * Raymond Lu, 8 November 2011 - * I put a condition check to prevent the conversion of strings - * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, - void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_t *src=NULL; /*source datatype */ H5T_t *dst=NULL; /*destination datatype */ @@ -4834,15 +4697,12 @@ done: * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -); } @@ -4860,15 +4720,12 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX); } @@ -4886,15 +4743,12 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -); } @@ -4912,15 +4766,12 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -); } @@ -4938,15 +4789,12 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX); } @@ -4964,15 +4812,12 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -); } @@ -4990,14 +4835,12 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, INT, signed char, int, -, -); } @@ -5015,14 +4858,12 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -); } @@ -5040,14 +4881,12 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX); } @@ -5065,14 +4904,12 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -); } @@ -5090,14 +4927,12 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -); } @@ -5115,15 +4950,12 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -); } @@ -5141,14 +4973,12 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX); } @@ -5166,15 +4996,12 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -); } @@ -5192,15 +5019,12 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); } @@ -5218,15 +5042,12 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); } @@ -5244,15 +5065,12 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); } @@ -5270,15 +5088,12 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); } @@ -5296,15 +5111,12 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5322,15 +5134,12 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX); } @@ -5348,15 +5157,12 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); } @@ -5374,15 +5180,12 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX); } @@ -5400,15 +5203,12 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); } @@ -5426,15 +5226,12 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX); } @@ -5452,15 +5249,12 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, INT, short, int, -, -); } @@ -5478,15 +5272,12 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -); } @@ -5504,15 +5295,12 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX); } @@ -5530,15 +5318,12 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -); } @@ -5556,15 +5341,12 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LONG, short, long, -, -); } @@ -5582,15 +5364,12 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -); } @@ -5608,15 +5387,12 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX); } @@ -5634,15 +5410,12 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -); } @@ -5660,15 +5433,12 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); } @@ -5686,15 +5456,12 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); } @@ -5712,15 +5479,12 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); } @@ -5738,15 +5502,12 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); } @@ -5764,15 +5525,12 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -5790,15 +5548,12 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX); } @@ -5816,15 +5571,12 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX); } @@ -5842,15 +5594,12 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); } @@ -5868,15 +5617,12 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX); } @@ -5894,15 +5640,12 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX); } @@ -5920,15 +5663,12 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX); } @@ -5946,15 +5686,12 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX); } @@ -5972,14 +5709,12 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(INT, UINT, int, unsigned, -, -); } @@ -5997,14 +5732,12 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX); } @@ -6022,14 +5755,12 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LONG, int, long, -, -); } @@ -6047,14 +5778,12 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, LONG, int, unsigned long, -, -); } @@ -6072,14 +5801,12 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX); } @@ -6097,14 +5824,12 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -); } @@ -6122,14 +5847,12 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LLONG, int, long long, -, -); } @@ -6147,14 +5870,12 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); } @@ -6172,14 +5893,12 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); } @@ -6197,15 +5916,12 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); } @@ -6223,14 +5939,12 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6248,14 +5962,12 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX); } @@ -6273,15 +5985,12 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX); } @@ -6299,15 +6008,12 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX); } @@ -6325,14 +6031,12 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX); } @@ -6350,15 +6054,12 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX); } @@ -6376,14 +6077,12 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX); } @@ -6401,15 +6100,12 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX); } @@ -6427,14 +6123,12 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX); } @@ -6452,14 +6146,12 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX); } @@ -6477,14 +6169,12 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX); } @@ -6502,14 +6192,12 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX); } @@ -6527,14 +6215,12 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -); } @@ -6552,14 +6238,12 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX); } @@ -6577,14 +6261,12 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(LONG, LLONG, long, long long, -, -); } @@ -6602,15 +6284,12 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); } @@ -6628,15 +6307,12 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); } @@ -6654,15 +6330,12 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); } @@ -6680,15 +6353,12 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6706,15 +6376,12 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); } @@ -6732,15 +6399,12 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); } @@ -6758,15 +6422,12 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); } @@ -6784,15 +6445,12 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); } @@ -6810,15 +6468,12 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); } @@ -6836,15 +6491,12 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); } @@ -6862,15 +6514,12 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); } @@ -6888,14 +6537,12 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); } @@ -6913,14 +6560,12 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); } @@ -6938,14 +6583,12 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); } @@ -6963,15 +6606,12 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); } @@ -6989,14 +6629,12 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, - void *buf, void H5_ATTR_UNUSED *bkg, hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); } @@ -7014,15 +6652,12 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); } @@ -7040,15 +6675,12 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); } @@ -7066,15 +6698,12 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Friday, November 13, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); } @@ -7092,15 +6721,12 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); } @@ -7118,15 +6744,12 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Monday, November 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); } @@ -7143,19 +6766,12 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. *------------------------------------------------------------------------- */ herr_t H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -); } @@ -7172,16 +6788,13 @@ H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); } @@ -7199,22 +6812,12 @@ H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Robb Matzke * Tuesday, June 23, 1998 * - * Modifications: - * Robb Matzke, 7 Jul 1998 - * Added overflow handling. - * - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. *------------------------------------------------------------------------- */ herr_t H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX); } @@ -7231,16 +6834,13 @@ H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); } @@ -7258,16 +6858,13 @@ H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); } @@ -7285,16 +6882,13 @@ H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, Feb 25, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5_SIZEOF_LONG_DOUBLE != 0 herr_t H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); } @@ -7312,15 +6906,12 @@ H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); } @@ -7337,15 +6928,12 @@ H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); } @@ -7362,15 +6950,12 @@ H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); } @@ -7387,15 +6972,12 @@ H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); } @@ -7412,15 +6994,12 @@ H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); } @@ -7437,15 +7016,12 @@ H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); } @@ -7462,15 +7038,12 @@ H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); } @@ -7487,15 +7060,12 @@ H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); } @@ -7512,15 +7082,12 @@ H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); } @@ -7537,15 +7104,12 @@ H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); } @@ -7562,15 +7126,12 @@ H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); } @@ -7587,15 +7148,12 @@ H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); } @@ -7612,15 +7170,12 @@ H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, FLOAT, int, float, -, -); } @@ -7637,15 +7192,12 @@ H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, DOUBLE, int, double, -, -); } @@ -7662,15 +7214,12 @@ H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); } @@ -7687,15 +7236,12 @@ H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); } @@ -7712,15 +7258,12 @@ H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); } @@ -7737,15 +7280,12 @@ H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); } @@ -7762,15 +7302,12 @@ H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, FLOAT, long, float, -, -); } @@ -7787,15 +7324,12 @@ H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); } @@ -7812,15 +7346,12 @@ H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); } @@ -7837,15 +7368,12 @@ H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); } @@ -7862,15 +7390,12 @@ H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); } @@ -7887,15 +7412,12 @@ H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); } @@ -7912,15 +7434,12 @@ H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); } @@ -7937,15 +7456,12 @@ H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); } @@ -7962,16 +7478,13 @@ H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); } @@ -7989,15 +7502,12 @@ H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); } @@ -8014,15 +7524,12 @@ H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); } @@ -8039,16 +7546,13 @@ H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); } @@ -8066,15 +7570,12 @@ H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8093,15 +7594,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -8120,15 +7618,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8147,15 +7642,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -8174,15 +7666,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8201,15 +7690,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -8228,15 +7714,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -8255,15 +7738,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -8282,15 +7762,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -8309,15 +7786,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -8336,15 +7810,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -8363,15 +7834,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -8390,15 +7858,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -8417,15 +7882,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -8444,15 +7906,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -8471,15 +7930,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -8498,15 +7954,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -8525,15 +7978,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -8552,15 +8002,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8579,15 +8026,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -8606,15 +8050,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -8633,15 +8074,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -8660,15 +8098,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -8687,15 +8122,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -8714,15 +8146,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); @@ -8741,15 +8170,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); @@ -8768,15 +8194,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); @@ -8795,15 +8218,12 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Friday, November 7, 2003 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); @@ -8822,16 +8242,13 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t H5_ATTR_UNUSED dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); @@ -8851,16 +8268,13 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Tuesday, Febuary 1, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t H5T__conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, + void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); @@ -8881,8 +8295,6 @@ H5_GCC_DIAG_ON(float-equal) * Programmer: Raymond Lu * Wednesday, Jan 21, 2004 * - * Modifications: - * * Raymond Lu * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, @@ -8895,8 +8307,7 @@ H5_GCC_DIAG_ON(float-equal) */ herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -8921,7 +8332,6 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ ssize_t sfirst; /*a signed version of `first' */ - H5P_genplist_t *plist; /*Property list pointer */ H5T_conv_cb_t cb_struct={NULL, NULL}; /*conversion callback structure */ hbool_t truncated; /*if fraction value is dropped */ hbool_t reverse; /*if reverse order of destination at the end */ @@ -8985,13 +8395,9 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, buf_size = (size_t) (HDpow((double)2.0f, (double)src.u.f.esize) / 8 + 1); int_buf = (uint8_t*)H5MM_calloc(buf_size); - /* Get the plist structure. Do I need to close it? */ - if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist, H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -9467,22 +8873,11 @@ done: * Programmer: Raymond Lu * Friday, Feb 6, 2004 * - * Modifications: - * - * Raymond Lu - * Wednesday, April 21, 2004 - * There is a new design for exception handling like overflow, - * which is passed in as a transfer property. - * - * Raymond Lu - * Monday, March 13, 2006 - * Added support for VAX floating-point types. *------------------------------------------------------------------------- */ herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg, - hid_t dxpl_id) + size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_t *src_p; /*source datatype */ @@ -9510,7 +8905,6 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ ssize_t sfirst; /*a signed version of `first' */ - H5P_genplist_t *plist; /*Property list pointer */ H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ @@ -9573,13 +8967,9 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, buf_size = (src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize)/8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID") - /* Get conversion exception callback property */ - if(H5P_get(plist,H5D_XFER_CONV_CB_NAME, &cb_struct) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback") + if(H5CX_get_dt_conv_cb(&cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback") /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src_p->shared->size); @@ -9898,11 +9288,6 @@ done: * Programmer: Raymond Lu * April 26, 2004 * - * Modifications: - * - * Raymond Lu - * March 13, 2006 - * Add support for VAX floating-point types. *------------------------------------------------------------------------- */ static herr_t diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index c506ec1..5a273f5 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -37,6 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ @@ -101,6 +102,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -114,12 +116,21 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; +/* Set up collective metadata if appropriate */ +if(H5CX_set_loc(loc_id, TRUE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set access property list info") + /* Commit the datatype to the file, using default property list values */ - if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, - H5P_DATATYPE_CREATE_DEFAULT, H5P_DATATYPE_ACCESS_DEFAULT, H5AC_ind_read_dxpl_id) < 0) + if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Tcommit1() */ @@ -144,60 +155,39 @@ hid_t H5Topen1(hid_t loc_id, const char *name) { H5T_t *type = NULL; - H5G_loc_t loc; - H5G_name_t path; /* Datatype group hier. path */ - H5O_loc_t oloc; /* Datatype object location */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_loc_t type_loc; /* Group object for datatype */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl to use to open datatype */ - hid_t ret_value = FAIL; + H5G_loc_t loc; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + hid_t ret_value = H5I_INVALID_HID; - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "i*s", loc_id, name); /* Check args */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - - /* Set up datatype location to fill in */ - type_loc.oloc = &oloc; - type_loc.path = &path; - H5G_loc_reset(&type_loc); - - /* - * Find the named datatype object header and read the datatype message - * from it. - */ - if(H5G_loc_find(&loc, name, &type_loc/*out*/, H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found") - obj_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_NAMED_DATATYPE) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a named datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name") + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; /* Open it */ - if((type = H5T_open(&type_loc, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open named datatype") + if(NULL == (type = H5T__open_name(&loc, name))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open named datatype") /* Register the type and return the ID */ if((ret_value = H5I_register(H5I_DATATYPE, type, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register named datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register named datatype") done: - if(ret_value < 0) { - if(type != NULL) - H5T_close(type); - else { - if(obj_found && H5F_addr_defined(type_loc.oloc->addr)) - H5G_loc_free(&type_loc); - } /* end else */ - } /* end if */ + /* Cleanup on error */ + if(ret_value < 0) + if(type && H5T_close(type) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, H5I_INVALID_HID, "can't close datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) } /* end H5Topen1() */ diff --git a/src/H5Tenum.c b/src/H5Tenum.c index f5263ed..ade7d08 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -57,23 +57,24 @@ H5Tenum_create(hid_t parent_id) H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", parent_id); /* Check args */ if(NULL == (parent = (H5T_t *)H5I_object_verify(parent_id, H5I_DATATYPE)) || H5T_INTEGER != parent->shared->type) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an integer data type") /* Build new type */ if(NULL == (dt = H5T__enum_create(parent))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_INVALID_HID, "cannot create enum type") + /* Atomize the type */ if ((ret_value=H5I_register(H5I_DATATYPE, dt, TRUE))<0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type atom") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type atom") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Tenum_create() */ /*------------------------------------------------------------------------- @@ -446,7 +447,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close data type"); if(!ret_value && alloc_name) H5MM_free(name); @@ -574,7 +575,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) done: if(copied_dt) - if(H5T_close(copied_dt) < 0) + if(H5T_close_real(copied_dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close data type") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 6304500..546b487 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -20,6 +20,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Pprivate.h" /* Property lists */ @@ -27,16 +28,17 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t* H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size); -static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, - size_t nelems, size_t align, size_t *struct_align); +static H5T_t *H5T__get_native_type(H5T_t *dt, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static H5T_t *H5T__get_native_integer(size_t prec, H5T_sign_t sign, + H5T_direction_t direction, size_t *struct_align, size_t *offset, + size_t *comp_size); +static H5T_t *H5T__get_native_float(size_t size, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static H5T_t* H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size); +static herr_t H5T__cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, + size_t nelems, size_t align, size_t *struct_align); @@ -74,41 +76,47 @@ hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction) { H5T_t *dt; /* Datatype to create native datatype from */ - H5T_t *new_dt=NULL; /* Datatype for native datatype created */ - size_t comp_size=0; /* Compound datatype's size */ + H5T_t *new_dt = NULL; /* Datatype for native datatype created */ + size_t comp_size = 0; /* Compound datatype's size */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(FAIL) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "iTd", type_id, direction); - /* check argument */ - if(NULL==(dt=(H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") - - if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND - && direction!=H5T_DIR_DESCEND) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value") - - if((new_dt = H5T_get_native_type(dt, direction, NULL, NULL, &comp_size))==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type") - - if((ret_value=H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") + /* Check arguments */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not a data type") + if(direction != H5T_DIR_DEFAULT && direction != H5T_DIR_ASCEND + && direction != H5T_DIR_DESCEND) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not valid direction value") +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, H5I_INVALID_HID, "can't set API context") +api_ctx_pushed = TRUE; + + /* Get the native type */ + if(NULL == (new_dt = H5T__get_native_type(dt, direction, NULL, NULL, &comp_size))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "cannot retrieve native type") + + /* Get an ID for the new type */ + if((ret_value = H5I_register(H5I_DATATYPE, new_dt, TRUE)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register data type") done: /* Error cleanup */ - if(ret_value<0) { - if(new_dt) - if(H5T_close(new_dt)<0) - HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ + if(ret_value < 0) + if(new_dt && H5T_close_real(new_dt) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTRESET, H5I_INVALID_HID, "can't reset API context") FUNC_LEAVE_API(ret_value) -} +} /* end H5Tget_native_type() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_type + * Function: H5T__get_native_type * * Purpose: Returns the native type of a datatype. * @@ -122,7 +130,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, + size_t *offset, size_t *comp_size) { H5T_t *dt; /* Datatype to make native */ H5T_t *super_type; /* Super type of VL, array and enum datatypes */ @@ -144,7 +153,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig unsigned u; /* Local index variable */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(dtype); @@ -164,13 +173,13 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig prec = dtype->shared->u.atomic.prec; - if(NULL == (ret_value = H5T_get_native_integer(prec, sign, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_integer(prec, sign, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer type") } /* end case */ break; case H5T_FLOAT: - if(NULL == (ret_value = H5T_get_native_float(size, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_float(size, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") break; @@ -181,12 +190,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(H5T_IS_VL_STRING(dtype->shared)) { /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char *), (size_t)1, H5T_POINTER_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char *), (size_t)1, H5T_POINTER_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end if */ else { /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end else */ break; @@ -200,7 +209,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig { prec = dtype->shared->u.atomic.prec; - if(NULL == (ret_value = H5T_get_native_bitfield(prec, direction, struct_align, offset, comp_size))) + if(NULL == (ret_value = H5T__get_native_bitfield(prec, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer for bitfield type") } /* end case */ break; @@ -210,7 +219,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") /* Update size, offset and compound alignment for parent. */ - if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") break; @@ -238,7 +247,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig ref_size = sizeof(hdset_reg_ref_t); } /* end else */ - if(H5T_cmp_offset(comp_size, offset, ref_size, (size_t)1, align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, ref_size, (size_t)1, align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } /* end case */ break; @@ -267,10 +276,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(NULL == (comp_mname[u] = H5T__get_member_name(dtype, u))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") - if(NULL == (memb_list[u] = H5T_get_native_type(memb_type, direction, &children_st_align, &(memb_offset[u]), &children_size))) + if(NULL == (memb_list[u] = H5T__get_native_type(memb_type, direction, &children_st_align, &(memb_offset[u]), &children_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member identifier retrieval failed") - if(H5T_close(memb_type) < 0) + if(H5T_close_real(memb_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") } /* end for */ @@ -305,13 +314,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig * The alignment for ST in S1 is the biggest structure alignment of all the * members of S2, which is probably the LL2 of 'long long'. -SLU 2010/4/28 */ - if(H5T_cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align, - struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") /* Close member data type */ for(u = 0; u < nmemb; u++) { - if(H5T_close(memb_list[u]) < 0) + if(H5T_close_real(memb_list[u]) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") /* Free member names in list */ @@ -337,7 +345,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve base type for enumerated type */ if(NULL == (super_type = H5T_get_super(dtype))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get base type for enumerate type") - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))) + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, struct_align, offset, comp_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed") if((super_type_id = H5I_register(H5I_DATATYPE, super_type, FALSE)) < 0) @@ -356,7 +364,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") /* Find the conversion function */ - if(NULL == (tpath = H5T_path_find(super_type, nat_super_type, NULL, NULL, H5AC_noio_dxpl_id, FALSE))) + if(NULL == (tpath = H5T_path_find(super_type, nat_super_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to convert between src and dst data types") /* Retrieve member info and insert members into new enum type */ @@ -370,7 +378,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); - if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL, H5AC_noio_dxpl_id) < 0) + if(H5T_convert(tpath, super_type_id, nat_super_type_id, (size_t)1, (size_t)0, (size_t)0, memb_value, NULL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") if(H5T__enum_insert(new_type, memb_name, memb_value) < 0) @@ -412,12 +420,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Retrieve base type for array type */ if(NULL == (super_type = H5T_get_super(dtype))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for array type") - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, &super_align, + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, &super_align, &super_offset, &super_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed") /* Close super type */ - if(H5T_close(super_type) < 0) + if(H5T_close_real(super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ @@ -425,13 +433,13 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type") /* Close base type */ - if(H5T_close(nat_super_type) < 0) + if(H5T_close_real(nat_super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") for(u = 0; u < array_rank; u++) nelems *= dims[u]; H5_CHECK_OVERFLOW(nelems, hsize_t, size_t); - if(H5T_cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") dims = (hsize_t *)H5MM_xfree(dims); @@ -451,11 +459,11 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for VL type") /* Don't need alignment, offset information if this VL isn't a field of compound type. If it * is, go to a few steps below to compute the information directly. */ - if(NULL == (nat_super_type = H5T_get_native_type(super_type, direction, NULL, NULL, &super_size))) + if(NULL == (nat_super_type = H5T__get_native_type(super_type, direction, NULL, NULL, &super_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed") /* Close super type */ - if(H5T_close(super_type) < 0) + if(H5T_close_real(super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ @@ -463,14 +471,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type") /* Close base type */ - if(H5T_close(nat_super_type) < 0) + if(H5T_close_real(nat_super_type) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Update size, offset and compound alignment for parent compound type directly. */ vl_align = H5T_HVL_COMP_ALIGN_g; vl_size = sizeof(hvl_t); - if(H5T_cmp_offset(comp_size, offset, vl_size, (size_t)1, vl_align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, vl_size, (size_t)1, vl_align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") ret_value = new_type; @@ -487,13 +495,13 @@ done: /* Error cleanup */ if(NULL == ret_value) { if(new_type) - if(H5T_close(new_type) < 0) + if(H5T_close_real(new_type) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, NULL, "unable to release datatype") /* Free lists for members */ if(memb_list) { for(u = 0; u < nmemb; u++) - if(memb_list[u] && H5T_close(memb_list[u]) < 0) + if(memb_list[u] && H5T_close_real(memb_list[u]) < 0) HDONE_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype") memb_list = (H5T_t **)H5MM_xfree(memb_list); @@ -512,11 +520,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_get_native_type() */ +} /* end H5T__get_native_type() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_integer + * Function: H5T__get_native_integer * * Purpose: Returns the native integer type of a datatype. * @@ -530,8 +538,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t * -H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, - size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size) { H5T_t *dt; /* Appropriate native datatype to copy */ hid_t tid = (-1); /* Datatype ID of appropriate native datatype */ @@ -547,7 +555,7 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, } match = H5T_NATIVE_INT_MATCH_UNKNOWN; H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec <= H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_SCHAR_g))) { @@ -648,16 +656,16 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") /* compute size and offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align) < 0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_get_native_integer() */ +} /* end H5T__get_native_integer() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_float + * Function: H5T__get_native_float * * Purpose: Returns the native floatt type of a datatype. * @@ -671,7 +679,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t* -H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) +H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, + size_t *offset, size_t *comp_size) { H5T_t *dt=NULL; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ @@ -687,7 +696,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig } match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN; H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC HDassert(size>0); @@ -772,16 +781,16 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") /* compute offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__get_native_float() */ /*------------------------------------------------------------------------- - * Function: H5T_get_native_bitfield + * Function: H5T__get_native_bitfield * * Purpose: Returns the native bitfield type of a datatype. Bitfield * is similar to unsigned integer. @@ -796,8 +805,8 @@ done: *------------------------------------------------------------------------- */ static H5T_t* -H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_align, - size_t *offset, size_t *comp_size) +H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, + size_t *struct_align, size_t *offset, size_t *comp_size) { H5T_t *dt; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ @@ -805,7 +814,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a size_t native_size=0; /* Datatype size of the native type */ H5T_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_STATIC if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec<=H5T_get_precision((H5T_t *)H5I_object(H5T_NATIVE_B8_g))) { @@ -858,16 +867,16 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") /* compute size and offset of compound type member. */ - if(H5T_cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) + if(H5T__cmp_offset(comp_size, offset, native_size, (size_t)1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5T__get_native_bitfield() */ /*------------------------------------------------------------------------- - * Function: H5T_cmp_offset + * Function: H5T__cmp_offset * * Purpose: This function is only for convenience. It computes the * compound type size, offset of the member being considered @@ -883,29 +892,27 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, - size_t nelems, size_t align, size_t *struct_align) +H5T__cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, + size_t nelems, size_t align, size_t *struct_align) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC_NOERR if(offset && comp_size) { - if(align>1 && *comp_size%align) { + if(align > 1 && *comp_size % align) { /* Add alignment value */ - *offset = *comp_size + (align - *comp_size%align); - *comp_size += (align - *comp_size%align); - } else + *offset = *comp_size + (align - *comp_size % align); + *comp_size += (align - *comp_size % align); + } /* end if */ + else *offset = *comp_size; /* compute size of compound type member. */ - *comp_size += nelems*elem_size; - } + *comp_size += nelems* elem_size; + } /* end if */ if(struct_align && *struct_align < align) *struct_align = align; -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5T__cmp_offset() */ diff --git a/src/H5Toh.c b/src/H5Toh.c index 01cefe1..c0139fe 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -43,12 +43,10 @@ /* Local Prototypes */ /********************/ -static htri_t H5O_dtype_isa(H5O_t *loc); -static hid_t H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t lapl_id, - hid_t dxpl_id, hbool_t app_ref); -static void *H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, - hid_t dxpl_id); -static H5O_loc_t *H5O_dtype_get_oloc(hid_t obj_id); +static htri_t H5O__dtype_isa(const H5O_t *loc); +static hid_t H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref); +static void *H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc); +static H5O_loc_t *H5O__dtype_get_oloc(hid_t obj_id); /*********************/ @@ -71,17 +69,17 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ "named datatype", /* object name, for debugging */ NULL, /* get 'copy file' user data */ NULL, /* free 'copy file' user data */ - H5O_dtype_isa, /* "isa" */ - H5O_dtype_open, /* open an object of this class */ - H5O_dtype_create, /* create an object of this class */ - H5O_dtype_get_oloc, /* get an object header location for an object */ + H5O__dtype_isa, /* "isa" */ + H5O__dtype_open, /* open an object of this class */ + H5O__dtype_create, /* create an object of this class */ + H5O__dtype_get_oloc, /* get an object header location for an object */ NULL, /* get the index & heap info for an object */ NULL /* flush an opened object of this class */ }}; /*------------------------------------------------------------------------- - * Function: H5O_dtype_isa + * Function: H5O__dtype_isa * * Purpose: Determines if an object has the requisite messages for being * a datatype. @@ -98,11 +96,11 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ *------------------------------------------------------------------------- */ static htri_t -H5O_dtype_isa(struct H5O_t *oh) +H5O__dtype_isa(const H5O_t *oh) { htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oh); @@ -111,11 +109,11 @@ H5O_dtype_isa(struct H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_isa() */ +} /* end H5O__dtype_isa() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_open + * Function: H5O__dtype_open * * Purpose: Open a datatype at a particular location * @@ -128,17 +126,17 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t H5_ATTR_UNUSED lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__dtype_open(const H5G_loc_t *obj_loc, hbool_t app_ref) { H5T_t *type = NULL; /* Datatype opened */ hid_t ret_value = H5I_INVALID_HID; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); /* Open the datatype */ - if(NULL == (type = H5T_open(obj_loc, dxpl_id))) + if(NULL == (type = H5T_open(obj_loc))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to open datatype") /* Register an ID for the datatype */ @@ -151,11 +149,11 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_open() */ +} /* end H5O__dtype_open() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_create + * Function: H5O__dtype_create * * Purpose: Create a named datatype in a file * @@ -168,12 +166,12 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) { H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -181,7 +179,7 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Commit the type to the file */ - if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id, dxpl_id) < 0) + if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") /* Set up the new named datatype's location */ @@ -195,11 +193,11 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_create() */ +} /* end H5O__dtype_create() */ /*------------------------------------------------------------------------- - * Function: H5O_dtype_get_oloc + * Function: H5O__dtype_get_oloc * * Purpose: Retrieve the object header location for an open object * @@ -212,12 +210,12 @@ done: *------------------------------------------------------------------------- */ static H5O_loc_t * -H5O_dtype_get_oloc(hid_t obj_id) +H5O__dtype_get_oloc(hid_t obj_id) { H5T_t *type; /* Datatype opened */ H5O_loc_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the datatype */ if(NULL == (type = (H5T_t *)H5I_object(obj_id))) @@ -229,5 +227,5 @@ H5O_dtype_get_oloc(hid_t obj_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dtype_get_oloc() */ +} /* end H5O__dtype_get_oloc() */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index d075127..85db68f 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -149,12 +149,25 @@ struct H5T_stats_t { H5_timer_t timer; /*total time for conversion */ }; +/* Library internal datatype conversion functions are... */ +typedef herr_t (*H5T_lib_conv_t) (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); + +/* Conversion callbacks (library internal ones don't need DXPL) */ +typedef struct H5T_conv_func_t { + hbool_t is_app; /* Whether conversion function is registered from application */ + union { + H5T_conv_t app_func; /* Application data conversion function */ + H5T_lib_conv_t lib_func; /* Library internal data conversion function */ + } u; +} H5T_conv_func_t; + /* The datatype conversion database */ struct H5T_path_t { char name[H5T_NAMELEN]; /*name for debugging only */ H5T_t *src; /*source datatype */ H5T_t *dst; /*destination datatype */ - H5T_conv_t func; /*data conversion function */ + H5T_conv_func_t conv; /* Conversion funcion */ hbool_t is_hard; /*is it a hard function? */ hbool_t is_noop; /*is it the noop conversion? */ hbool_t are_compounds; /*are source and dest both compounds?*/ @@ -234,9 +247,9 @@ typedef struct H5T_enum_t { typedef ssize_t (*H5T_vlen_getlenfunc_t)(const void *vl_addr); typedef void * (*H5T_vlen_getptrfunc_t)(void *vl_addr); typedef htri_t (*H5T_vlen_isnullfunc_t)(const H5F_t *f, void *vl_addr); -typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t len); -typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size); -typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, void *_vl, void *buf, size_t len); +typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size); +typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, void *_vl, void *_bg); /* VL types */ typedef enum { @@ -314,7 +327,7 @@ typedef struct H5T_soft_t { char name[H5T_NAMELEN]; /*name for debugging only */ H5T_class_t src; /*source datatype class */ H5T_class_t dst; /*destination datatype class */ - H5T_conv_t func; /*the conversion function */ + H5T_conv_func_t conv; /*the conversion function */ } H5T_soft_t; /* Bit search direction */ @@ -424,856 +437,687 @@ H5FL_EXTERN(H5T_shared_t); /* Common functions */ H5_DLL herr_t H5T__init_native(void); H5_DLL H5T_t *H5T__create(H5T_class_t type, size_t size); -H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); -H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, - H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id); H5_DLL H5T_t *H5T__alloc(void); H5_DLL herr_t H5T__free(H5T_t *dt); H5_DLL herr_t H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value); H5_DLL herr_t H5T__upgrade_version(H5T_t *dt, unsigned new_version); +/* Committed / named datatype routines */ +H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id); +H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, + H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id); +H5_DLL H5T_t *H5T__open_name(const H5G_loc_t *loc, const char *name); + /* Conversion functions */ H5_DLL herr_t H5T__conv_noop(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, - size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *_buf, void *bkg); H5_DLL herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); H5_DLL herr_t H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, - void *buf, void *bkg, - hid_t dset_xfer_plist); + void *buf, void *bkg); /* Bit twiddling functions */ H5_DLL void H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 9171e1e..eb120eb 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -108,6 +108,7 @@ H5_DLL herr_t H5T_init(void); H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method); H5_DLL herr_t H5T_lock(H5T_t *dt, hbool_t immutable); H5_DLL herr_t H5T_close(H5T_t *dt); +H5_DLL herr_t H5T_close_real(H5T_t *dt); H5_DLL H5T_t *H5T_get_super(const H5T_t *dt); H5_DLL H5T_class_t H5T_get_class(const H5T_t *dt, htri_t internal); H5_DLL htri_t H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api); @@ -122,17 +123,14 @@ H5_DLL htri_t H5T_is_immutable(const H5T_t *dt); H5_DLL htri_t H5T_is_named(const H5T_t *dt); H5_DLL herr_t H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_relocatable(const H5T_t *dt); -H5_DLL H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst, - const char *name, H5T_conv_t func, hid_t dxpl_id, hbool_t is_api); +H5_DLL H5T_path_t *H5T_path_find(const H5T_t *src, const H5T_t *dst); H5_DLL hbool_t H5T_path_noop(const H5T_path_t *p); H5_DLL H5T_bkg_t H5T_path_bkg(const H5T_path_t *p); H5_DLL H5T_subset_info_t *H5T_path_compound_subset(const H5T_path_t *p); H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, - hid_t dset_xfer_plist); + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg); H5_DLL herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_op_data); -H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id); -H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info); +H5_DLL herr_t H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt); H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); @@ -145,9 +143,9 @@ H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); H5_DLL H5R_type_t H5T_get_ref_type(const H5T_t *dt); /* Operations on named datatypes */ -H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc, hid_t dxpl_id); +H5_DLL H5T_t *H5T_open(const H5G_loc_t *loc); H5_DLL htri_t H5T_committed(const H5T_t *type); -H5_DLL int H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id); +H5_DLL int H5T_link(const H5T_t *type, int adjust); H5_DLL herr_t H5T_update_shared(H5T_t *type); /* Field functions (for both compound & enumerated types) */ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 00e61e5..ba31cd1 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -20,6 +20,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HGprivate.h" /* Global Heaps */ @@ -33,32 +34,24 @@ static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t static ssize_t H5T_vlen_seq_mem_getlen(const void *_vl); static void * H5T_vlen_seq_mem_getptr(void *_vl); static htri_t H5T_vlen_seq_mem_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_seq_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_seq_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_seq_mem_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_seq_mem_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, void *_vl, void *_bg); static ssize_t H5T_vlen_str_mem_getlen(const void *_vl); static void * H5T_vlen_str_mem_getptr(void *_vl); static htri_t H5T_vlen_str_mem_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_str_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_str_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_str_mem_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_str_mem_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, void *_vl, void *_bg); static ssize_t H5T_vlen_disk_getlen(const void *_vl); static void * H5T_vlen_disk_getptr(void *_vl); static htri_t H5T_vlen_disk_isnull(const H5F_t *f, void *_vl); -static herr_t H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len); -static herr_t H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); -static herr_t H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg); +static herr_t H5T_vlen_disk_read(H5F_t *f, void *_vl, void *_buf, size_t len); +static herr_t H5T_vlen_disk_write(H5F_t *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size); +static herr_t H5T_vlen_disk_setnull(H5F_t *f, void *_vl, void *_bg); /* Local variables */ -/* Default settings for variable-length allocation routines */ -static H5T_vlen_alloc_info_t H5T_vlen_def_vl_alloc_info ={ - H5D_VLEN_ALLOC, - H5D_VLEN_ALLOC_INFO, - H5D_VLEN_FREE, - H5D_VLEN_FREE_INFO -}; - /*------------------------------------------------------------------------- @@ -157,7 +150,7 @@ H5T__vlen_create(const H5T_t *base) done: if(!ret_value) - if(dt && H5T_close(dt) < 0) + if(dt && H5T_close_real(dt) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, NULL, "unable to release datatype info") FUNC_LEAVE_NOAPI(ret_value) @@ -211,7 +204,8 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) dt->shared->u.vlen.read = H5T_vlen_seq_mem_read; dt->shared->u.vlen.write = H5T_vlen_seq_mem_write; dt->shared->u.vlen.setnull = H5T_vlen_seq_mem_setnull; - } else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) { + } /* end if */ + else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) { /* size in memory, disk size is different */ dt->shared->size = sizeof(char *); @@ -222,9 +216,9 @@ H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) dt->shared->u.vlen.read = H5T_vlen_str_mem_read; dt->shared->u.vlen.write = H5T_vlen_str_mem_write; dt->shared->u.vlen.setnull = H5T_vlen_str_mem_setnull; - } else { + } /* end else-if */ + else HDassert(0 && "Invalid VL type"); - } /* Reset file ID (since this VL is in memory) */ dt->shared->u.vlen.f = NULL; @@ -401,7 +395,7 @@ H5T_vlen_seq_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */ @@ -442,7 +436,7 @@ H5T_vlen_seq_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_seq_mem_write(H5F_t H5_ATTR_UNUSED *f, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) { hvl_t vl; /* Temporary hvl_t to use during operation */ size_t len; @@ -498,7 +492,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) +H5T_vlen_seq_mem_setnull(H5F_t H5_ATTR_UNUSED *f, void *_vl, void H5_ATTR_UNUSED *_bg) { hvl_t vl; /* Temporary hvl_t to use during operation */ @@ -632,7 +626,7 @@ H5T_vlen_str_mem_isnull(const H5F_t H5_ATTR_UNUSED *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void *buf, size_t len) +H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, void *_vl, void *buf, size_t len) { #ifdef H5_NO_ALIGNMENT_RESTRICTIONS char *s=*(char **)_vl; /* Pointer to the user's string information */ @@ -672,7 +666,9 @@ H5T_vlen_str_mem_read(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, voi *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, size_t base_size) +H5T_vlen_str_mem_write(H5F_t H5_ATTR_UNUSED *f, const H5T_vlen_alloc_info_t *vl_alloc_info, + void *_vl, void *buf, void H5_ATTR_UNUSED *_bg, size_t seq_len, + size_t base_size) { char *t; /* Pointer to temporary buffer allocated */ size_t len; /* Maximum length of the string to copy */ @@ -718,7 +714,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, void *_vl, void H5_ATTR_UNUSED *_bg) +H5T_vlen_str_mem_setnull(H5F_t H5_ATTR_UNUSED *f, void *_vl, void H5_ATTR_UNUSED *_bg) { char *t=NULL; /* Pointer to temporary buffer allocated */ @@ -830,7 +826,7 @@ H5T_vlen_disk_isnull(const H5F_t *f, void *_vl) *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR_UNUSED len) +H5T_vlen_disk_read(H5F_t *f, void *_vl, void *buf, size_t H5_ATTR_UNUSED len) { uint8_t *vl=(uint8_t *)_vl; /* Pointer to the user's hvl_t information */ H5HG_t hobjid; @@ -847,15 +843,14 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t H5_ATTR vl += 4; /* Get the heap information */ - H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); - UINT32DECODE(vl,hobjid.idx); + H5F_addr_decode(f, (const uint8_t **)&vl, &(hobjid.addr)); + UINT32DECODE(vl, hobjid.idx); /* Check if this sequence actually has any data */ - if(hobjid.addr>0) { + if(hobjid.addr > 0) /* Read the VL information from disk */ - if(H5HG_read(f,dxpl_id,&hobjid,buf, NULL)==NULL) + if(NULL == H5HG_read(f, &hobjid, buf, NULL)) HGOTO_ERROR(H5E_DATATYPE, H5E_READERROR, FAIL, "Unable to read VL information") - } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -875,7 +870,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info, +H5T_vlen_disk_write(H5F_t *f, const H5T_vlen_alloc_info_t H5_ATTR_UNUSED *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size) { uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/ @@ -903,11 +898,10 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR UINT32DECODE(bg, bg_hobjid.idx); /* Free heap object for old data */ - if(bg_hobjid.addr > 0) { + if(bg_hobjid.addr > 0) /* Free heap object */ - if(H5HG_remove(f, dxpl_id, &bg_hobjid) < 0) + if(H5HG_remove(f, &bg_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") - } /* end if */ } /* end if */ /* Set the length of the sequence */ @@ -915,7 +909,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t H5_ATTR /* Write the VL information to disk (allocates space also) */ len = (seq_len*base_size); - if(H5HG_insert(f, dxpl_id, len, buf, &hobjid) < 0) + if(H5HG_insert(f, len, buf, &hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to write VL information") /* Encode the heap information */ @@ -940,7 +934,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) +H5T_vlen_disk_setnull(H5F_t *f, void *_vl, void *_bg) { uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/ uint8_t *bg = (uint8_t *)_bg; /*Pointer to the old data hvl_t */ @@ -967,7 +961,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Free heap object for old data */ if(bg_hobjid.addr > 0) { /* Free heap object */ - if(H5HG_remove(f, dxpl_id, &bg_hobjid) < 0) + if(H5HG_remove(f, &bg_hobjid) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "Unable to remove heap object") } /* end if */ } /* end if */ @@ -990,7 +984,7 @@ done: PURPOSE Internal recursive routine to free VL datatypes USAGE - herr_t H5T_vlen_reclaim(elem,dt) + herr_t H5T_vlen_reclaim_recurse(elem,dt) void *elem; IN/OUT: Pointer to the dataset element H5T_t *dt; IN: Datatype of dataset element @@ -1134,7 +1128,8 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *op_data) +H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned H5_ATTR_UNUSED ndim, + const hsize_t H5_ATTR_UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ H5T_t *dt; @@ -1159,73 +1154,11 @@ done: } /* end H5T_vlen_reclaim() */ -/*-------------------------------------------------------------------------- - NAME - H5T_vlen_get_alloc_info - PURPOSE - Retrieve allocation info for VL datatypes - USAGE - herr_t H5T_vlen_get_alloc_info(dxpl_id,vl_alloc_info) - hid_t dxpl_id; IN: Data transfer property list to query - H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill - - RETURNS - SUCCEED/FAIL - DESCRIPTION - Retrieve the VL allocation functions and information from a dataset - transfer property list. - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - The VL_ALLOC_INFO pointer should point at already allocated memory to place - non-default property list info. If a default property list is used, the - VL_ALLOC_INFO pointer will be changed to point at the default information. - EXAMPLES - REVISION LOG ---------------------------------------------------------------------------*/ -herr_t -H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info) -{ - H5P_genplist_t *plist; /* DX property list */ - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(FAIL) - - HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); - HDassert(vl_alloc_info); - - /* Check for the default DXPL */ - if(dxpl_id==H5P_DATASET_XFER_DEFAULT) - *vl_alloc_info=&H5T_vlen_def_vl_alloc_info; - else { - /* Check args */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - - /* Get the allocation functions & information */ - if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_NAME,&(*vl_alloc_info)->alloc_func) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_ALLOC_INFO_NAME,&(*vl_alloc_info)->alloc_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_FREE_NAME,&(*vl_alloc_info)->free_func) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - if (H5P_get(plist,H5D_XFER_VLEN_FREE_INFO_NAME,&(*vl_alloc_info)->free_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_get_alloc_info() */ - - /*------------------------------------------------------------------------- * Function: H5T_vlen_reclaim_elmt * * Purpose: Alternative method to reclaim any VL data for a buffer element. * - * Use this function when the datatype is already available, but - * the allocation info is needed from the dxpl_id before jumping - * into recursion. - * * Return: Non-negative on success/Negative on failure * * Programmer: Mike McGreevy @@ -1234,11 +1167,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) +H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) { - H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ - H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ - herr_t ret_value = SUCCEED; /* return value */ + H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ + herr_t ret_value = SUCCEED; /* return value */ HDassert(dt); HDassert(elem); @@ -1246,11 +1178,11 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) FUNC_ENTER_NOAPI(FAIL) /* Get VL allocation info */ - if(H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) + if(H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") /* Recurse on buffer to free dynamic fields */ - if(H5T_vlen_reclaim_recurse(elem, dt, vl_alloc_info->free_func, vl_alloc_info->free_info) < 0) + if(H5T_vlen_reclaim_recurse(elem, dt, vl_alloc_info.free_func, vl_alloc_info.free_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim vlen elements") done: diff --git a/src/H5Z.c b/src/H5Z.c index 6f173b2..047277f 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -15,6 +15,7 @@ #include "H5private.h" /* Generic Functions */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File */ @@ -43,7 +44,10 @@ typedef struct H5Z_stats_t { typedef struct H5Z_object_t { H5Z_filter_t filter_id; /* ID of the filter we're looking for */ - htri_t found; /* Whether we find an object using the filter */ + htri_t found; /* Whether we find an object using the filter */ +#ifdef H5_HAVE_PARALLEL + hbool_t sanity_checked; /* Whether the sanity check for collectively calling H5Zunregister has been done */ +#endif /* H5_HAVE_PARALLEL */ } H5Z_object_t; /* Enumerated type for dataset creation prelude callbacks */ @@ -358,7 +362,7 @@ H5Zunregister(H5Z_filter_t id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if (H5Z_unregister(id) < 0) + if(H5Z__unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -367,7 +371,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Z_unregister + * Function: H5Z__unregister * * Purpose: Same as the public version except this one allows filters * to be unset for predefined method numbers =0 && filter_id<=H5Z_FILTER_MAX); @@ -399,6 +403,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Initialize the structure object for iteration */ object.filter_id = filter_id; object.found = FALSE; +#ifdef H5_HAVE_PARALLEL + object.sanity_checked = FALSE; +#endif /* H5_HAVE_PARALLEL */ /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) @@ -415,7 +422,7 @@ H5Z_unregister(H5Z_filter_t filter_id) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") /* Remove filter from table */ @@ -427,8 +434,8 @@ H5Z_unregister(H5Z_filter_t filter_id) H5Z_table_used_g--; done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_unregister() */ + FUNC_LEAVE_NOAPI_VOL(ret_value) +} /* end H5Z__unregister() */ /*------------------------------------------------------------------------- @@ -464,7 +471,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_group_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * Purpose: The callback function for H5Z__unregister. It iterates * through all opened objects. If the object is a dataset * or a group and it uses the filter to be unregistered, the * function returns TRUE. @@ -486,7 +493,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ @@ -494,7 +501,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and - * let H5Z_unregister return failure. + * let H5Z__unregister return failure. */ if (filter_in_pline) { object->found = TRUE; @@ -513,7 +520,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_dset_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * Purpose: The callback function for H5Z__unregister. It iterates * through all opened objects. If the object is a dataset * or a group and it uses the filter to be unregistered, the * function returns TRUE. @@ -543,7 +550,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and - * let H5Z_unregister return failure. + * let H5Z__unregister return failure. */ if (filter_in_pline) { object->found = TRUE; @@ -562,7 +569,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__flush_file_cb * - * Purpose: The callback function for H5Z_unregister. It iterates + * Purpose: The callback function for H5Z__unregister. It iterates * through all opened files and flush them. * * Return: FALSE if finishes flushing and moves on @@ -570,22 +577,74 @@ done: *------------------------------------------------------------------------- */ static int -H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) +H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void *key) { + H5F_t *f = (H5F_t *)obj_ptr; /* File object for operations */ + H5Z_object_t *object = (H5Z_object_t *)key; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + /* Sanity checks */ + HDassert(f); + HDassert(object); + + /* Do a global flush if the file is opened for write */ + if(H5F_ACC_RDWR & H5F_INTENT(f)) { + +/* Set API context */ +if(H5CX_push() < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set API context") +api_ctx_pushed = TRUE; + +/* When parallel HDF5 is defined, check for collective metadata reads on this + * file and set the flag for metadata I/O in the API context. -QAK, 2018/02/14 + */ +#ifdef H5_HAVE_PARALLEL + /* Check if MPIO driver is used */ + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ + + /* Sanity check for collectively calling H5Zunregister, if requested */ + /* (Sanity check assumes that a barrier on one file's comm + * is sufficient (i.e. that there aren't different comms for + * different files). -QAK, 2018/02/14 + */ + if(H5_coll_api_sanity_check_g && !object->sanity_checked) { + MPI_Comm mpi_comm; /* File's communicator */ + + /* Retrieve the file communicator */ + if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f))) + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get MPI communicator") - /* Call the flush routine for mounted file hierarchies. Do a global flush - * if the file is opened for write */ - if (H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { - if (H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) + /* Issue the barrier */ + if(mpi_comm != MPI_COMM_NULL) + MPI_Barrier(mpi_comm); + + /* Set the "sanity checked" flag */ + object->sanity_checked = TRUE; + } /* end if */ + + /* Check whether to use the collective metadata read DXPL */ + coll_md_read = H5F_COLL_MD_READ(f); + if(H5P_USER_TRUE == coll_md_read) + H5CX_set_coll_metadata_read(TRUE); + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ + + /* Call the flush routine for mounted file hierarchies */ + if(H5F_flush_mounts((H5F_t *)obj_ptr) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + +if(api_ctx_pushed && H5CX_pop() < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") +api_ctx_pushed = FALSE; } /* end if */ done: +if(api_ctx_pushed && H5CX_pop() < 0) + HDONE_ERROR(H5E_PLINE, H5E_CANTRESET, FAIL, "can't reset API context") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__flush_file_cb() */ @@ -1448,7 +1507,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_all_filters_avail() */ - /*------------------------------------------------------------------------- * Function: H5Z_delete @@ -1479,7 +1537,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } + } /* end if */ /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 373eb37..bad4cf2 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -286,7 +286,7 @@ H5Z_calc_parms_array(const H5T_t *type, size_t *cd_values_actual_nparms) done: if(dtype_base) - if(H5T_close(dtype_base) < 0) + if(H5T_close_real(dtype_base) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -385,14 +385,14 @@ H5Z_calc_parms_compound(const H5T_t *type, size_t *cd_values_actual_nparms) } /* end switch */ /* Close member datatype */ - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") dtype_member = NULL; } /* end for */ done: if(dtype_member) - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -633,7 +633,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned *cd_values_index, done: if(dtype_base) - if(H5T_close(dtype_base) < 0) + if(H5T_close_real(dtype_base) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close base datatype") FUNC_LEAVE_NOAPI(ret_value) @@ -774,14 +774,14 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned *cd_values_index, } /* end switch */ /* Close member datatype */ - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") dtype_member = NULL; } /* end for */ done: if(dtype_member) - if(H5T_close(dtype_member) < 0) + if(H5T_close_real(dtype_member) < 0) HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "Unable to close member datatype") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 2aa17f2..55fca27 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -51,5 +51,8 @@ H5_DLLVAR const H5Z_class2_t H5Z_DEFLATE[1]; H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; #endif /* H5_HAVE_FILTER_SZIP */ +/* Package internal routines */ +H5_DLL herr_t H5Z__unregister(H5Z_filter_t filter_id); + #endif /* _H5Zpkg_H */ diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 26e35a7..fbc6fc4 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -93,7 +93,6 @@ H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); -H5_DLL herr_t H5Z_unregister(H5Z_filter_t filter_id); H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL herr_t H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags); diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index b86d785..161febc 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -41,7 +41,7 @@ static enum H5Z_scaleoffset_t H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, unsigned cd_values[], - int need_convert, hid_t dxpl_id); + int need_convert); static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); @@ -183,12 +183,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for unsigned integer type */ -#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_1(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -198,12 +198,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for signed integer type */ -#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_2(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -213,12 +213,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for character integer type */ -#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_3(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ /* Store the fill value as the last entry in cd_values[] */ \ @@ -226,12 +226,12 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } /* Set the fill value parameter in cd_values[] for floating-point type */ -#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert, dxpl_id)\ +#define H5Z_scaleoffset_set_filval_4(type, dcpl_plist, dt, cd_values, need_convert) \ { \ type fill_val; \ \ /* Get dataset fill value */ \ - if(H5P_get_fill_value(dcpl_plist, dt, &fill_val, dxpl_id) < 0) \ + if(H5P_get_fill_value(dcpl_plist, dt, &fill_val) < 0) \ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get fill value") \ \ if(need_convert) \ @@ -801,36 +801,36 @@ done: static herr_t H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, H5T_t *type, enum H5Z_scaleoffset_t scale_type, - unsigned cd_values[], int need_convert, hid_t dxpl_id) + unsigned cd_values[], int need_convert) { herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT if(scale_type == t_uchar) - H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ushort) - H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_uint) - H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ulong) - H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_1(unsigned long long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_schar) - H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_3(signed char, dcpl_plist, type, cd_values, need_convertd) else if(scale_type == t_short) - H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(short, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_int) - H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(int, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_long) - H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_long_long) - H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_2(long long, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_float) - H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_4(float, dcpl_plist, type, cd_values, need_convert) else if(scale_type == t_double) - H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert, dxpl_id) + H5Z_scaleoffset_set_filval_4(double, dcpl_plist, type, cd_values, need_convert) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1002,7 +1002,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot use C integer datatype for cast") /* Get dataset fill value and store in cd_values[] */ - if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert, H5AC_noio_dxpl_id) < 0) + if(H5Z_scaleoffset_set_parms_fillval(dcpl_plist, type, scale_type, cd_values, need_convert) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "unable to set fill value") } /* end else */ diff --git a/src/H5err.txt b/src/H5err.txt index d771956..19374cd 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -76,6 +76,7 @@ MAJOR, H5E_EARRAY, Extensible Array MAJOR, H5E_FARRAY, Fixed Array MAJOR, H5E_PLUGIN, Plugin for dynamically loaded library MAJOR, H5E_PAGEBUF, Page Buffering +MAJOR, H5E_CONTEXT, API Context MAJOR, H5E_NONE_MAJOR, No error # Sections (for grouping minor errors) diff --git a/src/H5private.h b/src/H5private.h index 2f33cff..b68b886 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2168,23 +2168,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set * up a metadata tag. */ -#define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_TAG(tag, err) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ FUNC_ENTER_NOAPI_INIT(err) \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { -#define FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_NOINIT_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2194,6 +2190,12 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* Use this macro for all package-level functions that are VOL entry-points */ +#define FUNC_ENTER_PACKAGE_VOL { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + /* Use this macro for package-level functions which propgate errors, but don't issue them */ #define FUNC_ENTER_PACKAGE_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ @@ -2202,13 +2204,22 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following macro as replacement for the FUNC_ENTER_PACKAGE * macro when the function needs to set up a metadata tag. */ -#define FUNC_ENTER_PACKAGE_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_PACKAGE_TAG(tag) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5AC_tag(tag, &prev_tag); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use the following macro as replacement for the FUNC_ENTER_PACKAGE + * macro when the function needs to set up a metadata tag and is also a + * VOL entry-point. */ +#define FUNC_ENTER_PACKAGE_VOL_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2218,6 +2229,12 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { +/* Use this macro for all "normal" staticly-scoped functions that are VOL entry-points */ +#define FUNC_ENTER_STATIC_VOL { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + /* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ #define FUNC_ENTER_STATIC_NOERR { \ FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ @@ -2232,13 +2249,22 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ /* Use the following macro as replacement for the FUNC_ENTER_STATIC * macro when the function needs to set up a metadata tag. */ -#define FUNC_ENTER_STATIC_TAG(dxpl_id, tag, err) { \ +#define FUNC_ENTER_STATIC_TAG(tag) { \ haddr_t prev_tag = HADDR_UNDEF; \ - hid_t tag_dxpl_id = dxpl_id; \ \ FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ - if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(tag, &prev_tag); \ + H5_PUSH_FUNC \ + if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { + +/* Use the following macro as replacement for the FUNC_ENTER_STATIC + * macro when the function needs to set up a metadata tag and is a VOL + * entry-point. */ +#define FUNC_ENTER_STATIC_VOL_TAG(tag) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2285,6 +2311,13 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ +#define FUNC_LEAVE_NOAPI_VOL(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + H5_POP_FUNC \ + return(ret_value); \ +} /*end scope from beginning of FUNC_ENTER*/ + #define FUNC_LEAVE_NOAPI_VOID \ ; \ } /*end scope from end of FUNC_ENTER*/ \ @@ -2304,11 +2337,19 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ } /*end scope from beginning of FUNC_ENTER*/ /* Use this macro when exiting a function that set up a metadata tag */ -#define FUNC_LEAVE_NOAPI_TAG(ret_value, err) \ +#define FUNC_LEAVE_NOAPI_TAG(ret_value) \ + ; \ + } /*end scope from end of FUNC_ENTER*/ \ + H5AC_tag(prev_tag, NULL); \ + H5_POP_FUNC \ + return(ret_value); \ +} /*end scope from beginning of FUNC_ENTER*/ + +/* Use this macro when exiting a VOL entry-point function that set up a metadata tag */ +#define FUNC_LEAVE_NOAPI_VOL_TAG(ret_value) \ ; \ } /*end scope from end of FUNC_ENTER*/ \ - if(H5AC_tag(tag_dxpl_id, prev_tag, NULL) < 0) \ - HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5AC_tag(prev_tag, NULL); \ H5_POP_FUNC \ return(ret_value); \ } /*end scope from beginning of FUNC_ENTER*/ @@ -2566,15 +2607,12 @@ func_init_failed: \ /* Macro to begin/end tagging (when FUNC_ENTER_*TAG macros are insufficient). * Make sure to use HGOTO_ERROR_TAG and HGOTO_DONE_TAG between these macros! */ -#define H5_BEGIN_TAG(dxpl, tag, err) { \ - haddr_t prv_tag = HADDR_UNDEF; \ - hid_t my_dxpl_id = dxpl; \ - if(H5AC_tag(my_dxpl_id, tag, &prv_tag) < 0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") - -#define H5_END_TAG(err) \ - if(H5AC_tag(my_dxpl_id, prv_tag, NULL) <0) \ - HGOTO_ERROR(H5_MY_PKG_ERR, H5E_CANTTAG, err, "unable to apply metadata tag") \ +#define H5_BEGIN_TAG(tag) { \ + haddr_t prv_tag = HADDR_UNDEF; \ + H5AC_tag(tag, &prv_tag); \ + +#define H5_END_TAG \ + H5AC_tag(prv_tag, NULL); \ } /* Compile-time "assert" macro */ @@ -2592,6 +2630,7 @@ H5_DLL void H5_term_library(void); H5_DLL int H5A_term_package(void); H5_DLL int H5A_top_term_package(void); H5_DLL int H5AC_term_package(void); +H5_DLL int H5CX_term_package(void); H5_DLL int H5D_term_package(void); H5_DLL int H5D_top_term_package(void); H5_DLL int H5E_term_package(void); diff --git a/src/Makefile.am b/src/Makefile.am index d8d2cc2..79423f9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5C.c H5Cdbg.c H5Cepoch.c H5Cimage.c H5Clog.c H5Cprefetched.c \ H5Cquery.c H5Ctag.c H5Ctest.c \ H5CS.c \ + H5CX.c \ H5D.c H5Dbtree.c H5Dbtree2.c H5Dchunk.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \ H5Ddeprec.c H5Dearray.c H5Defl.c H5Dfarray.c H5Dfill.c H5Dint.c \ H5Dio.c H5Dlayout.c H5Dnone.c \ @@ -55,8 +56,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5E.c H5Edeprec.c H5Eint.c \ H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \ H5EAiblock.c H5EAint.c H5EAsblock.c H5EAstat.c H5EAtest.c \ - H5F.c H5Fint.c H5Faccum.c H5Fcwfs.c \ - H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ + H5F.c H5Faccum.c H5Fcwfs.c \ + H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fint.c H5Fio.c \ H5Fmount.c H5Fquery.c \ H5Fsfile.c H5Fspace.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ @@ -98,7 +99,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5PB.c \ H5PL.c H5PLint.c H5PLpath.c H5PLplugin_cache.c \ - H5R.c H5Rint.c H5Rdeprec.c \ + H5R.c H5Rdeprec.c H5Rint.c \ H5UC.c \ H5RS.c \ H5S.c H5Sall.c H5Sdbg.c H5Shyper.c H5Snone.c H5Spoint.c \ diff --git a/test/accum.c b/test/accum.c index d76c866..76e7656 100644 --- a/test/accum.c +++ b/test/accum.c @@ -20,6 +20,8 @@ #define H5FD_TESTING #include "H5Fpkg.h" #include "H5FDpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* Filename */ @@ -39,33 +41,30 @@ #define RAND_SEG_LEN (1024) #define RANDOM_BASE_OFF (1024 * 1024) -/* Make file global to all tests */ -H5F_t * f = NULL; - /* Function Prototypes */ -unsigned test_write_read(const H5F_io_info2_t *fio_info); -unsigned test_write_read_nonacc_front(const H5F_io_info2_t *fio_info); -unsigned test_write_read_nonacc_end(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap_clean(const H5F_io_info2_t *fio_info); -unsigned test_accum_overlap_size(const H5F_io_info2_t *fio_info); -unsigned test_accum_non_overlap_size(const H5F_io_info2_t *fio_info); -unsigned test_accum_adjust(const H5F_io_info2_t *fio_info); -unsigned test_read_after(const H5F_io_info2_t *fio_info); -unsigned test_free(const H5F_io_info2_t *fio_info); -unsigned test_big(const H5F_io_info2_t *fio_info); -unsigned test_random_write(const H5F_io_info2_t *fio_info); +unsigned test_write_read(H5F_t *f); +unsigned test_write_read_nonacc_front(H5F_t *f); +unsigned test_write_read_nonacc_end(H5F_t *f); +unsigned test_accum_overlap(H5F_t *f); +unsigned test_accum_overlap_clean(H5F_t *f); +unsigned test_accum_overlap_size(H5F_t *f); +unsigned test_accum_non_overlap_size(H5F_t *f); +unsigned test_accum_adjust(H5F_t *f); +unsigned test_read_after(H5F_t *f); +unsigned test_free(H5F_t *f); +unsigned test_big(H5F_t *f); +unsigned test_random_write(H5F_t *f); unsigned test_swmr_write_big(hbool_t newest_format); /* Helper Function Prototypes */ -void accum_printf(void); +void accum_printf(const H5F_t *f); /* Private Test H5Faccum Function Wrappers */ -#define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5AC_ind_read_dxpl_id, (b)) -#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5AC_ind_read_dxpl_id, (b)) -#define accum_free(fio_info,a,s) H5F__accum_free(fio_info, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) -#define accum_flush(fio_info) H5F__accum_flush(fio_info) -#define accum_reset(fio_info) H5F__accum_reset(fio_info, TRUE) +#define accum_write(a,s,b) H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) +#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), (b)) +#define accum_free(f,a,s) H5F__accum_free(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s)) +#define accum_flush(f) H5F__accum_flush(f) +#define accum_reset(f) H5F__accum_reset(f, TRUE) /* ================= */ /* Main Test Routine */ @@ -88,15 +87,19 @@ void accum_printf(void); int main(void) { - H5F_io_info2_t fio_info; /* I/O info for operation */ unsigned nerrors = 0; /* track errors */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t fid = -1; + H5F_t * f = NULL; /* File for all tests */ + /* Test Setup */ puts("Testing the metadata accumulator"); /* Create a test file */ if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR @@ -105,27 +108,24 @@ main(void) file a ways. 10MB should do. */ if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) FAIL_STACK_ERROR - /* Set up I/O info for operation */ - fio_info.f = f; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) FAIL_STACK_ERROR - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) FAIL_STACK_ERROR - /* Reset metadata accumulator for the file */ - if(accum_reset(&fio_info) < 0) FAIL_STACK_ERROR + if(accum_reset(f) < 0) FAIL_STACK_ERROR /* Test Functions */ - nerrors += test_write_read(&fio_info); - nerrors += test_write_read_nonacc_front(&fio_info); - nerrors += test_write_read_nonacc_end(&fio_info); - nerrors += test_accum_overlap(&fio_info); - nerrors += test_accum_overlap_clean(&fio_info); - nerrors += test_accum_overlap_size(&fio_info); - nerrors += test_accum_non_overlap_size(&fio_info); - nerrors += test_accum_adjust(&fio_info); - nerrors += test_read_after(&fio_info); - nerrors += test_free(&fio_info); - nerrors += test_big(&fio_info); - nerrors += test_random_write(&fio_info); + nerrors += test_write_read(f); + nerrors += test_write_read_nonacc_front(f); + nerrors += test_write_read_nonacc_end(f); + nerrors += test_accum_overlap(f); + nerrors += test_accum_overlap_clean(f); + nerrors += test_accum_overlap_size(f); + nerrors += test_accum_non_overlap_size(f); + nerrors += test_accum_adjust(f); + nerrors += test_read_after(f); + nerrors += test_free(f); + nerrors += test_big(f); + nerrors += test_random_write(f); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; /* End of test code, close and delete file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -142,6 +142,7 @@ main(void) return 0; error: +if(api_ctx_pushed) H5CX_pop(); puts("*** TESTS FAILED ***"); return 1; } /* end main() */ @@ -165,7 +166,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read(const H5F_io_info2_t *fio_info) +test_write_read(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -188,7 +189,7 @@ test_write_read(const H5F_io_info2_t *fio_info) if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -221,7 +222,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_front(const H5F_io_info2_t *fio_info) +test_write_read_nonacc_front(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -241,13 +242,13 @@ test_write_read_nonacc_front(const H5F_io_info2_t *fio_info) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -280,7 +281,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_write_read_nonacc_end(const H5F_io_info2_t *fio_info) +test_write_read_nonacc_end(H5F_t *f) { int i = 0; int *write_buf, *read_buf; @@ -300,13 +301,13 @@ test_write_read_nonacc_end(const H5F_io_info2_t *fio_info) /* Do a simple write/read/verify of data */ /* Write 1KB at Address 0 */ if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR; - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR; if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -339,7 +340,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_free(const H5F_io_info2_t *fio_info) +test_free(H5F_t *f) { int i = 0; int32_t *wbuf = NULL; @@ -362,38 +363,38 @@ test_free(const H5F_io_info2_t *fio_info) if(accum_write(0, 256 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; - if(accum_free(fio_info, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Free an empty accumulator */ - if(accum_free(fio_info, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write second quarter of the accumulator */ if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the second quarter of the accumulator, the requested area * is bigger than the data region on the right side. */ - if(accum_free(fio_info, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Write half of the accumulator. */ if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; /* Free the first block of 4B */ - if(accum_free(fio_info, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 127 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 127*4B */ - if(accum_free(fio_info, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0) TEST_ERROR; /* Free the block of 4B at 2*4B */ - if(accum_free(fio_info, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(1 * sizeof(int32_t), 1 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -406,10 +407,10 @@ test_free(const H5F_io_info2_t *fio_info) * entirely before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(66 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -420,10 +421,10 @@ test_free(const H5F_io_info2_t *fio_info) * completely contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -434,10 +435,10 @@ test_free(const H5F_io_info2_t *fio_info) * before dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(70 * sizeof(int32_t), 122 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -448,10 +449,10 @@ test_free(const H5F_io_info2_t *fio_info) * dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(74 * sizeof(int32_t), 118 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -462,10 +463,10 @@ test_free(const H5F_io_info2_t *fio_info) * contains dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t)); - if(accum_free(fio_info, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -476,10 +477,10 @@ test_free(const H5F_io_info2_t *fio_info) * of dirty section, and ends in dirty section */ if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t)); - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; if(accum_write(72 * sizeof(int32_t), 8 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; HDmemcpy(expect + 72, wbuf, 8 * sizeof(int32_t)); - if(accum_free(fio_info, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; + if(accum_free(f, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR; /* Check that the accumulator still contains the correct data */ if(accum_read(76 * sizeof(int32_t), 116 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; @@ -492,7 +493,7 @@ test_free(const H5F_io_info2_t *fio_info) HDfree(expect); expect = NULL; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -526,7 +527,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap(const H5F_io_info2_t *fio_info) +test_accum_overlap(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -662,7 +663,7 @@ test_accum_overlap(const H5F_io_info2_t *fio_info) if(accum_read(112, 6 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -698,7 +699,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_clean(const H5F_io_info2_t *fio_info) +test_accum_overlap_clean(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -724,7 +725,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 2: End of new piece aligns with start of clean accumulated data */ /* Write 5 2's at address 20 */ /* @0:| 222221111111111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 5; i++) wbuf[i] = 2; if(accum_write(20, 5 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -764,7 +765,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 6: New piece completely within clean accumulated data */ /* Write 3 6's at address 44 */ /* @0:| 333334666511111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 6; if(accum_write(44, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -774,7 +775,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 7: New piece overlaps start of clean accumulated data */ /* Write 2 7's at address 16 */ /* @0:| 7733334666511111| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 7; if(accum_write(16, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -794,7 +795,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 9: Start of new piece aligns with end of clean accumulated data */ /* Write 3 9's at address 80 */ /* @0:| 88883334666511111999| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 3; i++) wbuf[i] = 9; if(accum_write(80, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -804,7 +805,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) /* Case 10: New piece overlaps end of clean accumulated data */ /* Write 3 2's at address 88 */ /* @0:| 888833346665111119922| */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_flush(f) < 0) FAIL_STACK_ERROR; for(i = 0; i < 2; i++) wbuf[i] = 2; if(accum_write(88, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR; @@ -842,7 +843,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info) if(accum_read(12, 22 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -877,7 +878,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_non_overlap_size(const H5F_io_info2_t *fio_info) +test_accum_non_overlap_size(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -909,7 +910,7 @@ test_accum_non_overlap_size(const H5F_io_info2_t *fio_info) if(accum_read(0, 20 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -944,7 +945,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_overlap_size(const H5F_io_info2_t *fio_info) +test_accum_overlap_size(H5F_t *f) { int i = 0; int32_t *wbuf, *rbuf; @@ -976,7 +977,7 @@ test_accum_overlap_size(const H5F_io_info2_t *fio_info) if(accum_read(60, 72 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1022,7 +1023,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_accum_adjust(const H5F_io_info2_t *fio_info) +test_accum_adjust(H5F_t *f) { int i = 0; int s = 1048576; /* size of buffer */ @@ -1068,7 +1069,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ================================================================ */ /* Case 2: Prepending large block to large, fully dirty accumulator */ @@ -1097,7 +1098,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ========================================================= */ /* Case 3: Appending small block to large, clean accumulator */ @@ -1111,7 +1112,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) /* Flush the accumulator -- we want to test the case when accumulator contains clean data */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* Write a small (1KB) block to the end of the accumulator */ /* ==> Accumulator will need more buffer space */ @@ -1132,7 +1133,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 4: Appending small block to large, partially dirty accumulator, */ @@ -1146,7 +1147,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so just the start of it is dirty */ if(accum_write(0, 5, wbuf) < 0) FAIL_STACK_ERROR; @@ -1172,7 +1173,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ==================================================================== */ /* Case 5: Appending small block to large, partially dirty accumulator, */ @@ -1183,7 +1184,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR; /* Flush the accumulator to clean it */ - if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR + if(accum_flush(f) < 0) FAIL_STACK_ERROR /* write to part of the accumulator so it's dirty, but not entirely dirty */ /* (just the begging few bytes will be clean) */ @@ -1209,7 +1210,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR; /* Reset accumulator for next case */ - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* ================================================================= */ /* Case 6: Appending small block to large, fully dirty accumulator */ @@ -1240,7 +1241,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info) if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1278,7 +1279,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_read_after(const H5F_io_info2_t *fio_info) +test_read_after(H5F_t *f) { int i = 0; int s = 128; /* size of buffer */ @@ -1323,7 +1324,7 @@ test_read_after(const H5F_io_info2_t *fio_info) if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR; if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1357,7 +1358,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_big(const H5F_io_info2_t *fio_info) +test_big(H5F_t *f) { uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */ unsigned u; /* Local index variable */ @@ -1393,7 +1394,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1412,7 +1413,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1430,7 +1431,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with beginning of "big" region */ @@ -1448,7 +1449,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to middle of accumulator */ @@ -1470,7 +1471,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to overlap with end of "big" region */ @@ -1493,7 +1494,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1521,7 +1522,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section to be past "big" region */ @@ -1549,7 +1550,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1576,7 +1577,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1604,7 +1605,7 @@ test_big(const H5F_io_info2_t *fio_info) /* Reset data in file back to zeros & reset the read buffer */ if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR; HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536)); - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; /* Write small section before "big" region */ @@ -1628,7 +1629,7 @@ test_big(const H5F_io_info2_t *fio_info) if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1665,7 +1666,7 @@ error: *------------------------------------------------------------------------- */ unsigned -test_random_write(const H5F_io_info2_t *fio_info) +test_random_write(H5F_t *f) { uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */ unsigned seed = 0; /* Random # seed */ @@ -1765,7 +1766,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); /* Verify data read back in */ if(HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0) TEST_ERROR; - if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR; + if(accum_reset(f) < 0) FAIL_STACK_ERROR; PASSED(); @@ -1819,15 +1820,14 @@ test_swmr_write_big(hbool_t newest_format) pid_t pid; /* Process ID */ #endif /* H5_HAVE_UNISTD_H */ int status; /* Status returned from child process */ - H5F_io_info2_t fio_info; /* I/O info for operation */ char *new_argv[] = {NULL}; char *driver = NULL; /* VFD string (from env variable) */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ - if(newest_format) { - TESTING("SWMR write of large metadata: with latest format"); - } else { - TESTING("SWMR write of large metadata: with non-latest-format"); - } /* end if */ + if(newest_format) + TESTING("SWMR write of large metadata: with latest format") + else + TESTING("SWMR write of large metadata: with non-latest-format") #if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)) @@ -1870,17 +1870,12 @@ test_swmr_write_big(hbool_t newest_format) /* Open the file with SWMR_WRITE */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR - /* Set up I/O info for operation */ - fio_info.f = rf; - if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) - FAIL_STACK_ERROR - if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) - FAIL_STACK_ERROR - /* We'll be writing lots of garbage data, so extend the file a ways. 10MB should do. */ if(H5FD_set_eoa(rf->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) @@ -1890,7 +1885,7 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Reset metadata accumulator for the file */ - if(accum_reset(&fio_info) < 0) + if(accum_reset(rf) < 0) FAIL_STACK_ERROR; /* Allocate space for the write & read buffers */ @@ -1904,16 +1899,16 @@ test_swmr_write_big(hbool_t newest_format) wbuf[u] = (uint8_t)u; /* Write [1024, 1024] bytes with wbuf */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR; /* Flush the data to disk */ - if(accum_reset(&fio_info) < 0) + if(accum_reset(rf) < 0) FAIL_STACK_ERROR; /* Initialize wbuf with all 1s */ @@ -1925,10 +1920,10 @@ test_swmr_write_big(hbool_t newest_format) wbuf2[u] = (uint8_t)(u + 1); /* Write [1024,1024] with wbuf--all 1s */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) @@ -1936,10 +1931,10 @@ test_swmr_write_big(hbool_t newest_format) /* The data stays in the accumulator */ /* Write a large piece of metadata [2048, BIG_BUF_SIZE] with wbuf2 */ - if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, wbuf2) < 0) + if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, wbuf2) < 0) FAIL_STACK_ERROR; /* Read the data */ - if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0) @@ -1950,9 +1945,9 @@ test_swmr_write_big(hbool_t newest_format) HDperror("fork"); FAIL_STACK_ERROR; } else if(0 == pid) { /* Child process */ - /* Run the reader */ - status = HDexecv(SWMR_READER, new_argv); - printf("errno from execv = %s\n", strerror(errno)); + /* Run the reader */ + status = HDexecv(SWMR_READER, new_argv); + printf("errno from execv = %s\n", strerror(errno)); FAIL_STACK_ERROR; } /* end if */ @@ -1963,8 +1958,8 @@ test_swmr_write_big(hbool_t newest_format) /* Check if child process terminates normally and its return value */ if(WIFEXITED(status) && !WEXITSTATUS(status)) { /* Flush the accumulator */ - if(accum_reset(&fio_info) < 0) - FAIL_STACK_ERROR; + if(accum_reset(rf) < 0) + FAIL_STACK_ERROR; /* Close the property list */ if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; @@ -1972,6 +1967,8 @@ test_swmr_write_big(hbool_t newest_format) /* Close and remove the file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDremove(SWMR_FILENAME); /* Release memory */ @@ -1987,6 +1984,7 @@ error: /* Closing and remove the file */ H5Pclose(fapl); H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); HDremove(SWMR_FILENAME); /* Release memory */ if(wbuf2) @@ -2015,7 +2013,7 @@ error: *------------------------------------------------------------------------- */ void -accum_printf(void) +accum_printf(const H5F_t *f) { H5F_meta_accum_t * accum = &f->shared->accum; diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index c1a238d..9005b99 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -17,6 +17,8 @@ #include "H5Fpkg.h" #include "H5FDpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */ @@ -48,6 +50,7 @@ main(void) uint8_t rbuf[1024]; /* Buffer for reading */ uint8_t buf[1024]; /* Buffer for holding the expected data */ char *driver = NULL; /* VFD string (from env variable) */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Skip this test if SWMR I/O is not supported for the VFD specified * by the environment variable. @@ -69,13 +72,15 @@ main(void) /* Open the file with SWMR_READ */ if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR /* Should read in [1024, 2024] with buf data */ - if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0) + if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) FAIL_STACK_ERROR; /* Verify the data read is correct */ @@ -87,11 +92,14 @@ main(void) FAIL_STACK_ERROR; if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return EXIT_SUCCESS; error: H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); return EXIT_FAILURE; } /* end main() */ diff --git a/test/btree2.c b/test/btree2.c index 4c820b3..fb0156c 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -25,6 +25,7 @@ #include "H5B2pkg.h" /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" const char *FILENAME[] = { @@ -145,11 +146,11 @@ error: *------------------------------------------------------------------------- */ static int -create_btree(H5F_t *f, hid_t dxpl, const H5B2_create_t *cparam, +create_btree(H5F_t *f, const H5B2_create_t *cparam, H5B2_t **bt2, haddr_t *bt2_addr) { /* Create the v2 B-tree & get its address */ - if(NULL == (*bt2 = H5B2_create(f, dxpl, cparam, f))) + if(NULL == (*bt2 = H5B2_create(f, cparam, f))) FAIL_STACK_ERROR if(H5B2_get_addr(*bt2, bt2_addr/*out*/) < 0) FAIL_STACK_ERROR @@ -219,17 +220,17 @@ error: *------------------------------------------------------------------------- */ static int -reopen_btree(H5F_t *f, hid_t dxpl, H5B2_t **bt2, haddr_t bt2_addr, +reopen_btree(H5F_t *f, H5B2_t **bt2, haddr_t bt2_addr, const bt2_test_param_t *tparam) { /* Check for closing & re-opening the B-tree */ if(tparam->reopen_btree) { /* Close (empty) v2 B-tree */ - if(H5B2_close(*bt2, dxpl) < 0) + if(H5B2_close(*bt2) < 0) FAIL_STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (*bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (*bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR } /* end if */ @@ -289,11 +290,11 @@ error: *------------------------------------------------------------------------- */ static int -check_node_depth(H5B2_t *bt2, hid_t dxpl, void *record, unsigned depth) +check_node_depth(H5B2_t *bt2, void *record, unsigned depth) { int rec_depth; /* Depth of record in B-tree */ - if((rec_depth = H5B2_get_node_depth_test(bt2, dxpl, record)) < 0) + if((rec_depth = H5B2__get_node_depth_test(bt2, record)) < 0) FAIL_STACK_ERROR if((unsigned)rec_depth != depth) TEST_ERROR @@ -320,12 +321,12 @@ error: *------------------------------------------------------------------------- */ static int -check_node_info(H5B2_t *bt2, hid_t dxpl, hsize_t record, +check_node_info(H5B2_t *bt2, hsize_t record, H5B2_node_info_test_t *ninfo) { H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */ - if(H5B2_get_node_info_test(bt2, dxpl, &record, &rec_ninfo) < 0) + if(H5B2__get_node_info_test(bt2, &record, &rec_ninfo) < 0) FAIL_STACK_ERROR if(rec_ninfo.depth != ninfo->depth) TEST_ERROR @@ -655,7 +656,6 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -672,7 +672,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR PASSED(); @@ -683,12 +683,12 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree iteration: empty B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to iterate over a B-tree with no records */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index hasn't changed */ if(idx != 0) @@ -696,13 +696,13 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find record in B-tree with no records */ idx = 0; - if(H5B2_find(bt2, dxpl, &idx, find_cb, NULL) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, NULL) != FALSE) TEST_ERROR /* Attempt to index record in B-tree with no records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -716,37 +716,37 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: first record"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &idx, NULL, NULL) != FALSE) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ idx = 42; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Try again with NULL 'op' */ - if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &idx, NULL, NULL) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -754,7 +754,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ idx = 42; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR PASSED(); @@ -765,45 +765,45 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: several records"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* * Test inserting second record into v2 B-tree, before all other records */ record = 34; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* * Test inserting third record into v2 B-tree, after all other records */ record = 56; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* * Test inserting fourth record into v2 B-tree, in the middle of other records */ record = 38; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ idx = 41; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ idx = 56; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -811,20 +811,20 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ idx = 34; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) TEST_ERROR idx = 38; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0) TEST_ERROR idx = 42; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0) TEST_ERROR idx = 56; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -840,7 +840,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -869,7 +869,6 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -888,13 +887,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records to fill root leaf node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -904,16 +903,16 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split root leaf node */ record = INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -922,20 +921,20 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert a couple more records, on the left side of the B-tree */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -944,17 +943,17 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -964,23 +963,23 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-1 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC + 10; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-1 B-tree */ idx = 33; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to find existant record in leaf of level-1 B-tree */ idx = 56; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to index non-existant record in level-1 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC+2), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -988,21 +987,21 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-1 B-tree */ idx = 33; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in left leaf of level-1 B-tree */ idx = 0; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in right leaf of level-1 B-tree */ idx = 50; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1016,7 +1015,7 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1046,7 +1045,6 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1063,13 +1061,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC/2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1079,18 +1077,18 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)INSERT_SPLIT_ROOT_NREC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1100,11 +1098,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1116,13 +1114,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistribute 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1132,17 +1130,17 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1152,11 +1150,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1171,7 +1169,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1201,7 +1199,6 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1218,13 +1215,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1234,17 +1231,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1254,14 +1251,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 31; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1273,13 +1270,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split side leaf into 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1289,17 +1286,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force right node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1309,14 +1306,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 62; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1331,7 +1328,7 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1363,7 +1360,6 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1381,13 +1377,13 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1397,17 +1393,17 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1417,20 +1413,20 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to force middle node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + INSERT_SPLIT_ROOT_NREC; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1440,19 +1436,19 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 52; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 105; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1460,7 +1456,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1475,7 +1471,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1506,7 +1502,6 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1524,13 +1519,13 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 2); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1540,17 +1535,17 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force split from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1560,22 +1555,22 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 62; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 126; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1583,7 +1578,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1598,7 +1593,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1625,7 +1620,6 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1644,18 +1638,18 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) { record = u + 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1665,37 +1659,37 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 948; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to left-most leaf */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 9) + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = (INSERT_SPLIT_ROOT_NREC * 9) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1705,43 +1699,43 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find non-existant record in level-2 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC * 30; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-2 B-tree */ idx = 948; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 948; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 505; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ record = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ idx = 0; H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC * 30), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -1749,21 +1743,21 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ idx = 948; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to index existing record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -1778,7 +1772,7 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -1807,7 +1801,6 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -1825,19 +1818,19 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* And fill rightmost leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1847,22 +1840,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1859; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1921; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to force redistribution of rightmost leaf */ record = u + INSERT_SPLIT_ROOT_NREC + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -1871,13 +1864,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1875; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1922; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -1885,7 +1878,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistrib left-most leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -1894,13 +1887,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 94; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 32; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add more records to left-most leaf, to force a 2->1 split and then a @@ -1908,7 +1901,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1918,13 +1911,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 47; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -1932,7 +1925,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redistrib middle leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -1941,22 +1934,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */ + if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR record = 535; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ TEST_ERROR record = 630; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ TEST_ERROR record = 568; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ TEST_ERROR /* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -1966,25 +1959,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1008; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */ + if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */ TEST_ERROR record = 524; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */ TEST_ERROR record = 577; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */ TEST_ERROR record = 568; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ + if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */ TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -1992,7 +1985,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2007,7 +2000,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2036,7 +2029,6 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2054,18 +2046,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) { record = u + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) { record = u + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2075,23 +2067,23 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1797; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1859; /* Right-most record in right-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert enough records to force right-most leaf to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2101,16 +2093,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1828; /* Next-to-right-most record in right-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1860; /* Right-most record in right-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1891; /* Right-most record in right-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2118,7 +2110,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split left-most leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2127,18 +2119,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 63; /* Left-most record in left-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 1; /* Left-most record in left-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add another record to left-most leaf, to force a 1->2 node split on left leaf */ record = 0; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2147,16 +2139,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 63; /* Left-most record in left-most internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 32; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left-most leaf */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2164,7 +2156,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split middle leaf in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2173,21 +2165,21 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 504; /* Record in internal node just before insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 568; /* Record in internal node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 506; /* Record in leaf node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Add another record to middle leaf, to force a node split on middle leaf */ record = (INSERT_SPLIT_ROOT_NREC * 8) + 1; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2196,28 +2188,28 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 946; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 504; /* Left-most record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 537; /* Middle record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 568; /* Right-most record of split in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 506; /* Record in leaf node just after insertion point */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2225,7 +2217,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2240,7 +2232,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2270,7 +2262,6 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2288,14 +2279,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* And fill up right internal node, to just before to redistribute it */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2305,22 +2296,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1318; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3114; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3145; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to redistribute right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2329,13 +2320,13 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3114; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3146; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2343,7 +2334,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: redist. 2 internal (l->r) in level 2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2352,19 +2343,19 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1822; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 436; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 374; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Force left-most internal node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2374,22 +2365,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1570; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 61; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2397,7 +2388,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2412,7 +2403,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2442,7 +2433,6 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2460,14 +2450,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ /* (And fill up two child internal nodes) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2477,22 +2467,22 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 4555; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 4586; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split right-most internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2501,16 +2491,16 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3704; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 4555; /* Right-most record in right internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 4387; /* Right-most record in right leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR PASSED(); @@ -2518,7 +2508,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree insert: split side internal node to 2 in level 2 B-tree (l->2)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2527,19 +2517,19 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 2759; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 932; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 870; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Force left-most internal node to split */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2549,25 +2539,25 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 870; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1814; /* Next-to-left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 61; /* Left-most record in left internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 0; /* Left-most record in left leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2575,7 +2565,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2590,7 +2580,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2621,7 +2611,6 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2639,18 +2628,18 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 3 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2660,29 +2649,29 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2267; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3199; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3137; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2692,28 +2681,28 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3104; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3137; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3135; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert another record, forcing the middle internal node to redistribute */ record = u + (INSERT_SPLIT_ROOT_NREC * 36); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2722,30 +2711,30 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1574; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3104; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR #ifdef NONE record = 2862; /* Record to left of insertion point in right internal node (now) */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR #endif /* NONE */ record = 3137; /* Record to right of insertion point in right internal node (now) */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 3135; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2753,7 +2742,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2768,7 +2757,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2799,7 +2788,6 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -2817,24 +2805,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 3 internal nodes */ /* (and fill right internal node) */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) { record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ @@ -2843,25 +2831,25 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 1952; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2884; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2822; /* Record just after insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Insert records to fill up middle internal node */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) { record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -2871,28 +2859,28 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2789; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2822; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2823; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split middle internal node */ record = u + (INSERT_SPLIT_ROOT_NREC * 31); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -2901,33 +2889,33 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 2789; /* Middle record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR record = 3703; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR #ifdef NONE record = 3049; /* Record to left of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR #endif /* NONE */ record = 2822; /* Record to right of insertion point in middle internal node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 2823; /* Record just above insertion point in leaf node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -2935,7 +2923,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -2950,7 +2938,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -2979,7 +2967,6 @@ test_insert_lots(hid_t fapl, const H5B2_create_t *cparam, hid_t file = -1; /* File ID */ char filename[1024]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -3038,13 +3025,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3055,7 +3042,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3076,7 +3063,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Check up on B-tree after re-open */ @@ -3087,7 +3074,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Iterate over B-tree to check records have been inserted correctly */ idx = 0; - if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3097,7 +3084,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find non-existant record in level-4 B-tree */ /* (Should not be found, but not fail) */ idx = INSERT_MANY * 2; - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Find random records */ @@ -3106,19 +3093,19 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); idx = (hsize_t)(HDrandom()%INSERT_MANY); /* Attempt to find existant record in root of level-4 B-tree */ - if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE) + if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR } /* end for */ /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY*3), find_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3131,12 +3118,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Attempt to find existant record in root of level-4 B-tree */ /* (in increasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_INC, idx, find_cb, &idx) < 0) FAIL_STACK_ERROR /* Attempt to find existant record in root of level-4 B-tree */ /* (in decreasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) + if(H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3145,12 +3132,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TESTING("B-tree insert: attempt duplicate record in level 4 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = INSERT_MANY / 2; H5E_BEGIN_TRY { - ret = H5B2_insert(bt2, dxpl, &record); + ret = H5B2_insert(bt2, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3165,7 +3152,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3182,7 +3169,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -3209,7 +3196,6 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3222,7 +3208,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* @@ -3231,47 +3217,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: inserting first record in empty B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record.key = 42; record.val = 72; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &find, NULL, NULL) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ find.key = 42; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != 72) TEST_ERROR /* Try again with NULL 'op' */ find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &find, NULL, NULL) != TRUE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3279,7 +3265,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ find.key = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 42) TEST_ERROR @@ -3295,47 +3281,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: update only record in B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR modify.key = 42; modify.val = 43; - if(H5B2_update(bt2, dxpl, &modify, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &modify, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Try again with NULL 'op' */ /* (Should not be found, but not fail) */ - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE) + if(H5B2_find(bt2, &find, NULL, NULL) != FALSE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find modified record in B-tree with 1 record */ find.key = 42; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != 43) TEST_ERROR /* Try again with NULL 'op' */ find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE) + if(H5B2_find(bt2, &find, NULL, NULL) != TRUE) FAIL_STACK_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3344,7 +3330,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with 1 record */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 42) TEST_ERROR @@ -3360,7 +3346,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: insert several records"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* @@ -3368,7 +3354,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 34; record.val = 11; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* @@ -3376,7 +3362,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 56; record.val = 12; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* @@ -3384,28 +3370,28 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, */ record.key = 38; record.val = 13; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ find.key = 10; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several records */ find.key = 56; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) TEST_ERROR if(find.val != 12) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3414,7 +3400,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 34) TEST_ERROR @@ -3422,7 +3408,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 38) TEST_ERROR @@ -3430,7 +3416,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 42) TEST_ERROR @@ -3438,7 +3424,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 56) TEST_ERROR @@ -3456,43 +3442,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, record.key = 34; modify.key = 34; modify.val = 21; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 38; modify.key = 38; modify.val = 23; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 42; modify.key = 42; modify.val = 24; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR record.key = 56; modify.key = 56; modify.val = 22; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ /* (Should not be found, but not fail) */ find.key = 41; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ find.key = 56; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) TEST_ERROR if(find.val != 22) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)4, index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3501,7 +3487,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in B-tree with several records */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 34) TEST_ERROR @@ -3509,7 +3495,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 38) TEST_ERROR @@ -3517,7 +3503,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 42) TEST_ERROR @@ -3525,7 +3511,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0) TEST_ERROR if(find.key != 56) TEST_ERROR @@ -3533,7 +3519,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3550,7 +3536,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3579,7 +3565,6 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3600,14 +3585,14 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records to fill root leaf node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC - 1); u++) { record.key = u + 2; record.val = u * 2 + 4; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3617,17 +3602,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert record to split root leaf node */ record.key = INSERT_SPLIT_ROOT_NREC_REC + 1; record.val = (INSERT_SPLIT_ROOT_NREC_REC - 1) * 2 + 4; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -3636,13 +3621,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 2; idx.val = 4; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3650,7 +3635,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Modify all records */ @@ -3658,7 +3643,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, record.key = u + 2; modify.key = u + 2; modify.val = u * 2 + 5; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3668,13 +3653,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 2; idx.val = 5; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3683,17 +3668,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert a couple more records, on the left side of the B-tree */ record.key = 0; record.val = 1; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = 3; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check up on B-tree */ @@ -3702,18 +3687,18 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 33; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 1; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -3724,7 +3709,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = 800; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -3732,7 +3717,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-1 B-tree */ find.key = 33; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.key != 33) TEST_ERROR @@ -3742,7 +3727,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in leaf of level-1 B-tree */ find.key = 56; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.key != 56) TEST_ERROR @@ -3751,7 +3736,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index non-existant record in level-1 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC + 2), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -3760,7 +3745,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 33) TEST_ERROR @@ -3770,7 +3755,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in left leaf of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 0) TEST_ERROR @@ -3780,7 +3765,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in right leaf of level-1 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 50) TEST_ERROR @@ -3788,7 +3773,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3802,7 +3787,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -3832,7 +3817,6 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -3849,14 +3833,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; record.val = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3866,11 +3850,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR @@ -3878,7 +3862,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) { record.key = u; record.val = u + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3888,11 +3872,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3904,14 +3888,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: redistribute 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3921,18 +3905,18 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force redistribution from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 9; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -3942,11 +3926,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -3961,7 +3945,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -3991,7 +3975,6 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4008,14 +3991,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4025,18 +4008,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4046,14 +4029,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 31; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 64; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4065,14 +4048,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: split side leaf into 2 leaves in level 1 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = u + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4082,18 +4065,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force right node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4103,14 +4086,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 95; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4125,7 +4108,7 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4157,7 +4140,6 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4175,14 +4157,14 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4192,18 +4174,18 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC); - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force left node to split */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4213,21 +4195,21 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert records to force middle node to redistribute */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); u++) { record.key = u + INSERT_SPLIT_ROOT_NREC_REC; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4237,20 +4219,20 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 52; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 107; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4258,7 +4240,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4273,7 +4255,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4304,7 +4286,6 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4322,14 +4303,14 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) { record.key = u + (INSERT_SPLIT_ROOT_NREC_REC * 2); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4339,18 +4320,18 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Force split from left node into right node */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 2); u++) { record.key = u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4360,23 +4341,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 63; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 95; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record.key = 128; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4384,7 +4365,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4399,7 +4380,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4426,7 +4407,6 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ H5B2_test_rec_t record; /* Record to insert into tree */ @@ -4446,20 +4426,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = u + 2; /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = u + 4; /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4469,42 +4449,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1347; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to left-most leaf */ record.key = 0; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4515,7 +4495,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4523,45 +4503,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1347; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1347 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1347; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 513; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (513 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 513; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4570,7 +4550,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1347) TEST_ERROR @@ -4580,7 +4560,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 513) TEST_ERROR @@ -4590,7 +4570,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4598,7 +4578,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4611,20 +4591,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: make level 2 B-tree (r->l)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - (u +2); /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4634,42 +4614,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1344; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to right-most leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)); record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4680,7 +4660,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4688,45 +4668,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1344; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1344 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1344; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 512; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (512 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 512; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4735,7 +4715,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in root of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1344) TEST_ERROR @@ -4745,7 +4725,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 512) TEST_ERROR @@ -4755,7 +4735,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4763,7 +4743,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4776,20 +4756,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree update: make level 2 B-tree (l+r->middle)"); /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert enough records to force root to split into 2 internal nodes */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) { record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 3) - u; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) { record.key = u - ((INSERT_SPLIT_ROOT_NREC_REC * 9) - 2); /* Leave a gap for later insertion */ record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -4799,52 +4779,52 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, if(check_stats(bt2, &bt2_stat) < 0) TEST_ERROR record.key = 1345; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Add some extra records to right-most leaf */ record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 4; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 5; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to middle leaf */ record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 2; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 3; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Add some extra records to left-most leaf */ record.key = 0; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR record.key = 1; record.val = record.key * 2; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Iterate over B-tree to check records have been inserted correctly */ idx.key = 0; idx.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -4855,7 +4835,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* (Should not be found, but not fail) */ find.key = INSERT_SPLIT_ROOT_NREC_REC * 42; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -4863,45 +4843,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to find existant record in root of level-2 B-tree */ find.key = 1345; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (1345 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 1345; - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR /* Attempt to find existant record in internal node of level-2 B-tree */ find.key = 513; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (513 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 513; - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Attempt to find existant record in leaf of level-2 B-tree */ find.key = 555; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (555 * 2)) TEST_ERROR /* Check with B-tree */ record.key = 555; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR /* Attempt to index non-existant record in level-2 B-tree */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_SPLIT_ROOT_NREC_REC * 42), index_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -4910,7 +4890,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 1345) TEST_ERROR @@ -4920,7 +4900,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in internal node of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 513) TEST_ERROR @@ -4930,7 +4910,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to index existing record in leaf of level-2 B-tree */ find.key = (hsize_t)-1; find.val = (hsize_t)-1; - if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != 555) TEST_ERROR @@ -4938,7 +4918,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -4953,7 +4933,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -4980,7 +4960,6 @@ test_update_lots(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ time_t curr_time; /* Current time, for seeding random number generator */ @@ -5033,13 +5012,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY_REC; u++) { record = records[u]; - if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0) + if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5050,7 +5029,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5064,7 +5043,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Check up on B-tree after re-open */ @@ -5076,7 +5055,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Iterate over B-tree to check records have been inserted correctly */ iter.key = 0; iter.val = 0; - if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &iter) < 0) + if(H5B2_iterate(bt2, iter_rec_cb, &iter) < 0) FAIL_STACK_ERROR /* Make certain that the index is correct */ @@ -5087,7 +5066,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* (Should not be found, but not fail) */ find.key = INSERT_MANY_REC * 2; find.val = (hsize_t)-1; - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE) TEST_ERROR if(find.val != (hsize_t)-1) TEST_ERROR @@ -5099,7 +5078,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); find.val = (hsize_t)-1; /* Attempt to find existant record in level-4 B-tree */ - if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE) + if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE) FAIL_STACK_ERROR if(find.val != (find.key * 2)) TEST_ERROR @@ -5107,13 +5086,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */ H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_INC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR H5E_BEGIN_TRY { - ret = H5B2_index(bt2, dxpl, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); + ret = H5B2_index(bt2, H5_ITER_DEC, (hsize_t)(INSERT_MANY_REC * 3), find_rec_cb, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5132,7 +5111,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to find existant record in level-4 B-tree */ /* (in increasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != idx) TEST_ERROR @@ -5145,7 +5124,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); /* Attempt to find existant record in level-4 B-tree */ /* (in decreasing order) */ - if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, index_rec_cb, &find) < 0) + if(H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0) FAIL_STACK_ERROR if(find.key != (INSERT_MANY_REC - (idx + 1))) TEST_ERROR @@ -5158,13 +5137,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TESTING("B-tree update: update record in level 4 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record.key = INSERT_MANY_REC / 2; modify.key = INSERT_MANY_REC / 2; modify.val = record.key * 3; - if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0) + if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5176,7 +5155,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5194,7 +5173,7 @@ error: HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -5222,7 +5201,6 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5239,7 +5217,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5253,7 +5231,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a record from a B-tree with no records */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5264,12 +5242,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: non-existant record from 1 record B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert one record into B-tree */ record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5291,7 +5269,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5303,12 +5281,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: existant record from 1 record B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5337,21 +5315,21 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: adding records to B-tree after removal"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Insert several records into B-tree again */ record = 42; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 34; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 56; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR record = 38; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR /* Query the number of records in the B-tree */ @@ -5368,12 +5346,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: non-existant record from level-0 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 0; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5385,12 +5363,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: mult. existant records from level-0 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 42; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5415,7 +5393,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 34; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5440,7 +5418,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 56; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5465,7 +5443,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, record = 38; rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5489,7 +5467,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5504,7 +5482,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5530,7 +5508,6 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5548,13 +5525,13 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -5577,7 +5554,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Attempt to remove a non-existant record from a B-tree with 1 record */ record = (INSERT_SPLIT_ROOT_NREC * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL); + ret = H5B2_remove(bt2, &record, NULL, NULL); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -5597,22 +5574,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from right leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = (INSERT_SPLIT_ROOT_NREC * 2) - 2; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5621,10 +5598,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5641,16 +5618,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from left leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = 0; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 1; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5659,10 +5636,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5679,16 +5656,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: record from middle leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check up on B-tree */ record = INSERT_SPLIT_ROOT_NREC; - if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) + if(check_node_depth(bt2, &record, (unsigned)0) < 0) TEST_ERROR rrecord = 0; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5697,10 +5674,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, /* Make certain that the leaf nodes didn't redistribute */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5712,7 +5689,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5727,7 +5704,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5753,7 +5730,6 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5770,22 +5746,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 94; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -5805,14 +5781,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */ for(u = 0; u < 8; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5830,10 +5806,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 90; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR PASSED(); @@ -5842,13 +5818,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (l->r)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR for(u = 0; u < 39; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5866,10 +5842,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 64; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 90; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR PASSED(); @@ -5878,13 +5854,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: redistribute 3 leaves in level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR for(u = 0; u < 2; u++) { record = INSERT_SPLIT_ROOT_NREC + 2 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -5902,14 +5878,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 64; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 91; /* Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -5924,7 +5900,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -5950,7 +5926,6 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -5967,24 +5942,24 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6004,14 +5979,14 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6031,7 +6006,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 62; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR PASSED(); @@ -6040,31 +6015,31 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (l->r)"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Fill B-tree back up */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Remove records */ for(u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6084,11 +6059,11 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 94; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6103,7 +6078,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6129,7 +6104,6 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6146,24 +6120,24 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6183,14 +6157,14 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */ for(u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6210,11 +6184,11 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 37; /* Only record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6229,7 +6203,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6255,7 +6229,6 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6272,30 +6245,30 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 5 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 220; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6315,13 +6288,13 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ record = 220; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6330,18 +6303,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6362,12 +6335,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from left leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6376,18 +6349,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 63; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 125; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6404,12 +6377,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from middle leaf of level-1 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR record = 125; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6418,18 +6391,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, /* Check record values in root of B-tree */ record = 63; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 126; /* Center-Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR record = 188; /* Center-Right record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 4; record = 221; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6441,7 +6414,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6456,7 +6429,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6482,7 +6455,6 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6499,24 +6471,24 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6536,7 +6508,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ @@ -6545,7 +6517,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6563,7 +6535,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 94; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6572,12 +6544,12 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 90; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6589,7 +6561,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6604,7 +6576,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6630,7 +6602,6 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6647,24 +6618,24 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6684,7 +6655,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ @@ -6693,7 +6664,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar for(u = 0; u < 7; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6711,7 +6682,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6720,12 +6691,12 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar /* Check record values in root of B-tree */ record = 39; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 86; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6737,7 +6708,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6752,7 +6723,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6778,7 +6749,6 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6795,24 +6765,24 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6832,7 +6802,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */ @@ -6841,7 +6811,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 14; u++) { record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6859,7 +6829,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 87; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -6870,7 +6840,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 62; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6882,7 +6852,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -6897,7 +6867,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -6923,7 +6893,6 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -6940,24 +6909,24 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 leaves */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 62; /* Left-most record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) + if(check_node_depth(bt2, &record, (unsigned)1) < 0) TEST_ERROR ninfo.depth = 1; ninfo.nrec = 2; record = 94; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -6977,7 +6946,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */ @@ -6986,7 +6955,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, for(u = 0; u < 50; u++) { record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7004,7 +6973,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7015,7 +6984,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 37; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7027,7 +6996,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7042,7 +7011,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7068,7 +7037,6 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7085,13 +7053,13 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-1 B-tree with 2 leaves */ for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -7099,7 +7067,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 1; record = 31; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7119,14 +7087,14 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from B-tree to force a single leaf for the B-tree */ for(u = 0; u < 14; u++) { record = INSERT_SPLIT_ROOT_NREC - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7146,7 +7114,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 0; ninfo.nrec = (uint16_t)(INSERT_SPLIT_ROOT_NREC - u); record = 31; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7166,7 +7134,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7181,7 +7149,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7207,7 +7175,6 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7224,24 +7191,24 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7261,20 +7228,20 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in right internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 2960; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */ record = 2960; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7285,7 +7252,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 2961; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7302,19 +7269,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from left internal of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in left internal node */ ninfo.depth = 1; ninfo.nrec = 29; record = 1133; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 1133; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7325,7 +7292,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 29; record = 1134; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7342,19 +7309,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote from middle internal of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in middle internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 2267; /* Record in middle internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 2267; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7365,7 +7332,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 2268; /* Record in middle internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7382,19 +7349,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree remove: promote record from root of level-2 B-tree"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in root node */ ninfo.depth = 2; ninfo.nrec = 2; record = 1889; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 1889; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7405,7 +7372,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 2; record = 1890; /* Left record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7417,19 +7384,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in root node */ ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR record = 2834; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7440,7 +7407,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 2; record = 2835; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7452,7 +7419,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7467,7 +7434,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7493,7 +7460,6 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7510,24 +7476,24 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7547,21 +7513,21 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 14; record = 3685; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 8; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7579,7 +7545,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * record = 3685; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7590,7 +7556,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * ninfo.depth = 1; ninfo.nrec = 14; record = 3681; /* Right-most record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7602,7 +7568,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7617,7 +7583,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t * error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7643,7 +7609,6 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7660,24 +7625,24 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7697,21 +7662,21 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 62; /* Left-most record in left node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 38; u++) { record = 63 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7729,7 +7694,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * record = 62; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7740,7 +7705,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * ninfo.depth = 1; ninfo.nrec = 29; record = 49; /* Left-most record in left node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7752,7 +7717,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7767,7 +7732,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t * error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7793,7 +7758,6 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7810,24 +7774,24 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7847,21 +7811,21 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in right internal node */ ninfo.depth = 1; ninfo.nrec = 14; record = 3685; /* Right-most record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 15; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7880,7 +7844,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge by promoting current right-most record */ record = 3678; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -7891,7 +7855,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar ninfo.depth = 1; ninfo.nrec = 13; record = 3653; /* Right-most record in right internal node (now) */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7903,7 +7867,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -7918,7 +7882,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -7944,7 +7908,6 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -7961,24 +7924,24 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -7998,21 +7961,21 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check information about record in left internal node */ ninfo.depth = 1; ninfo.nrec = 29; record = 62; /* Left-most record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < 112; u++) { record = 48 + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8031,7 +7994,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar /* Force merge of left-most internal nodes by promotion */ record = 25; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8042,7 +8005,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar ninfo.depth = 1; ninfo.nrec = 28; record = 37; /* Left-most record in left internal node (now) */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8054,7 +8017,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8069,7 +8032,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8095,7 +8058,6 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8112,24 +8074,24 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8149,14 +8111,14 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) { record = u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8176,11 +8138,11 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 2834; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8195,7 +8157,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8221,7 +8183,6 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8238,24 +8199,24 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8275,14 +8236,14 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8302,11 +8263,11 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam ninfo.depth = 2; ninfo.nrec = 1; record = 1889; /* Middle record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8321,7 +8282,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8347,7 +8308,6 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8364,24 +8324,24 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8401,14 +8361,14 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove record from middle internal node of a level-2 B-tree to force promotion w/redistribution */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 23) + 15); u++) { record = (INSERT_SPLIT_ROOT_NREC * 20) + u; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8428,11 +8388,11 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 1196; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8447,7 +8407,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8473,7 +8433,6 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8491,24 +8450,24 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Check record values in root of B-tree */ record = 1889; /* Left record in root node */ - if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) + if(check_node_depth(bt2, &record, (unsigned)2) < 0) TEST_ERROR ninfo.depth = 2; ninfo.nrec = 2; record = 2834; /* Right record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Query the number of records in the B-tree */ @@ -8528,14 +8487,14 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to remove records from a level-2 B-tree to force back to level-1 */ for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) { record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1); rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8558,7 +8517,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8573,7 +8532,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -8599,7 +8558,6 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ hsize_t record; /* Record to insert into tree */ unsigned u; /* Local index variable */ @@ -8618,13 +8576,13 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, bt2_addr) < 0) TEST_ERROR /* Insert random records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -8635,7 +8593,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8648,7 +8606,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; @@ -8680,7 +8638,6 @@ test_remove_lots(const char *env_h5_drvr, hid_t fapl, const H5B2_create_t *cpara int fd = -1; /* File descriptor */ h5_stat_t sb; /* Stat buffer for file */ void *file_data = NULL; /* Copy of file data */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -8784,14 +8741,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); } /* end for */ /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { record = records[u]; rrecord = HSIZET_MAX; - if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0) + if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8816,7 +8773,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8868,7 +8825,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ @@ -8878,7 +8835,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); rrecord = HSIZET_MAX; /* Remove random record */ - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8903,7 +8860,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -8956,14 +8913,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { /* Remove first record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -8988,7 +8945,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9041,14 +8998,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); STACK_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Remove all records */ for(u = 0; u < INSERT_MANY; u++) { /* Remove last record */ rrecord = HSIZET_MAX; - if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) + if(H5B2_remove_by_idx(bt2, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0) FAIL_STACK_ERROR /* Make certain that the record value is correct */ @@ -9073,7 +9030,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9093,7 +9050,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; @@ -9128,7 +9085,6 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9156,45 +9112,45 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < FIND_NEIGHBOR; u++) { record = records[u]; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ /* Attempt to find record B-tree less than a value */ search = 0; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 2; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 0) TEST_ERROR search = 3; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 4; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR @@ -9203,12 +9159,12 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 14; record = 250; /* Record in left internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in internal node */ search = 251; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 250) TEST_ERROR @@ -9217,18 +9173,18 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 2; ninfo.nrec = 1; record = 1888; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in root node */ search = 1889; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = (FIND_NEIGHBOR * 2) + 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR @@ -9241,38 +9197,38 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree find: nearest neighbor greater than a value"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Attempt to find record B-tree less than a value */ search = (FIND_NEIGHBOR * 2) + 1; H5E_BEGIN_TRY { - ret = H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); + ret = H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR search = 0; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2) TEST_ERROR search = 2; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR search = 3; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 4) TEST_ERROR @@ -9281,31 +9237,31 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, ninfo.depth = 1; ninfo.nrec = 16; record = 2896; /* Record in right internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Neighbor is in internal node */ search = 2895; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 2896) TEST_ERROR /* Neighbor is in root node */ search = 1887; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != 1888) TEST_ERROR search = ((FIND_NEIGHBOR - 1) * 2) - 1; - if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) + if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0) FAIL_STACK_ERROR if(record != ((FIND_NEIGHBOR - 1) * 2)) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9322,7 +9278,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; HDfree(records); @@ -9352,7 +9308,6 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size; /* Size of an empty file */ h5_stat_size_t file_size; /* Size of each file created */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9391,18 +9346,18 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -9435,13 +9390,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_SMALL; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9452,14 +9407,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, H5AC_ind_read_dxpl_id, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9492,13 +9447,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_MEDIUM; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9509,14 +9464,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9549,13 +9504,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Insert records */ for(u = 0; u < DELETE_LARGE; u++) { record = u; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9566,14 +9521,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; /* * Delete v2 B-tree */ - if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0) + if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0) FAIL_STACK_ERROR /* Close file */ @@ -9595,7 +9550,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam) error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -9622,7 +9577,6 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, { hid_t file = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ hsize_t record; /* Record to insert into tree */ @@ -9643,13 +9597,13 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TEST_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Create level-2 B-tree with 3 internal nodes */ for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) { record = u * 5; - if(H5B2_insert(bt2, dxpl, &record) < 0) + if(H5B2_insert(bt2, &record) < 0) FAIL_STACK_ERROR } /* end for */ @@ -9663,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 3; modify = 4; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9674,33 +9628,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in leaf node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 0; ninfo.nrec = 62; record = 4330; /* Record in leaf node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in a leaf node */ record = 4330; modify = 4331; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 0; ninfo.nrec = 62; record = 4331; /* Record in leaf node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 4331; found = 4331; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) FAIL_STACK_ERROR if(found != 4331) TEST_ERROR @@ -9709,7 +9663,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 4330; found = HSIZET_MAX; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9720,33 +9674,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in internal node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 5350; /* Record in internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in an internal node */ record = 5350; modify = 5352; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 1; ninfo.nrec = 29; record = 5352; /* Record in internal node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 5352; found = 5352; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 5352) TEST_ERROR @@ -9755,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 5350; found = 5350; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) @@ -9766,33 +9720,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, TESTING("B-tree modify: modify record in root node"); /* Check for closing & re-opening the B-tree */ - if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0) + if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0) TEST_ERROR /* Check status of B-tree */ ninfo.depth = 2; ninfo.nrec = 2; record = 9445; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to modify a record in a root node */ record = 9445; modify = 9448; - if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0) + if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0) FAIL_STACK_ERROR /* Check status of B-tree */ ninfo.depth = 2; ninfo.nrec = 2; record = 9448; /* Record in root node */ - if(check_node_info(bt2, dxpl, record, &ninfo) < 0) + if(check_node_info(bt2, record, &ninfo) < 0) TEST_ERROR /* Attempt to find modified record */ record = 9448; found = 9448; - if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE) + if(H5B2_find(bt2, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 9448) TEST_ERROR @@ -9801,14 +9755,14 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, record = 9445; found = 9445; H5E_BEGIN_TRY { - ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify); + ret = H5B2_modify(bt2, &record, modify_cb, &modify); } H5E_END_TRY; /* Should fail */ if(ret != FAIL) TEST_ERROR /* Close the v2 B-tree */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9823,7 +9777,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam, error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); H5Fclose(file); } H5E_END_TRY; return 1; @@ -9856,7 +9810,6 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) hid_t file00 = -1; /* File ID */ H5F_t *f = NULL; /* Internal file object pointer */ H5F_t *f2 = NULL; /* Internal file object pointer */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ H5B2_t *bt2 = NULL; /* v2 B-tree wrapper */ H5B2_t *bt2_2 = NULL; /* Second v2 B-tree wrapper */ haddr_t bt2_addr; /* Address of B-tree created */ @@ -9881,15 +9834,15 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Create the v2 B-tree & get its address */ - if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0) + if(create_btree(f, cparam, &bt2, &bt2_addr) < 0) TEST_ERROR /* Re-open v2 B-tree */ - if(NULL == (bt2_2 = H5B2_open(f, dxpl, bt2_addr, f))) + if(NULL == (bt2_2 = H5B2_open(f, bt2_addr, f))) FAIL_STACK_ERROR /* Close the second v2 B-tree wrapper */ - if(H5B2_close(bt2_2, dxpl) < 0) + if(H5B2_close(bt2_2) < 0) FAIL_STACK_ERROR bt2_2 = NULL; @@ -9901,7 +9854,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Close the first v2 B-tree wrapper */ - if(H5B2_close(bt2, dxpl) < 0) + if(H5B2_close(bt2) < 0) FAIL_STACK_ERROR bt2 = NULL; @@ -9931,7 +9884,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Open the B-tree through the second file handle */ - if(NULL == (bt2_2 = H5B2_open(f2, dxpl, bt2_addr, f2))) + if(NULL == (bt2_2 = H5B2_open(f2, bt2_addr, f2))) FAIL_STACK_ERROR /* Close the extra file handles */ @@ -9941,7 +9894,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) FAIL_STACK_ERROR /* Close the second v2 B-tree */ - if(H5B2_close(bt2_2, dxpl) < 0) + if(H5B2_close(bt2_2) < 0) FAIL_STACK_ERROR bt2_2 = NULL; @@ -9958,9 +9911,9 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam) error: H5E_BEGIN_TRY { if(bt2) - H5B2_close(bt2, dxpl); + H5B2_close(bt2); if(bt2) - H5B2_close(bt2_2, dxpl); + H5B2_close(bt2_2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -9994,6 +9947,7 @@ main(void) unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ envval = HDgetenv("HDF5_DRIVER"); if(envval == NULL) @@ -10008,6 +9962,8 @@ main(void) /* Initialize v2 B-tree creation parameters */ init_cparam(&cparam, &cparam2); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Loop over re-opening B-tree during tests */ for(reopen = FALSE; reopen <= TRUE; reopen++) { @@ -10096,6 +10052,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/cache.c b/test/cache.c index 97a1b91..d5e3c6c 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3309,7 +3309,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -3320,7 +3320,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -3331,7 +3331,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_CLEAR_ONLY_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG); if(result < 0) { @@ -3343,7 +3343,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG); if(result < 0) { @@ -5014,7 +5014,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -5088,7 +5088,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -5245,7 +5245,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -5319,7 +5319,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -9322,7 +9322,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -9514,7 +9514,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -10793,7 +10793,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -12522,7 +12522,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -12581,7 +12581,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -12714,7 +12714,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags); + result = H5C_flush_cache(file_ptr, flush_flags); if(result < 0) { @@ -12789,7 +12789,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -14351,7 +14351,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14436,7 +14436,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14796,7 +14796,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -14883,7 +14883,7 @@ check_resize_entry(unsigned paged) } else { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result < 0) { @@ -15956,7 +15956,7 @@ check_flush_protected_err(unsigned paged) protect_entry(file_ptr, 0, 0); - if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) >= 0) { + if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) >= 0) { pass = FALSE; failure_mssg = "flush succeeded on cache with protected entry.\n"; @@ -15965,7 +15965,7 @@ check_flush_protected_err(unsigned paged) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) < 0) { + if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) < 0) { pass = FALSE; failure_mssg = "flush failed after unprotect.\n"; @@ -16032,19 +16032,19 @@ check_destroy_pinned_err(unsigned paged) protect_entry(file_ptr, 0, 0); unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { + if(H5C_prep_for_file_close(file_ptr) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) { + if(H5C_dest(file_ptr) >= 0) { pass = FALSE; failure_mssg = "destroy succeeded on cache with pinned entry.\n"; } /* end if */ else { unpin_entry(0, 0); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) < 0) { + if(H5C_dest(file_ptr) < 0) { pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; } /* end if */ @@ -16122,20 +16122,20 @@ check_destroy_protected_err(unsigned paged) * we are trying to test, put the call to H5C_prep_for_file_close() * prior to the final protect call. */ - if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) { + if(H5C_prep_for_file_close(file_ptr) < 0) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; } /* end if */ protect_entry(file_ptr, 0, 0); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) { + if(H5C_dest(file_ptr) >= 0) { pass = FALSE; failure_mssg = "destroy succeeded on cache with protected entry.\n"; } /* end if */ else { unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) < 0) { + if(H5C_dest(file_ptr) < 0) { pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; } /* end if */ @@ -16215,7 +16215,7 @@ check_duplicate_insert_err(unsigned paged) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_insert_entry(file_ptr, types[0], entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); @@ -16301,7 +16301,7 @@ check_double_pin_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); if(result > 0) { @@ -16387,7 +16387,7 @@ check_double_unpin_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); if(result > 0) { @@ -16591,7 +16591,7 @@ check_double_protect_err(unsigned paged) if(pass) { - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -16673,7 +16673,7 @@ check_double_unprotect_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16841,7 +16841,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16859,7 +16859,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result > 0) { @@ -16877,7 +16877,7 @@ check_expunge_entry_errs(unsigned paged) if(pass) { - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_expunge_entry(file_ptr, types[0], entry_ptr->addr, H5C__NO_FLAGS_SET); if(result < 0) { @@ -17174,7 +17174,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result >= 0) { @@ -17216,7 +17216,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if(pass) { - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG); if(result > 0) { @@ -17303,7 +17303,7 @@ check_protect_ro_rw_err(unsigned paged) if(pass) { - thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[0], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -17398,7 +17398,7 @@ check_protect_retries(unsigned paged) entry_ptr->max_verify_ct = 3; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if((cache_entry_ptr != (void *)entry_ptr) || @@ -17443,7 +17443,7 @@ check_protect_retries(unsigned paged) entry_ptr->max_verify_ct = 11; entry_ptr->verify_ct = 0; - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); /* H5C_protect() should fail after all retries fail */ @@ -31018,7 +31018,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31124,7 +31124,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31236,7 +31236,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31355,7 +31355,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31531,7 +31531,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31741,7 +31741,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -31899,7 +31899,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32033,7 +32033,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32226,7 +32226,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32465,7 +32465,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -32722,7 +32722,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -33009,7 +33009,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -33325,7 +33325,7 @@ check_flush_deps_order(unsigned paged) /* Reset index for tracking flush order */ flush_order = 0; - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(result < 0) CACHE_ERROR("flushing entries with flush dependendices") /* Change expected values, and verify the status of the entries @@ -34663,7 +34663,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35015,7 +35015,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35451,7 +35451,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -35838,7 +35838,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { @@ -36311,7 +36311,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) if(pass) { - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); if(result < 0) { diff --git a/test/cache_common.c b/test/cache_common.c index cadccec..78e2253 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -17,6 +17,7 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5MFprivate.h" #include "H5MMprivate.h" #include "cache_common.h" @@ -129,37 +130,37 @@ static herr_t monster_image_len(const void *thing, size_t *image_len_ptr); static herr_t variable_image_len(const void *thing, size_t *image_len_ptr); static herr_t notify_image_len(const void *thing, size_t *image_len_ptr); -static herr_t pico_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t pico_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t nano_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t nano_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t micro_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t micro_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t tiny_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t tiny_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t small_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t small_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t medium_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t medium_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t large_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t large_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t huge_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t huge_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t monster_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t monster_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t variable_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t variable_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); -static herr_t notify_pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t notify_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); @@ -212,7 +213,7 @@ static herr_t get_final_load_size(const void *image, size_t image_len, static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr, int32_t entry_type); static herr_t image_len(const void *thing, size_t *image_len_ptr, int32_t entry_type); -static herr_t pre_serialize(H5F_t *f, hid_t dxpl_id, void *thing, +static herr_t pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr); static herr_t serialize(const H5F_t *f, void *image_ptr, size_t len, @@ -1123,7 +1124,6 @@ notify_image_len(const void *thing, size_t *image_length) */ herr_t pre_serialize(H5F_t *f, - hid_t H5_ATTR_UNUSED dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1208,7 +1208,6 @@ pre_serialize(H5F_t *f, herr_t pico_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1216,13 +1215,12 @@ pico_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t nano_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1230,13 +1228,12 @@ nano_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t micro_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1244,13 +1241,12 @@ micro_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t tiny_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1258,13 +1254,12 @@ tiny_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t small_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1272,13 +1267,12 @@ small_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t medium_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1286,13 +1280,12 @@ medium_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t large_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1300,13 +1293,12 @@ large_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t huge_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1314,13 +1306,12 @@ huge_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t monster_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1328,13 +1319,12 @@ monster_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t variable_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1342,13 +1332,12 @@ variable_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } herr_t notify_pre_serialize(H5F_t *f, - hid_t dxpl_id, void *thing, haddr_t addr, size_t len, @@ -1356,7 +1345,7 @@ notify_pre_serialize(H5F_t *f, size_t *new_len_ptr, unsigned *flags_ptr) { - return pre_serialize(f, dxpl_id, thing, addr, len, + return pre_serialize(f, thing, addr, len, new_addr_ptr, new_len_ptr, flags_ptr); } @@ -3278,6 +3267,7 @@ setup_cache(size_t max_cache_size, HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); } /* end if */ } /* end if */ +H5CX_push(); if(show_progress) /* 4 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", @@ -3379,8 +3369,7 @@ setup_cache(size_t max_cache_size, FUNC, mile_stone++, (int)pass); if(pass) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, - (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); if(actual_base_addr == HADDR_UNDEF) { pass = FALSE; @@ -3455,7 +3444,7 @@ takedown_cache(H5F_t * file_ptr, H5C_stats(cache_ptr, "test cache", dump_detailed_stats); } - if ( H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_prep_for_file_close(file_ptr) < 0 ) { pass = FALSE; failure_mssg = "unexpected failure of prep for file close.\n"; @@ -3463,7 +3452,7 @@ takedown_cache(H5F_t * file_ptr, flush_cache(file_ptr, TRUE, FALSE, FALSE); - H5C_dest(file_ptr, H5AC_ind_read_dxpl_id); + H5C_dest(file_ptr); if ( saved_cache != NULL ) { @@ -3493,7 +3482,7 @@ takedown_cache(H5F_t * file_ptr, HDassert ( file_ptr ); } - H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, saved_actual_base_addr, + H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); saved_actual_base_addr = HADDR_UNDEF; } @@ -3508,6 +3497,7 @@ takedown_cache(H5F_t * file_ptr, saved_fid = -1; } +H5CX_pop(); if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) { @@ -3582,8 +3572,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->header.is_pinned ) ); HDassert( ! ( entry_ptr->is_pinned ) ); - result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id, - types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); + result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3634,12 +3623,10 @@ flush_cache(H5F_t * file_ptr, cache_ptr = file_ptr->shared->cache; if(destroy_entries) - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG); else - result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, - H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET); if(dump_stats) H5C_stats(cache_ptr, "test cache", dump_detailed_stats); @@ -3767,7 +3754,6 @@ insert_entry(H5F_t * file_ptr, { H5C_t * cache_ptr; herr_t result; - hid_t xfer = H5AC_ind_read_dxpl_id; hbool_t insert_pinned; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3798,13 +3784,9 @@ insert_entry(H5F_t * file_ptr, /* Set the base address of the entry type into the property list as tag */ /* Use to cork entries for the object */ - if(H5AC_tag(xfer, baddrs, NULL) < 0) { - pass = FALSE; - failure_mssg = "error in H5P_set()."; - } + H5AC_tag(baddrs, NULL); - result = H5C_insert_entry(file_ptr, xfer, - types[type], entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_insert_entry(file_ptr, types[type], entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -4050,7 +4032,6 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) test_entry_t * base_addr; test_entry_t * entry_ptr; haddr_t baddrs; - hid_t xfer = H5AC_ind_read_dxpl_id; H5C_cache_entry_t * cache_entry_ptr; if(pass) { @@ -4071,12 +4052,9 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx) /* Set the base address of the entry type into the property list as tag */ /* Use to cork entries for the object */ - if(H5AC_tag(xfer, baddrs, NULL) < 0) { - pass = FALSE; - failure_mssg = "error in H5P_set()."; - } /* end if */ + H5AC_tag(baddrs, NULL); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, xfer, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -4180,7 +4158,7 @@ protect_entry_ro(H5F_t * file_ptr, ( ( entry_ptr->is_read_only ) && ( entry_ptr->ro_ref_count > 0 ) ) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id, + cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || @@ -4396,8 +4374,7 @@ unprotect_entry(H5F_t * file_ptr, mark_flush_dep_dirty(entry_ptr); } /* end if */ - result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id, - entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( ( entry_ptr->header.is_protected ) && diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 9c79968..15ce6c2 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -22,6 +22,7 @@ #include "testhdf5.h" #include "cache_common.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5HLprivate.h" /* ============ */ @@ -349,7 +350,7 @@ evict_entries(hid_t fid) /* Evict all we can from the cache to examine full tag creation tree */ /* This function will likely return failure since the root group * is still protected. Thus, don't check its return value. */ - H5C_flush_cache(f, H5P_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); + H5C_flush_cache(f, H5C__FLUSH_INVALIDATE_FLAG); return 0; @@ -3635,9 +3636,9 @@ check_invalid_tag_application(void) /* Variables */ H5F_t * f = NULL; hid_t fid = -1; - hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ #endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ @@ -3646,38 +3647,39 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; +if(H5CX_push() < 0) TEST_ERROR +api_ctx_pushed = TRUE; /* Get internal file pointer*/ if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR; - /* Create dxpl */ - if ( (dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; - /* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */ /* Ensure this returns FAILURE, as a tag has not been set up. */ - if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) >= 0) TEST_ERROR; + if ( H5HL_create(f, (size_t)1024, &addr) >= 0) TEST_ERROR; - /* Now set up a tag in the dxpl */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + /* Now set up a tag in the API context */ + H5AC_tag((haddr_t)25, NULL); /* Verify the same call to H5HL_create now works as intended, with a tag set up. */ - if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) < 0) TEST_ERROR; + if ( H5HL_create(f, (size_t)1024, &addr) < 0) TEST_ERROR; - /* Reset dxpl to use invalid tag. */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, H5AC__INVALID_TAG, NULL) < 0) TEST_ERROR; + /* Reset API context to use invalid tag. */ + H5AC_tag(H5AC__INVALID_TAG, NULL); /* Call H5HL_protect to protect the local heap created above. */ /* This should fail as no tag is set up during the protect call */ - if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR; /* Again, set up a valid tag in the DXPL */ - if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR; + H5AC_tag((haddr_t)25, NULL); /* Call H5HL_protect again to protect the local heap. This should succeed. */ - if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; + if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR; /* Now unprotect the heap, as we're done with the test. */ if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) TEST_ERROR +api_ctx_pushed = FALSE; /* Close open objects and file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; @@ -3692,6 +3694,10 @@ check_invalid_tag_application(void) return 0; error: +#if H5C_DO_TAGGING_SANITY_CHECKS +if(api_ctx_pushed) H5CX_pop(); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + return 1; } /* check_invalid_tag_application */ diff --git a/test/dsets.c b/test/dsets.c index 0fff2d1..472c588 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1915,6 +1915,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; if(H5Pclose (dxpl) < 0) goto error; + if(H5Pclose (write_dxpl) < 0) goto error; HDfree (tconv_buf); return(0); @@ -2423,8 +2424,9 @@ test_missing_filter(hid_t file) goto error; } /* end if */ - /* Unregister deflate filter (use internal function) */ - if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) { + /* Unregister deflate filter */ + /* (Use private routine, to avoid range checking on filter ID) */ + if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) { H5_FAILED(); printf(" Line %d: Can't unregister deflate filter\n",__LINE__); goto error; diff --git a/test/earray.c b/test/earray.c index 1058565..0605605 100644 --- a/test/earray.c +++ b/test/earray.c @@ -25,6 +25,7 @@ #include "H5EApkg.h" /* Extensible Arrays */ /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ #include "H5VMprivate.h" /* Vectors and arrays */ @@ -406,7 +407,7 @@ error: *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, hid_t fapl, H5EA_t **ea, haddr_t ea_addr, const earray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -414,7 +415,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, if(tparam->reopen_array) { /* Close array, if given */ if(ea && *ea) { - if(H5EA_close(*ea, dxpl) < 0) + if(H5EA_close(*ea) < 0) FAIL_STACK_ERROR *ea = NULL; } /* end if */ @@ -441,7 +442,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, /* Re-open array, if given */ if(ea) - if(NULL == (*ea = H5EA_open(*f, dxpl, ea_addr, NULL))) + if(NULL == (*ea = H5EA_open(*f, ea_addr, NULL))) FAIL_STACK_ERROR } /* end if */ @@ -467,14 +468,14 @@ error: *------------------------------------------------------------------------- */ static int -create_array(H5F_t *f, hid_t dxpl, const H5EA_create_t *cparam, +create_array(H5F_t *f, const H5EA_create_t *cparam, H5EA_t **ea, haddr_t *ea_addr, H5EA__ctx_cb_t *cb) { hsize_t nelmts; /* Number of elements in array */ earray_state_t state; /* State of extensible array */ /* Create array */ - if(NULL == (*ea = H5EA_create(f, dxpl, cparam, cb))) + if(NULL == (*ea = H5EA_create(f, cparam, cb))) FAIL_STACK_ERROR /* Check status of array */ @@ -555,7 +556,7 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr) h5_stat_size_t file_size; /* File size, after deleting array */ /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR #ifdef QAK @@ -565,7 +566,7 @@ HDsystem("cp earray.h5 earray.h5.save"); #endif /* QAK */ /* Delete array */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -627,11 +628,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.raw_elmt_size = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -642,11 +643,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -656,11 +657,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_nelmts_bits = 65; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -671,11 +672,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -684,11 +685,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 1; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -697,11 +698,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.sup_blk_min_data_ptrs = 6; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -712,11 +713,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.data_blk_min_elmts = 0; H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -728,11 +729,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -742,11 +743,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = 4; /* corresponds to 16 elements in data block page, which is less than the 64 elements for the default settings */ H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -755,11 +756,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(test_cparam.max_nelmts_bits + 1); H5E_BEGIN_TRY { - ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + ea = H5EA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(ea) { /* Close opened extensible array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); ea = NULL; /* Indicate error */ @@ -779,7 +780,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE TESTING("extensible array creation"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR PASSED() @@ -803,7 +804,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -842,19 +843,19 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("create, close & reopen extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Close the extensible array */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Re-open the array */ - if(NULL == (ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -873,7 +874,7 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -915,11 +916,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("open extensible array twice"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -929,12 +930,12 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -946,7 +947,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -954,7 +955,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -977,9 +978,9 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -1027,11 +1028,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TESTING("open extensible array twice, through different file handles"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1041,7 +1042,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; @@ -1053,7 +1054,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1061,7 +1062,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa TEST_ERROR /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; @@ -1092,7 +1093,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa FAIL_STACK_ERROR /* Open the extensible array through the second file handle */ - if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1117,9 +1118,9 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -1163,15 +1164,15 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TESTING("deleting open extensible array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Open the array again */ - if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL))) + if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL))) FAIL_STACK_ERROR /* Request that the array be deleted */ - if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0) + if(H5EA_delete(f, ea_addr, NULL) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -1181,38 +1182,38 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) TEST_ERROR /* Close the second extensible array wrapper */ - if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea2) < 0) FAIL_STACK_ERROR ea2 = NULL; /* Try re-opening the array again (should fail, as array will be deleted) */ H5E_BEGIN_TRY { - ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea2 = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea2) { /* Close opened array */ - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first extensible array wrapper */ - if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0) + if(H5EA_close(ea) < 0) FAIL_STACK_ERROR ea = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Try re-opening the array again (should fail, as array is now deleted) */ H5E_BEGIN_TRY { - ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL); + ea = H5EA_open(f, ea_addr, NULL); } H5E_END_TRY; if(ea) { /* Close opened array */ - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); /* Indicate error */ TEST_ERROR @@ -1238,9 +1239,9 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); if(ea2) - H5EA_close(ea2, H5AC_ind_read_dxpl_id); + H5EA_close(ea2); H5Fclose(file); } H5E_END_TRY; @@ -2111,7 +2112,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2119,7 +2120,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2150,7 +2151,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2178,7 +2179,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2187,7 +2188,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Get the max. array index */ @@ -2215,7 +2216,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2239,7 +2240,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -2285,7 +2286,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0) + if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -2293,7 +2294,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0) TEST_ERROR /* Verify high-water # of elements written */ @@ -2314,7 +2315,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2323,7 +2324,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5EA_set(ea, idx, &welmt) < 0) FAIL_STACK_ERROR /* Verify high-water # of elements written */ @@ -2365,7 +2366,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5EA_get(ea, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is value written */ @@ -2376,7 +2377,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, for(cnt = 0; cnt < skip_elmts; cnt++) { /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5EA_get(ea, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0) + if(H5EA_get(ea, cnt, &relmt) < 0) FAIL_STACK_ERROR /* Verify element is fill value for array */ @@ -2396,7 +2397,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(ea) - H5EA_close(ea, H5AC_ind_read_dxpl_id); + H5EA_close(ea); H5Fclose(file); } H5E_END_TRY; @@ -2428,6 +2429,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -2438,6 +2440,8 @@ main(void) /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -2584,6 +2588,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/efc.c b/test/efc.c index bd008c8..a9ed3e5 100644 --- a/test/efc.c +++ b/test/efc.c @@ -18,6 +18,7 @@ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" const char *FILENAME[] = { @@ -37,7 +38,6 @@ static char filename[6][1024]; * internal functions */ hid_t fcpl_id = -1; hid_t fapl_id = -1; -hid_t dxpl_id = -1; /*------------------------------------------------------------------------- @@ -75,8 +75,7 @@ test_single(void) /* Open parent file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR /* Disable EFC for child files */ @@ -88,17 +87,15 @@ test_single(void) * count = 2, release EFC, verify ref count = 1. Verifies a file can be * held open by the EFC. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -110,14 +107,12 @@ test_single(void) * level file pointer. Open file 1 through EFC, close, open again, verify * file pointers are the same. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR ftmp1 = f1; if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1 != ftmp1) TEST_ERROR @@ -125,7 +120,7 @@ test_single(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR @@ -134,25 +129,21 @@ test_single(void) * order. Open each file normally after closing through EFC the first time * to track ref counts. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR @@ -160,13 +151,11 @@ test_single(void) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR @@ -176,13 +165,11 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -193,8 +180,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp3) < 0) FAIL_STACK_ERROR @@ -207,8 +193,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp2) < 0) FAIL_STACK_ERROR @@ -221,8 +206,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(NULL == (ftmp1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp1) < 0) FAIL_STACK_ERROR @@ -235,8 +219,7 @@ test_single(void) if(f4->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp4 = H5F_efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp4 = H5F_efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp4) < 0) FAIL_STACK_ERROR @@ -249,7 +232,7 @@ test_single(void) if(f4->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -270,17 +253,15 @@ test_single(void) /* Test 4: Verify that files kept open through the EFC are not evicted by - * H5F_efc_release(). */ + * H5F__efc_release(). */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR @@ -288,7 +269,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -301,11 +282,9 @@ test_single(void) * that the second file is evicted. Close the first file, reopen the * second, and verify that the first file is evicted. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared != f1->shared) TEST_ERROR @@ -313,20 +292,17 @@ test_single(void) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR @@ -334,8 +310,7 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR @@ -349,7 +324,7 @@ test_single(void) if(ftmp1->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR @@ -358,7 +333,7 @@ test_single(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -367,7 +342,7 @@ test_single(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -384,11 +359,9 @@ test_single(void) * through the EFC, then open the fourth and verify that it was not added to * the EFC. */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared != f1->shared) TEST_ERROR @@ -396,11 +369,9 @@ test_single(void) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared != f2->shared) TEST_ERROR @@ -408,11 +379,9 @@ test_single(void) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared != f3->shared) TEST_ERROR @@ -420,13 +389,11 @@ test_single(void) TEST_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR @@ -443,7 +410,7 @@ test_single(void) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -464,23 +431,20 @@ test_single(void) /* Test 7: Test multiple file opens. Open a file twice, close it once, then - * verify that it is not evicted by H5F_efc_release(). */ + * verify that it is not evicted by H5F__efc_release(). */ if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR @@ -488,7 +452,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR @@ -550,27 +514,23 @@ test_graph_nocycle(void) * ref count reduced (implying file 1 was closed). Do the same with the * opening order reversed. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -580,19 +540,16 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(ftmp1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR @@ -600,12 +557,11 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -619,47 +575,40 @@ test_graph_nocycle(void) * has their own child file. Verifies that releasing the parent's EFC * closes all 4 children. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f3, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR @@ -679,23 +628,19 @@ test_graph_nocycle(void) * parent, then reopen through that parent and release the other, then * re-release the first parent. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR @@ -703,28 +648,27 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f1->shared->efc) < 0) + if(H5F__efc_release(f1->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -741,25 +685,21 @@ test_graph_nocycle(void) * shared the same child. Verify that releasing the parent file closes all * files. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR @@ -767,13 +707,12 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 3) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -788,34 +727,29 @@ test_graph_nocycle(void) * each cache f3 and f4. f3 caches f4. Verify that releasing f0 closes all * files. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f0, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR @@ -824,44 +758,40 @@ test_graph_nocycle(void) if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f2, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f2) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f3, filename[4], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, f4) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR - if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 5) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR @@ -927,23 +857,21 @@ test_graph_cycle(void) /* Test 1: File caches itself. Verify that closing the file causes it to be * actually closed, and there is no other unexpected behavior. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR @@ -952,8 +880,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -965,15 +892,13 @@ test_graph_cycle(void) /* Test 2: Indirectly referenced file caches itself. Same as above except * the file is part of another file's EFC. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -981,11 +906,10 @@ test_graph_cycle(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -993,11 +917,10 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -1008,8 +931,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1019,15 +941,13 @@ test_graph_cycle(void) /* Test 3: Simple 2 file cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1035,17 +955,16 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1056,8 +975,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1067,19 +985,16 @@ test_graph_cycle(void) /* Test 4: Simple 2 file cycle (indirectly referenced) */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR @@ -1092,8 +1007,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1103,26 +1017,23 @@ test_graph_cycle(void) /* Test 5: Parallel double cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1133,8 +1044,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1144,26 +1054,23 @@ test_graph_cycle(void) /* Test 6: Parallel double cycle with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1171,7 +1078,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 3) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1181,33 +1088,29 @@ test_graph_cycle(void) /* Test 7: Chained parallel double cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1222,8 +1125,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1233,33 +1135,29 @@ test_graph_cycle(void) /* Test 8: Chained parallel double cycle with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1271,7 +1169,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1281,18 +1179,15 @@ test_graph_cycle(void) /* Test 9: Simple 2 file cycle, extra ID on root */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR @@ -1309,8 +1204,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1320,18 +1214,15 @@ test_graph_cycle(void) /* Test 10: Simple 2 file cycle, extra ID on second file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -1346,8 +1237,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -1357,16 +1247,14 @@ test_graph_cycle(void) if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -1376,29 +1264,25 @@ test_graph_cycle(void) /* Test 11: Parallel double cycle, extra ID on a child file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1413,8 +1297,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 3) TEST_ERROR @@ -1424,24 +1307,21 @@ test_graph_cycle(void) if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -1451,29 +1331,25 @@ test_graph_cycle(void) /* Test 12: Parallel double cycle, extra ID on a child file, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR @@ -1484,14 +1360,14 @@ test_graph_cycle(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(ftmp2->shared->efc) < 0) + if(H5F__efc_release(ftmp2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1505,36 +1381,31 @@ test_graph_cycle(void) /* Test 13: Chained parallel double cycle, extra ID on a child file */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1553,8 +1424,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -1564,32 +1434,28 @@ test_graph_cycle(void) if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1600,36 +1466,31 @@ test_graph_cycle(void) /* Test 14: Chained parallel double cycle, extra ID on a child file, with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR @@ -1644,14 +1505,14 @@ test_graph_cycle(void) if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(ftmp3->shared->efc) < 0) + if(H5F__efc_release(ftmp3->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1665,30 +1526,26 @@ test_graph_cycle(void) /* Test 15: One local and one remote cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1702,32 +1559,28 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1737,30 +1590,26 @@ test_graph_cycle(void) /* Test 16: One local and one remote cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1771,31 +1620,28 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1805,33 +1651,28 @@ test_graph_cycle(void) /* Test 17: One local and one remote cycle, remote cycle held open */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1845,8 +1686,7 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -1858,24 +1698,21 @@ test_graph_cycle(void) if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -1886,33 +1723,28 @@ test_graph_cycle(void) /* Test 18: One local and one remote cycle, remote cycle held open, with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR - if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR @@ -1923,34 +1755,31 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(ftmp3->shared->efc) < 0) + if(H5F__efc_release(ftmp3->shared->efc) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -1966,55 +1795,49 @@ test_graph_cycle(void) /* Test 19: "Diamond" shape with links moving from bottom (root) to top. * Also cycle between bottom (root) and top and cycles on the sides. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR @@ -2030,48 +1853,42 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2083,55 +1900,49 @@ test_graph_cycle(void) * Also cycle between bottom (root) and top, cycles on the sides, and * release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR @@ -2144,47 +1955,42 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2195,65 +2001,57 @@ test_graph_cycle(void) /* Test 21: "Diamond" shape with links moving from bottom (root) to top. * Also cycle between bottom (root) and top, cycles on sides held open. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f5) < 0) FAIL_STACK_ERROR - if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -2272,8 +2070,7 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2289,8 +2086,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2301,48 +2097,42 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR @@ -2354,65 +2144,57 @@ test_graph_cycle(void) * Also cycle between bottom (root) and top, cycles on sides held open. * Also release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, f3) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_efc_open(f1, filename[4], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f4, ftmp1) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f4) < 0) FAIL_STACK_ERROR - if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f5 = H5F_efc_open(f2, filename[5], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f5, ftmp2) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f5) < 0) FAIL_STACK_ERROR - if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR @@ -2425,7 +2207,7 @@ test_graph_cycle(void) if(f5->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2433,15 +2215,14 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 3) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f4->shared->efc) < 0) + if(H5F__efc_release(f4->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2449,15 +2230,14 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f5->shared->efc) < 0) + if(H5F__efc_release(f5->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2465,8 +2245,7 @@ test_graph_cycle(void) TEST_ERROR if(f5->shared->nrefs != 1) TEST_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2484,86 +2263,82 @@ test_graph_cycle(void) /* Test 23: Dense "ball" of files. 4 files each cache all files (including * itself). */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp3) < 0) FAIL_STACK_ERROR @@ -2578,32 +2353,28 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2614,86 +2385,82 @@ test_graph_cycle(void) /* Test 24: Dense "ball" of files. 4 files each cache all files (including * itself). Release the files instead of closing. */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f0, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f0, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f2, ftmp3) < 0) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp0) < 0) FAIL_STACK_ERROR if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp1) < 0) FAIL_STACK_ERROR if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp2) < 0) FAIL_STACK_ERROR if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f3, ftmp3) < 0) FAIL_STACK_ERROR @@ -2705,31 +2472,28 @@ test_graph_cycle(void) if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2739,15 +2503,13 @@ test_graph_cycle(void) /* Test 25: File held open by EFC client interrupts cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -2756,7 +2518,7 @@ test_graph_cycle(void) if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2767,7 +2529,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2777,30 +2539,27 @@ test_graph_cycle(void) /* Test 26: File held open by EFC does not interrupt cycle, with release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_efc_open(f0, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR @@ -2817,30 +2576,26 @@ test_graph_cycle(void) /* Test 27: File held open by EFC client through non-parent file does not * interrupt cycle, but parent file does (no valid way around it) */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2859,8 +2614,7 @@ test_graph_cycle(void) TEST_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2873,15 +2627,13 @@ test_graph_cycle(void) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR @@ -2892,22 +2644,19 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 3) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR @@ -2916,29 +2665,25 @@ test_graph_cycle(void) if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -2950,30 +2695,26 @@ test_graph_cycle(void) * interrupt cycle, but parent file does (no valid way around it), with * release */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(NULL == (f3 = H5F_efc_open(f1, filename[3], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2984,7 +2725,7 @@ test_graph_cycle(void) if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f0->shared->efc) < 0) + if(H5F__efc_release(f0->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -2995,7 +2736,7 @@ test_graph_cycle(void) if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_efc_release(f2->shared->efc) < 0) + if(H5F__efc_release(f2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -3010,21 +2751,19 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(H5F_efc_close(f2, f1) < 0) FAIL_STACK_ERROR - if(H5F_efc_release(f2->shared->efc) < 0) + if(H5F__efc_release(f2->shared->efc) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR @@ -3039,19 +2778,17 @@ test_graph_cycle(void) /* Test 29: File without EFC interrupts cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0) TEST_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0) TEST_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR @@ -3066,15 +2803,13 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR @@ -3084,15 +2819,13 @@ test_graph_cycle(void) /* Test 30: File without EFC does not interrupt cycle */ if(NULL == (f0 = H5F_open(filename[0], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id, - fapl_id, dxpl_id))) + fapl_id))) FAIL_STACK_ERROR if(H5F_efc_close(f1, ftmp0) < 0) FAIL_STACK_ERROR @@ -3101,8 +2834,7 @@ test_graph_cycle(void) if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0) TEST_ERROR if(NULL == (f2 = H5F_efc_open(f1, filename[2], - H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, - dxpl_id))) + H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0) TEST_ERROR @@ -3113,22 +2845,19 @@ test_graph_cycle(void) if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, - dxpl_id))) + if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR @@ -3162,6 +2891,7 @@ int main(void) { unsigned nerrors = 0; /* track errors */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Test Setup */ puts("Testing the external file cache"); @@ -3169,7 +2899,6 @@ main(void) /* Create property lists */ fcpl_id = H5Pcreate(H5P_FILE_CREATE); fapl_id = h5_fileaccess(); - dxpl_id = H5AC_ind_read_dxpl_id; /* Patch filenames */ h5_fixname(FILENAME[0], fapl_id, filename[0], sizeof(filename[0])); @@ -3178,6 +2907,8 @@ main(void) h5_fixname(FILENAME[3], fapl_id, filename[3], sizeof(filename[3])); h5_fixname(FILENAME[4], fapl_id, filename[4], sizeof(filename[4])); h5_fixname(FILENAME[5], fapl_id, filename[5], sizeof(filename[5])); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Test Functions */ nerrors += test_single(); @@ -3190,6 +2921,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/farray.c b/test/farray.c index f9f97bf..5ff950e 100644 --- a/test/farray.c +++ b/test/farray.c @@ -25,8 +25,9 @@ #include "H5FApkg.h" /* Fixed Arrays */ /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Local macros */ @@ -265,7 +266,7 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state) *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, hid_t fapl, H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam) { /* Check for closing & re-opening the array */ @@ -273,7 +274,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, if(tparam->reopen_array) { /* Close array, if given */ if(fa && *fa) { - if(H5FA_close(*fa, dxpl) < 0) + if(H5FA_close(*fa) < 0) FAIL_STACK_ERROR *fa = NULL; } /* end if */ @@ -300,7 +301,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl, /* Re-open array, if given */ if(fa) - if(NULL == (*fa = H5FA_open(*f, dxpl, fa_addr, NULL))) + if(NULL == (*fa = H5FA_open(*f, fa_addr, NULL))) FAIL_STACK_ERROR } /* end if */ @@ -323,13 +324,13 @@ error: *------------------------------------------------------------------------- */ static int -create_array(H5F_t *f, hid_t dxpl, const H5FA_create_t *cparam, +create_array(H5F_t *f, const H5FA_create_t *cparam, H5FA_t **fa, haddr_t *fa_addr) { farray_state_t state; /* State of extensible array */ /* Create array */ - if(NULL == (*fa = H5FA_create(f, dxpl, cparam, NULL))) + if(NULL == (*fa = H5FA_create(f, cparam, NULL))) FAIL_STACK_ERROR /* Check status of array */ @@ -400,11 +401,11 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr) h5_stat_size_t file_size; /* File size, after deleting array */ /* Close the fixed array */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR /* Delete array */ - if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0) + if(H5FA_delete(f, fa_addr, NULL) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -462,11 +463,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.raw_elmt_size = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -477,11 +478,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.max_dblk_page_nelmts_bits = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -492,11 +493,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE HDmemcpy(&test_cparam, cparam, sizeof(test_cparam)); test_cparam.nelmts = 0; H5E_BEGIN_TRY { - fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL); + fa = H5FA_create(f, &test_cparam, NULL); } H5E_END_TRY; if(fa) { /* Close opened fixed array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); fa = NULL; /* Indicate error */ @@ -516,7 +517,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE TESTING("fixed array creation"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR PASSED() @@ -540,7 +541,7 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -576,19 +577,19 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("create, close & reopen fixed array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Close the fixed array */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Re-open the array */ - if(NULL == (fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -607,7 +608,7 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -646,11 +647,11 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("open fixed array twice"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -660,12 +661,12 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -677,7 +678,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ - if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -685,7 +686,7 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the first extensible array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; @@ -708,9 +709,9 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -758,11 +759,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again, through the first file handle */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -772,7 +773,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; @@ -784,11 +785,11 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR /* Close the first fixed array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; @@ -819,7 +820,7 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa FAIL_STACK_ERROR /* Open the fixed array through the second file handle */ - if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f2, fa_addr, NULL))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -844,9 +845,9 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); H5Fclose(file2); H5Fclose(file0); @@ -887,15 +888,15 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TESTING("deleting open fixed array"); /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Open the array again */ - if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL))) + if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL))) FAIL_STACK_ERROR /* Request that the array be deleted */ - if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0) + if(H5FA_delete(f, fa_addr, NULL) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -905,38 +906,38 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) TEST_ERROR /* Close the second fixed array wrapper */ - if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa2) < 0) FAIL_STACK_ERROR fa2 = NULL; /* Try re-opening the array again (should fail, as array will be deleted) */ H5E_BEGIN_TRY { - fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL); + fa2 = H5FA_open(f, fa_addr, NULL); } H5E_END_TRY; if(fa2) { /* Close opened array */ - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first fixed array wrapper */ - if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0) + if(H5FA_close(fa) < 0) FAIL_STACK_ERROR fa = NULL; /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0) + if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0) TEST_ERROR /* Try re-opening the array again (should fail, as array is now deleted) */ H5E_BEGIN_TRY { - fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL); + fa = H5FA_open(f, fa_addr, NULL); } H5E_END_TRY; if(fa) { /* Close opened array */ - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); /* Indicate error */ TEST_ERROR @@ -962,9 +963,9 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); if(fa2) - H5FA_close(fa2, H5AC_ind_read_dxpl_id); + H5FA_close(fa2); H5Fclose(file); } H5E_END_TRY; @@ -1391,7 +1392,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1399,7 +1400,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR if(H5FA_get_nelmts(fa, &fa_nelmts) < 0) @@ -1431,7 +1432,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1458,7 +1459,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, idx = (hsize_t)sidx; relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved element is correct */ @@ -1467,12 +1468,12 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5FA_set(fa, idx, &welmt) < 0) FAIL_STACK_ERROR /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved element is correct */ @@ -1502,7 +1503,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -1546,7 +1547,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Create array */ - if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0) + if(create_array(f, cparam, &fa, &fa_addr) < 0) TEST_ERROR /* Verify the creation parameters */ @@ -1554,7 +1555,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, TEST_ERROR /* Check for closing & re-opening the file */ - if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0) + if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0) TEST_ERROR if(H5FA_get_nelmts(fa, &fa_nelmts) < 0) @@ -1576,7 +1577,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1585,7 +1586,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Set element of array */ welmt = (uint64_t)7 + idx; - if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0) + if(H5FA_set(fa, idx, &welmt) < 0) FAIL_STACK_ERROR /* Verify array state */ @@ -1596,7 +1597,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, /* Retrieve element of array (set now) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0) + if(H5FA_get(fa, idx, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1608,7 +1609,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, for(cnt = 0; cnt < skip_elmts; cnt++) { /* Retrieve element of array (not set yet) */ relmt = (uint64_t)0; - if(H5FA_get(fa, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0) + if(H5FA_get(fa, cnt, &relmt) < 0) FAIL_STACK_ERROR /* Verify that the retrieved is correct */ @@ -1629,7 +1630,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, error: H5E_BEGIN_TRY { if(fa) - H5FA_close(fa, H5AC_ind_read_dxpl_id); + H5FA_close(fa); H5Fclose(file); } H5E_END_TRY; @@ -1658,6 +1659,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ time_t curr_time; /* Current time, for seeding random number generator */ int ExpressMode; /* Test express value */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -1668,6 +1670,8 @@ main(void) /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g)); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Seed random #'s */ curr_time = HDtime(NULL); @@ -1787,6 +1791,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; diff --git a/test/fheap.c b/test/fheap.c index 6c3a8ac..00a372e 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -29,9 +29,10 @@ #include "H5Fpkg.h" /* Other private headers that this test requires */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Max. testfile name length */ #define FHEAP_FILENAME_LEN 1024 @@ -169,7 +170,7 @@ size_t shared_alloc_ids_g = 0; /* # of shared heap IDs allocated in array */ static int init_small_cparam(H5HF_create_t *cparam); static int init_large_cparam(H5HF_create_t *cparam); static int check_stats(const H5HF_t *fh, const fheap_heap_state_t *state); -static int del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids); @@ -359,7 +360,7 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) *------------------------------------------------------------------------- */ static int -add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, +add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned char heap_id[MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */ @@ -381,7 +382,7 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, /* Insert object */ HDmemset(heap_id, 0, id_len); - if(H5HF_insert(fh, dxpl, obj_size, obj, heap_id) < 0) + if(H5HF_insert(fh, obj_size, obj, heap_id) < 0) FAIL_STACK_ERROR /* Check for tracking the heap's state */ @@ -409,11 +410,11 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, } /* end if */ /* Read in object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(obj, shared_robj_g, obj_size)) TEST_ERROR @@ -582,14 +583,14 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, *------------------------------------------------------------------------- */ static int -reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl, +reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, H5HF_t **fh, haddr_t fh_addr, const fheap_test_param_t *tparam) { /* Check for closing & re-opening the heap */ /* (actually will close & re-open the file as well) */ if(tparam->reopen_heap) { /* Close heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR *fh = NULL; @@ -612,7 +613,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl FAIL_STACK_ERROR /* Re-open heap */ - if(NULL == (*fh = H5HF_open(*f, dxpl, fh_addr))) + if(NULL == (*fh = H5HF_open(*f, fh_addr))) FAIL_STACK_ERROR } /* end if */ @@ -639,7 +640,7 @@ error: *------------------------------------------------------------------------- */ static int -open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, +open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam, const fheap_test_param_t *tparam, hid_t *file, H5F_t **f, H5HF_t **fh, haddr_t *fh_addr, fheap_heap_state_t *state, h5_stat_size_t *empty_size) { @@ -663,7 +664,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (*fh = H5HF_create(*f, dxpl, cparam))) + if(NULL == (*fh = H5HF_create(*f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(*fh, &id_len) < 0) FAIL_STACK_ERROR @@ -680,7 +681,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR } /* end if */ @@ -707,7 +708,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Create absolute heap */ - if(NULL == (*fh = H5HF_create(*f, dxpl, cparam))) + if(NULL == (*fh = H5HF_create(*f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(*fh, &id_len) < 0) FAIL_STACK_ERROR @@ -723,7 +724,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam, } /* end if */ else { /* Re-open heap */ - if(NULL == (*fh = H5HF_open(*f, dxpl, *fh_addr))) + if(NULL == (*fh = H5HF_open(*f, *fh_addr))) FAIL_STACK_ERROR } /* end else */ @@ -750,17 +751,17 @@ error: *------------------------------------------------------------------------- */ static int -reopen_heap(H5F_t *f, hid_t dxpl, H5HF_t **fh, haddr_t fh_addr, +reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr, const fheap_test_param_t *tparam) { /* Check for closing & re-opening the heap */ if(tparam->reopen_heap) { /* Close (empty) heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR /* Re-open heap */ - if(NULL == (*fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (*fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR } /* end if */ @@ -786,7 +787,7 @@ error: *------------------------------------------------------------------------- */ static int -close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, +close_heap(char *filename, hid_t fapl, fheap_test_param_t *tparam, hid_t file, H5F_t *f, H5HF_t **fh, haddr_t fh_addr, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids, h5_stat_size_t empty_size) @@ -794,7 +795,7 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, h5_stat_size_t file_size; /* Size of file currently */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -804,19 +805,19 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam, /* Check for deleting the objects in the heap */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Delete objects inserted (either forward or reverse order) */ - if(del_objs(f, dxpl, fh, tparam, state, keep_ids)) + if(del_objs(f, fh, tparam, state, keep_ids)) FAIL_STACK_ERROR } /* end if */ /* Close the fractal heap */ - if(H5HF_close(*fh, dxpl) < 0) + if(H5HF_close(*fh) < 0) FAIL_STACK_ERROR *fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -855,7 +856,7 @@ error: *------------------------------------------------------------------------- */ static int -del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +del_objs_half_refill(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_ids_t *keep_ids) { unsigned char *wobj; /* Buffer for object to insert */ @@ -890,11 +891,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar half_nobjs = keep_ids->num_ids / 2; for(u = 0; u < half_nobjs; u++) { /* Remove object from heap */ - if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -912,11 +913,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar for(u = 0; u < half_nobjs; u++) { /* Re-insert object */ wobj = &shared_wobj_g[keep_ids->offs[obj_idx]]; - if(H5HF_insert(*fh, dxpl, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_insert(*fh, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -949,7 +950,7 @@ error: *------------------------------------------------------------------------- */ static int -del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, +del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { haddr_t fh_addr = HADDR_UNDEF; /* Address of fractal heap */ @@ -965,7 +966,7 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, /* Check for first deleting half of objects & then re-inserting them */ if(tparam->drain_half == FHEAP_DEL_DRAIN_HALF) - if(del_objs_half_refill(f, dxpl, fh, tparam, keep_ids)) + if(del_objs_half_refill(f, fh, tparam, keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ @@ -987,11 +988,11 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam, obj_idx = keep_ids->num_ids - 1; for(u = 0; u < keep_ids->num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0) + if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0) + if(reopen_heap(f, fh, fh_addr, tparam) < 0) TEST_ERROR /* Adjust index of object to delete next */ @@ -1041,7 +1042,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, +fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned char *wobj; /* Buffer for object to insert */ @@ -1098,7 +1099,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, } /* end if */ /* Insert object */ - if(H5HF_insert(fh, dxpl, obj_size, wobj, curr_id_ptr) < 0) + if(H5HF_insert(fh, obj_size, wobj, curr_id_ptr) < 0) FAIL_STACK_ERROR *curr_len_ptr = obj_size; *curr_off_ptr = obj_off; @@ -1149,7 +1150,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, } /* end if */ /* Insert last object into the heap, using the remaining free space */ - if(H5HF_insert(fh, dxpl, last_obj_len, wobj, curr_id_ptr) < 0) + if(H5HF_insert(fh, last_obj_len, wobj, curr_id_ptr) < 0) FAIL_STACK_ERROR *curr_len_ptr = last_obj_len; *curr_off_ptr = obj_off; @@ -1174,7 +1175,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size, curr_off_ptr = shared_offs_g; for(u = 0; u < num_ids; u++) { /* Read in object */ - if(H5HF_read(fh, dxpl, curr_id_ptr, shared_robj_g) < 0) + if(H5HF_read(fh, curr_id_ptr, shared_robj_g) < 0) FAIL_STACK_ERROR /* Check that object is correct */ @@ -1233,7 +1234,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, +fill_root_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { hsize_t first_free_space; /* Size of free space in heap after the first block */ @@ -1303,7 +1304,7 @@ fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, state->man_alloc_size += block_size; /* Fill a direct heap block up */ - if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_heap(fh, row, obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1330,7 +1331,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width, +fill_partial_row(H5HF_t *fh, unsigned row, unsigned width, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { size_t block_size; /* Size of direct block in this row */ @@ -1349,7 +1350,7 @@ fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width, state->man_alloc_size += block_size; /* Fill a direct heap block up */ - if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_heap(fh, row, obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1376,7 +1377,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, +fill_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { /* Sanity check */ @@ -1384,7 +1385,7 @@ fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size, HDassert(state); /* Fill the entire row (with the partial row fill routine) */ - if(fill_partial_row(fh, dxpl, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids)) + if(fill_partial_row(fh, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1413,7 +1414,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_root_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1425,7 +1426,7 @@ fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_root_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_root_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1453,7 +1454,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_2nd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1465,7 +1466,7 @@ fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1492,7 +1493,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */ @@ -1504,7 +1505,7 @@ fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows */ for(row = 0; row < max_dblock_rows; row++) - if(fill_row(fh, dxpl, row, obj_size, state, keep_ids)) + if(fill_row(fh, row, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1532,7 +1533,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_2nd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1543,7 +1544,7 @@ fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of indirect blocks */ for(u = 0; u < width; u++) - if(fill_2nd_indirect(fh, dxpl, pos, obj_size, state, keep_ids)) + if(fill_2nd_indirect(fh, pos, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1571,7 +1572,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1582,7 +1583,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 2nd level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) - if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1610,18 +1611,18 @@ error: *------------------------------------------------------------------------- */ static int -fill_3rd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_3rd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned u; /* Local index variable */ /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_direct(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill rows of recursive indirect blocks in third level indirect block */ for(u = 0; u < pos; u++) - if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1649,7 +1650,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_3rd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1661,7 +1662,7 @@ fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of 3rd level indirect blocks */ for(u = 0; u < width; u++) /* Fill third level indirect block */ - if(fill_3rd_indirect(fh, dxpl, pos, obj_size, state, keep_ids)) + if(fill_3rd_indirect(fh, pos, obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1689,7 +1690,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1701,7 +1702,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 3rd level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) /* Fill row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Operations succeeded */ @@ -1729,7 +1730,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, +fill_4th_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1741,16 +1742,16 @@ fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size, /* Loop over row of 4th level indirect blocks */ for(u = 0; u < width; u++) { /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_direct(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, obj_size, state, keep_ids)) + if(fill_all_2nd_indirect_rows(fh, obj_size, state, keep_ids)) TEST_ERROR /* Fill rows of third level indirect blocks in fourth level indirect block */ for(v = 0; v < pos; v++) - if(fill_3rd_indirect_row(fh, dxpl, (v + 1), obj_size, state, keep_ids)) + if(fill_3rd_indirect_row(fh, (v + 1), obj_size, state, keep_ids)) TEST_ERROR } /* end for */ @@ -1779,7 +1780,7 @@ error: *------------------------------------------------------------------------- */ static int -fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, +fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { unsigned width; /* Width of heap's doubling table */ @@ -1791,7 +1792,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size, /* Loop over rows of 4th level deep indirect blocks */ for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) { /* Fill row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids)) + if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -1879,7 +1880,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) */ TESTING("fractal heap creation"); - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -1903,11 +1904,11 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Delete heap */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -1930,7 +1931,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2002,7 +2003,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("create, close & reopen fractal heap"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2017,7 +2018,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the file */ @@ -2041,7 +2042,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end if */ /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Query the creation parameters */ @@ -2052,12 +2053,12 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Delete heap */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -2081,7 +2082,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2155,7 +2156,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("open fractal heap twice"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2170,7 +2171,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Open the heap again, through the first file handle */ - if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2181,12 +2182,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, H5AC_ind_read_dxpl_id, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Re-open the file */ @@ -2202,7 +2203,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Open the fractal heap through the second file handle */ - if(NULL == (fh2 = H5HF_open(f2, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f2, fh_addr))) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2213,7 +2214,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the first fractal heap wrapper */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2225,12 +2226,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Delete heap */ - if(H5HF_delete(f2, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f2, fh_addr) < 0) FAIL_STACK_ERROR /* Close the second file */ @@ -2254,9 +2255,9 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); if(fh2) - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); H5Fclose(file); H5Fclose(file2); } H5E_END_TRY; @@ -2324,7 +2325,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TESTING("deleting open fractal heap"); /* Create heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -2339,11 +2340,11 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Open the heap again */ - if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh2 = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Request that the heap be deleted */ - if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR /* Verify the creation parameters */ @@ -2354,24 +2355,24 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) TEST_ERROR /* Close the second fractal heap wrapper */ - if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh2) < 0) FAIL_STACK_ERROR fh2 = NULL; /* Try re-opening the heap again (should fail, as heap will be deleted) */ H5E_BEGIN_TRY { - fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr); + fh2 = H5HF_open(f, fh_addr); } H5E_END_TRY; if(fh2) { /* Close opened heap */ - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); /* Indicate error */ TEST_ERROR } /* end if */ /* Close the first fractal heap wrapper */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2397,11 +2398,11 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Try re-opening the heap again (should fail, as heap is now deleted) */ H5E_BEGIN_TRY { - fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr); + fh = H5HF_open(f, fh_addr); } H5E_END_TRY; if(fh) { /* Close opened heap */ - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); /* Indicate error */ TEST_ERROR @@ -2427,9 +2428,9 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, H5AC_ind_read_dxpl_id); + H5HF_close(fh); if(fh2) - H5HF_close(fh2, H5AC_ind_read_dxpl_id); + H5HF_close(fh2); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2453,7 +2454,6 @@ static unsigned test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2490,7 +2490,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 0; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2510,7 +2510,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2520,7 +2520,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 1; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2540,7 +2540,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2555,7 +2555,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2575,7 +2575,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2588,7 +2588,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ H5E_BEGIN_TRY { - fh = H5HF_create(f, dxpl, &tmp_cparam); + fh = H5HF_create(f, &tmp_cparam); } H5E_END_TRY; if(NULL != fh) FAIL_STACK_ERROR @@ -2600,7 +2600,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 8; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2620,7 +2620,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2631,7 +2631,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 17; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2651,7 +2651,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2662,7 +2662,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 18; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2682,7 +2682,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2693,7 +2693,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 19; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2713,7 +2713,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2724,7 +2724,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) tmp_cparam.id_len = 45; /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Test ID length information for heap */ @@ -2744,7 +2744,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2756,7 +2756,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ H5E_BEGIN_TRY { - fh = H5HF_create(f, dxpl, &tmp_cparam); + fh = H5HF_create(f, &tmp_cparam); } H5E_END_TRY; if(NULL != fh) FAIL_STACK_ERROR @@ -2774,7 +2774,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2798,7 +2798,6 @@ static unsigned test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2835,7 +2834,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam))) + if(NULL == (fh = H5HF_create(f, &tmp_cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -2845,7 +2844,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -2866,7 +2865,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Query the heap creation parameters */ @@ -2877,7 +2876,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -2897,7 +2896,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -2921,7 +2920,6 @@ static unsigned test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -2950,7 +2948,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -2961,24 +2959,24 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Get an empty heap's size */ empty_heap_size = 0; - if(H5HF_size(fh, dxpl, &empty_heap_size) < 0) + if(H5HF_size(fh, &empty_heap_size) < 0) FAIL_STACK_ERROR if(empty_heap_size == 0) TEST_ERROR /* Insert an object */ - if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Get the heap's size after inserting one object */ one_heap_size = 0; - if(H5HF_size(fh, dxpl, &one_heap_size) < 0) + if(H5HF_size(fh, &one_heap_size) < 0) FAIL_STACK_ERROR if(one_heap_size <= empty_heap_size) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3000,29 +2998,29 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR if(heap_size != one_heap_size) TEST_ERROR /* Insert another object */ - if(add_obj(fh, dxpl, (size_t)1, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)1, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR if(heap_size != one_heap_size) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -3038,7 +3036,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3066,7 +3064,6 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { hid_t file1 = -1; /* File ID */ hid_t file2 = -2; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3093,7 +3090,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR /* Get heap's address */ @@ -3103,11 +3100,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) TEST_ERROR /* Insert an object */ - if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0) + if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3133,11 +3130,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Open the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Close the heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3151,16 +3148,16 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) FAIL_STACK_ERROR /* Reopen the heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check the heap's size */ heap_size = 0; - if(H5HF_size(fh, dxpl, &heap_size) < 0) + if(H5HF_size(fh, &heap_size) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR @@ -3176,7 +3173,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; @@ -3202,7 +3199,6 @@ static unsigned test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3228,7 +3224,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3243,7 +3239,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -3253,18 +3249,18 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* Attempt to insert 0-sized object into heap */ H5E_BEGIN_TRY { - ret = H5HF_insert(fh, dxpl, (size_t)0, shared_wobj_g, heap_id); + ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id); } H5E_END_TRY; if(ret >= 0) TEST_ERROR H5Eclear2(H5E_DEFAULT); /* Insert a 1-sized object into heap (should be a 'tiny' object) */ - if(add_obj(fh, dxpl, (size_t)10, (size_t)1, &state, NULL)) + if(add_obj(fh, (size_t)10, (size_t)1, &state, NULL)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check for correctly sized heap */ @@ -3272,7 +3268,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -3288,7 +3284,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3314,7 +3310,6 @@ static unsigned test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3338,7 +3333,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3353,7 +3348,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -3363,11 +3358,11 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check for correctly sized heap */ @@ -3375,7 +3370,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3390,7 +3385,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3415,7 +3410,6 @@ static unsigned test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3439,7 +3433,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3458,19 +3452,19 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert second object */ - if(add_obj(fh, dxpl, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL)) + if(add_obj(fh, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3485,7 +3479,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3511,7 +3505,6 @@ static unsigned test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3536,7 +3529,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3560,15 +3553,15 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3583,7 +3576,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3610,7 +3603,6 @@ static unsigned test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3635,7 +3627,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3659,22 +3651,22 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force root indirect block creation */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3689,7 +3681,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3716,7 +3708,6 @@ static unsigned test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3741,7 +3732,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3765,22 +3756,22 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill the second direct block heap up (also creates initial root indirect block) */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3795,7 +3786,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3823,7 +3814,6 @@ static unsigned test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3848,7 +3838,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3872,27 +3862,27 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill the second direct block heap up (also creates initial root indirect block) */ state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of third direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -3907,7 +3897,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -3934,7 +3924,6 @@ static unsigned test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -3959,7 +3948,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -3980,15 +3969,15 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t fill_size = get_fill_size(tparam); /* Fill first row of [root] indirect block */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4003,7 +3992,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4030,7 +4019,6 @@ static unsigned test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4055,7 +4043,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4076,22 +4064,22 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force expanding root indirect block to two rows */ state.man_size += cparam->managed.width * DBLOCK_SIZE(fh, 1); state.man_alloc_size += DBLOCK_SIZE(fh, 1); state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4106,7 +4094,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4133,7 +4121,6 @@ static unsigned test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4158,7 +4145,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4179,19 +4166,19 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill second root indirect row */ - if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_root_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4206,7 +4193,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4234,7 +4221,6 @@ static unsigned test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4259,7 +4245,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4280,15 +4266,15 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * fill_size = get_fill_size(tparam); /* Fill first root indirect row */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_root_row(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill second root indirect row */ - if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_root_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force expanding root indirect block to four rows */ @@ -4298,11 +4284,11 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * state.man_alloc_size += DBLOCK_SIZE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4317,7 +4303,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4344,7 +4330,6 @@ static unsigned test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4370,7 +4355,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4392,15 +4377,15 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * /* Loop over rows */ for(u = 0; u < 4; u++) - if(fill_root_row(fh, dxpl, u, fill_size, &state, NULL)) + if(fill_root_row(fh, u, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4415,7 +4400,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4442,7 +4427,6 @@ static unsigned test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4467,7 +4451,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4488,15 +4472,15 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para fill_size = get_fill_size(tparam); /* Fill all direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4511,7 +4495,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4538,7 +4522,6 @@ static unsigned test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4563,7 +4546,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4584,20 +4567,20 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ fill_size = get_fill_size(tparam); /* Fill direct blocks up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of first recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4612,7 +4595,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4640,7 +4623,6 @@ static unsigned test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4665,7 +4647,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4687,27 +4669,27 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe fill_size = get_fill_size(tparam); /* Fill direct blocks up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill the first direct block in the recursive indirect block up */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL)) + if(fill_heap(fh, 0, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second direct block in * first recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4722,7 +4704,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4750,7 +4732,6 @@ static unsigned test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4775,7 +4756,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4797,19 +4778,19 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4824,7 +4805,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4853,7 +4834,6 @@ static unsigned test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4878,7 +4858,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -4900,26 +4880,26 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -4934,7 +4914,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -4964,7 +4944,6 @@ static unsigned test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -4989,7 +4968,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5011,23 +4990,23 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill first recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 2nd recursive indirect block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5042,7 +5021,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5072,7 +5051,6 @@ static unsigned test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5093,7 +5071,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5115,19 +5093,19 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te fill_size = get_fill_size(tparam); /* Fill direct blocks in root indirect block up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row of recursive indirect blocks */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5142,7 +5120,7 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5170,7 +5148,6 @@ static unsigned test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5195,7 +5172,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5217,26 +5194,26 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks in root indirect block up */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill row of recursive indirect blocks */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of second * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5251,7 +5228,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5279,7 +5256,6 @@ static unsigned test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5304,7 +5280,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5326,19 +5302,19 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5353,7 +5329,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5382,7 +5358,6 @@ static unsigned test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5407,7 +5382,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5429,26 +5404,26 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of third level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5463,7 +5438,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5492,7 +5467,6 @@ static unsigned test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5517,7 +5491,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5539,27 +5513,27 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row of recursive indirect blocks in third level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5574,7 +5548,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5603,7 +5577,6 @@ static unsigned test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5628,7 +5601,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5650,23 +5623,23 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 1st row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5681,7 +5654,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5710,7 +5683,6 @@ static unsigned test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5735,7 +5707,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5757,23 +5729,23 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5788,7 +5760,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5818,7 +5790,6 @@ static unsigned test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5843,7 +5814,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5865,30 +5836,30 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of four level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -5903,7 +5874,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -5933,7 +5904,6 @@ static unsigned test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -5958,7 +5928,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -5980,35 +5950,35 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level deep indirect blocks in fourth level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6023,7 +5993,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6053,7 +6023,6 @@ static unsigned test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6078,7 +6047,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6100,27 +6069,27 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill 1st row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, NULL)) + if(fill_4th_indirect_row(fh, 1, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6135,7 +6104,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6165,7 +6134,6 @@ static unsigned test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6190,7 +6158,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6212,27 +6180,27 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 4th level indirect blocks */ - if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6247,7 +6215,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6280,7 +6248,6 @@ static unsigned test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6305,7 +6272,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6328,46 +6295,46 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t fill_size = get_fill_size(tparam); /* Fill direct blocks up in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 4th level indirect blocks */ - if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL)) + if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Check for closing & re-opening the heap & file */ - if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to force creation of five level deep * recursive indirect block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL)) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6382,7 +6349,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6409,7 +6376,6 @@ static unsigned test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6439,7 +6405,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6454,7 +6420,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* @@ -6480,13 +6446,13 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try removing bogus heap ID from empty heap */ H5E_BEGIN_TRY { - ret = H5HF_remove(fh, dxpl, heap_id); + ret = H5HF_remove(fh, heap_id); } H5E_END_TRY; if(ret >= 0) FAIL_STACK_ERROR /* Fill root direct blocks */ - if(fill_root_direct(fh, dxpl, fill_size, &state, NULL)) + if(fill_root_direct(fh, fill_size, &state, NULL)) FAIL_STACK_ERROR /* Get offset of random heap ID */ @@ -6507,7 +6473,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try removing bogus heap ID from heap w/objects */ H5E_BEGIN_TRY { - ret = H5HF_remove(fh, dxpl, heap_id); + ret = H5HF_remove(fh, heap_id); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -6515,14 +6481,14 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); /* Try reading bogus heap ID from heap w/objects */ H5E_BEGIN_TRY { - ret = H5HF_read(fh, dxpl, heap_id, shared_robj_g); + ret = H5HF_read(fh, heap_id, shared_robj_g); } H5E_END_TRY; if(ret >= 0) TEST_ERROR H5Eclear2(H5E_DEFAULT); /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6538,7 +6504,7 @@ error: HDfprintf(stderr, "Random # seed was: %lu\n", seed); H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6563,7 +6529,6 @@ static unsigned test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6592,7 +6557,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6609,7 +6574,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6633,7 +6598,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -6646,11 +6611,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara obj[u] = (unsigned char)u; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6662,11 +6627,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6678,7 +6643,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6701,7 +6666,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6726,7 +6691,6 @@ static unsigned test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6756,7 +6720,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6773,7 +6737,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6797,7 +6761,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -6810,11 +6774,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara obj[u] = (unsigned char)u; /* Insert first object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id1) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6826,11 +6790,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Insert second object into heap */ - if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id2) < 0) + if(H5HF_insert(fh, sizeof(obj), obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6840,11 +6804,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6854,11 +6818,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -6870,7 +6834,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -6893,7 +6857,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -6919,7 +6883,6 @@ static unsigned test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -6949,7 +6912,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -6966,7 +6929,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -6990,7 +6953,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7003,11 +6966,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7022,11 +6985,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7038,7 +7001,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -7061,7 +7024,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7087,7 +7050,6 @@ static unsigned test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7118,7 +7080,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7135,7 +7097,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -7159,7 +7121,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7175,11 +7137,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7198,11 +7160,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7220,11 +7182,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Remove objects in different orders */ if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7235,16 +7197,16 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7260,12 +7222,12 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR } /* end else */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7277,7 +7239,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7304,7 +7266,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7330,7 +7292,6 @@ static unsigned test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7362,7 +7323,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7379,7 +7340,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Prepare for querying the size of a file with an empty heap */ /* Close (empty) heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR /* Close file */ @@ -7403,7 +7364,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param STACK_ERROR /* Re-open heap */ - if(NULL == (fh = H5HF_open(f, dxpl, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* @@ -7419,11 +7380,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7442,11 +7403,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7466,11 +7427,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param obj = shared_wobj_g; /* Insert object into heap */ - if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id3) < 0) + if(H5HF_insert(fh, obj_len, obj, &heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7488,11 +7449,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param /* Remove objects in different orders */ if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7503,11 +7464,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7518,16 +7479,16 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove third object from heap */ - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR } /* end if */ else { /* Remove third object from heap */ - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7543,11 +7504,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7563,12 +7524,12 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR } /* end else */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7580,7 +7541,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7607,7 +7568,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size); error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7631,7 +7592,6 @@ static unsigned test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7661,7 +7621,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ STACK_ERROR /* Create absolute heap */ - if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + if(NULL == (fh = H5HF_create(f, cparam))) FAIL_STACK_ERROR if(H5HF_get_id_len(fh, &id_len) < 0) FAIL_STACK_ERROR @@ -7686,24 +7646,24 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ for(j = 0; j < i; j++) { HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); - if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) + if(H5HF_remove(fh, heap_id[j]) < 0) FAIL_STACK_ERROR - if(H5HF_insert(fh, dxpl, (sizeof(obj2)), &obj2, heap_id[j]) < 0) + if(H5HF_insert(fh, (sizeof(obj2)), &obj2, heap_id[j]) < 0) FAIL_STACK_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object */ HDmemset(heap_id[i], 0, id_len); - if(H5HF_insert(fh, dxpl, (sizeof(obj1)), &obj1, heap_id[i]) < 0) + if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0) FAIL_STACK_ERROR } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR /* Close the file */ @@ -7718,7 +7678,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7746,7 +7706,6 @@ static unsigned test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7762,7 +7721,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -7770,12 +7729,12 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7794,7 +7753,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7820,7 +7779,6 @@ static unsigned test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7836,7 +7794,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -7844,11 +7802,11 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -7859,12 +7817,12 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7883,7 +7841,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7909,7 +7867,6 @@ static unsigned test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7925,17 +7882,17 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first row of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -7954,7 +7911,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -7980,7 +7937,6 @@ static unsigned test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -7996,19 +7952,19 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first two rows of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8027,7 +7983,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8053,7 +8009,6 @@ static unsigned test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8069,23 +8024,23 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first two rows of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_root_row(fh, dxpl, 3, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 3, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8104,7 +8059,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8130,7 +8085,6 @@ static unsigned test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8146,17 +8100,17 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8175,7 +8129,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8201,7 +8155,6 @@ static unsigned test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8217,21 +8170,21 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8250,7 +8203,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8276,7 +8229,6 @@ static unsigned test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8292,25 +8244,25 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8329,7 +8281,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8360,7 +8312,6 @@ static unsigned test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8376,7 +8327,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; @@ -8387,12 +8338,12 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8411,7 +8362,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8438,7 +8389,6 @@ static unsigned test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8454,7 +8404,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8467,30 +8417,30 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert second "real" object, which should go in earlier direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8509,7 +8459,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8537,7 +8487,6 @@ static unsigned test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8554,7 +8503,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8567,40 +8516,40 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add rows of blocks to "backfill" direct blocks that were skipped */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert another object, which should extend direct blocks, instead of backfill */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8619,7 +8568,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8647,7 +8596,6 @@ static unsigned test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8663,7 +8611,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8671,11 +8619,11 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8689,12 +8637,12 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8713,7 +8661,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8744,7 +8692,6 @@ static unsigned test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8762,7 +8709,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8770,11 +8717,11 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8788,29 +8735,29 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (smaller) heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill remainder of 2 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) + 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining rows of the starting block size */ @@ -8818,26 +8765,26 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes /* Fill remainder of first row of direct heap blocks up */ for(v = 0; v < (cparam->managed.width - 1); v++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Fill second row of direct blocks */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 2 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -8856,7 +8803,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -8889,7 +8836,6 @@ static unsigned test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -8907,7 +8853,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -8915,22 +8861,22 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * state.man_size = DBLOCK_SIZE(fh, 0); state.man_alloc_size = DBLOCK_SIZE(fh, 0); state.man_free_space = DBLOCK_FREE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert small object, to create root indirect block */ state.man_size += (cparam->managed.width - 1) * DBLOCK_SIZE(fh, 0); state.man_alloc_size += DBLOCK_SIZE(fh, 0); state.man_free_space += (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -8944,67 +8890,67 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (smaller) heap block just created */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1; - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill remainder of 4 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - ((size_t)DBLOCK_SIZE(fh, 2) + 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in first row */ for(u = 0; u < (cparam->managed.width - 2); u++) { /* Fill a direct heap block up */ state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_heap(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in second row */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in third row */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9023,7 +8969,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9055,7 +9001,6 @@ static unsigned test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9072,16 +9017,16 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill first row of direct blocks */ - if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_root_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9095,46 +9040,46 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2); state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill remainder of 4 * start size block */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in second row */ - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects to fill remaining heaps in third row */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9153,7 +9098,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9182,7 +9127,6 @@ static unsigned test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9201,7 +9145,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9220,7 +9164,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, row - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, row - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Compute heap size & free space when all direct blocks allocated */ @@ -9237,12 +9181,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Compute heap size & free space when root indirect block doubles again */ @@ -9257,12 +9201,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9281,7 +9225,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9309,7 +9253,6 @@ static unsigned test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9326,16 +9269,16 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9343,49 +9286,49 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add rows of blocks to "backfill" direct blocks that were skipped */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill direct block heaps with 2 * initial block size in nested indirect block */ - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert one more object, to create new 4 * start size direct block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9404,7 +9347,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9433,7 +9376,6 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9453,7 +9395,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9461,11 +9403,11 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9474,46 +9416,46 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ */ obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of direct blocks that are smaller than large object's block size */ for(row = 0; row < num_first_indirect_rows; row++) { /* Fill rows of direct blocks in skipped indirect blocks */ for(u = 0; u < cparam->managed.width; u++) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */ - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9532,7 +9474,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9562,7 +9504,6 @@ static unsigned test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9581,7 +9522,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9589,21 +9530,21 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 2nd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) /* Fill all rows of 2nd level indirect blocks in root block */ - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9615,20 +9556,20 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -9636,27 +9577,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in skipped 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9675,7 +9616,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9708,7 +9649,6 @@ static unsigned test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9728,7 +9668,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9736,11 +9676,11 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9752,20 +9692,20 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object too large for initial block size in skipped indirect blocks */ @@ -9774,11 +9714,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, 4); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (medium) block just created */ @@ -9786,52 +9726,52 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #ifdef QAK HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Finish off blocks in row of medium block size (just to make row filling easier below) */ obj_size = (size_t)DBLOCK_FREE(fh, 4); for(u = 1; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 4); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of direct blocks that are smaller than large object's block size */ for(row = 0; row < num_first_indirect_rows; row++) { /* Fill rows of direct blocks in skipped indirect blocks */ for(u = 0; u < cparam->managed.width; u++) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */ /* (Skip the row of blocks filled above) */ if(row != 4) - if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids)) + if(fill_row(fh, row, fill_size, &state, &keep_ids)) TEST_ERROR } /* end while */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -9850,7 +9790,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -9878,7 +9818,6 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -9898,7 +9837,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -9907,11 +9846,11 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ max_dblock_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -9919,71 +9858,71 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in first row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in second row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */ /* Direct block rows in skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10002,7 +9941,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10032,7 +9971,6 @@ static unsigned test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10052,7 +9990,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10061,11 +9999,11 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t max_dblock_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of two rows of indirect blocks and @@ -10073,20 +10011,20 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object that can't fit in first row of indirect blocks @@ -10095,76 +10033,76 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t */ obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 3) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert an object to fill up the (2nd biggest) heap block created */ obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 2) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in first row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in second row of skipped 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in used 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */ /* Finish blocks in partially used 2nd level indirect block */ - if(fill_partial_row(fh, dxpl, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids)) + if(fill_partial_row(fh, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block rows in skipped 2nd level indirect blocks */ /* (less the one indirect block already used) */ for(v = 0; v < cparam->managed.width - 1; v++) - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Direct block row in used 3rd row 2nd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10183,7 +10121,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10212,7 +10150,6 @@ static unsigned test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10229,24 +10166,24 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10255,43 +10192,43 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 3rd level indirect block's direct blocks */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10310,7 +10247,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10341,7 +10278,6 @@ static unsigned test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10358,32 +10294,32 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10392,45 +10328,45 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H */ obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (3rd level indirect block's) 2nd level * indirect block's direct blocks */ - if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids)) + if(fill_row(fh, 0, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR - if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids)) + if(fill_row(fh, 2, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, 3); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10449,7 +10385,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10479,7 +10415,6 @@ static unsigned test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10498,7 +10433,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10506,27 +10441,27 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10538,20 +10473,20 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 3rd level indirect block's) 2nd level @@ -10561,27 +10496,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10600,7 +10535,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10631,7 +10566,6 @@ static unsigned test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10650,7 +10584,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10661,27 +10595,27 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); #endif /* QAK */ /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10693,11 +10627,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ @@ -10705,11 +10639,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #ifdef QAK HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 3rd level indirect block's) 2nd level @@ -10719,31 +10653,31 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Fill row of direct blocks in second 3rd level indirect block */ - if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids)) + if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10762,7 +10696,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10794,7 +10728,6 @@ static unsigned test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10813,7 +10746,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10821,37 +10754,37 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in root indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 3rd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) /* Fill 3rd level indirect block */ - if(fill_3rd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in last third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -10863,20 +10796,20 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -10885,27 +10818,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -10924,7 +10857,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -10957,7 +10890,6 @@ static unsigned test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -10976,7 +10908,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -10984,44 +10916,44 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level indirect blocks */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 2nd row third level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 2nd level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) - if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11033,20 +10965,20 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in 2nd level indirect block's direct blocks @@ -11054,27 +10986,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); */ for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in skipped 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in current 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11093,7 +11025,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11124,7 +11056,6 @@ static unsigned test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11143,7 +11074,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11151,35 +11082,35 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11191,20 +11122,20 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 4th level indirect block's) 2nd level @@ -11214,27 +11145,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 2nd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11253,7 +11184,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11286,7 +11217,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11305,7 +11235,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11313,51 +11243,51 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in fourth level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in fourth level indirect block's 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11369,20 +11299,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first 4th level indirect block's first 3rd @@ -11392,27 +11322,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11431,7 +11361,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11466,7 +11396,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11485,7 +11414,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11493,31 +11422,31 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 4th level indirect blocks */ - if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_4th_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -11538,39 +11467,39 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ } /* end if */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 2nd row 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 2nd row 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row of 3rd level indirect blocks in 2nd row 4th level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's 2nd row of 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11582,20 +11511,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (first block in 2nd row 4th level indirect @@ -11605,27 +11534,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 3rd level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11644,7 +11573,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11681,7 +11610,6 @@ static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11700,7 +11628,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11708,66 +11636,66 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 3rd level indirect blocks in 4th level indirect block */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 2nd level indirect blocks in 3rd level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -11779,20 +11707,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (4th level indirect block's first 3rd level @@ -11802,27 +11730,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 4th level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -11841,7 +11769,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -11878,7 +11806,6 @@ static unsigned test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -11897,7 +11824,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -11905,81 +11832,81 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 3rd level indirect blocks */ - if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill first row (except one) of 4th level indirect blocks */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 3rd level indirect blocks in 4th level indirect block */ - if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in 4th level indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill row (except one) of 3rd level indirect blocks in 4th level indirect block */ for(u = 0; u < cparam->managed.width - 1; u++) { /* Fill all direct block rows in 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Fill row of 2nd level indirect blocks in 3rd level indirect block */ - if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids)) + if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */ - if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Account for root indirect block doubling # of rows again */ @@ -12000,7 +11927,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ } /* end if */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert large object, to force creation of indirect block and @@ -12012,20 +11939,20 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); #endif /* QAK */ state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object to fill space in (large) block created */ obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size; - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill rows skipped over in (4th level indirect block's first 3rd level @@ -12035,27 +11962,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size); for(u = 0; u < num_first_indirect_rows; u++) { /* Direct block rows in 2nd level indirect blocks */ for(v = 0; v < cparam->managed.width; v++) - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR /* Direct block row in 4th level indirect block */ - if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids)) + if(fill_row(fh, u, fill_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Add one more object, to create another "large" block */ obj_size = SMALL_OBJ_SIZE1; state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12074,7 +12001,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12106,7 +12033,6 @@ static unsigned test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12123,7 +12049,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12136,7 +12062,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = DBLOCK_FREE(fh, 0); for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR if(u == 0) { state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); @@ -12147,12 +12073,12 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space += DBLOCK_FREE(fh, 1) * cparam->managed.width; for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 3-4 */ @@ -12163,34 +12089,34 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Add one more object, to create a 2 * start_block_size block */ state.man_alloc_size += DBLOCK_SIZE(fh, 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and fill in direct blocks of initial block size (which have large free space in them) */ obj_size = (size_t)DBLOCK_FREE(fh, 0) - obj_size; for(u = 0; u < cparam->managed.width; u++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR for(u = 0; u < cparam->managed.width; u++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill in 2 * start_block_size block */ obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) / 2); - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12209,7 +12135,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12238,7 +12164,6 @@ static unsigned test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12256,7 +12181,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12272,7 +12197,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* First row */ for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 0); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR if(u == 0) { state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0); @@ -12284,12 +12209,12 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Second row */ for(u = 0; u < cparam->managed.width; u++) { state.man_alloc_size += DBLOCK_SIZE(fh, 1); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 3-4 */ @@ -12303,13 +12228,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, u + 2) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u + 2); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 5-8 */ @@ -12323,13 +12248,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, u + 4) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u + 4); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* (Account for doubling root indirect block for rows 9-16 */ @@ -12342,25 +12267,25 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar obj_size = (size_t)DBLOCK_SIZE(fh, 8) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, 8); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all root block's direct blocks */ for(u = 0; u < root_direct_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12379,7 +12304,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12410,7 +12335,6 @@ static unsigned test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12429,7 +12353,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12440,11 +12364,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); #endif /* QAK */ /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects small enough to fit into each direct block, but not to @@ -12454,26 +12378,26 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows); obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all 2nd level indirect block's direct blocks */ for(u = 0; u < num_first_indirect_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12492,7 +12416,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12524,7 +12448,6 @@ static unsigned test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12543,7 +12466,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR @@ -12551,19 +12474,19 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * root_direct_rows = DTABLE_MAX_DROWS(fh); /* Fill direct blocks in root indirect block */ - if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_root_direct(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Fill all rows of 2nd level indirect blocks in root indirect block */ - if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids)) + if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert objects small enough to fit into each direct block, but not to @@ -12573,26 +12496,26 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2; for(v = 0; v < cparam->managed.width; v++) { state.man_alloc_size += DBLOCK_SIZE(fh, u); - if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ } /* end for */ /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Go back and backfill all 3rd level indirect block's direct blocks */ for(u = 0; u < root_direct_rows; u++) { obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2); for(v = 0; v < cparam->managed.width; v++) - if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids)) + if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids)) TEST_ERROR } /* end for */ /* Perform common file & heap close operations */ - if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) + if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0) TEST_ERROR /* Free resources */ @@ -12611,7 +12534,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12639,7 +12562,6 @@ static unsigned test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12660,7 +12582,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -12675,7 +12597,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -12683,7 +12605,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12693,12 +12615,12 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -12706,11 +12628,11 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12722,14 +12644,14 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -12766,7 +12688,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -12792,7 +12714,6 @@ static unsigned test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -12814,7 +12735,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -12831,7 +12752,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -12839,7 +12760,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12849,19 +12770,19 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -12869,7 +12790,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12879,12 +12800,12 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -12893,11 +12814,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12907,11 +12828,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12922,11 +12843,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12936,11 +12857,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -12953,14 +12874,14 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -12999,7 +12920,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13025,7 +12946,6 @@ static unsigned test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13048,7 +12968,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -13067,7 +12987,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13075,7 +12995,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13085,19 +13005,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -13105,7 +13025,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13115,19 +13035,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -13135,7 +13055,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13145,12 +13065,12 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13159,13 +13079,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13175,13 +13095,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13191,13 +13111,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13208,13 +13128,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp } /* end if */ else { /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13224,13 +13144,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13240,13 +13160,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp TEST_ERROR /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13259,14 +13179,14 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13307,7 +13227,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13333,7 +13253,6 @@ static unsigned test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13358,7 +13277,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -13381,7 +13300,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13389,7 +13308,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13399,19 +13318,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -13419,7 +13338,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13429,19 +13348,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -13449,7 +13368,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13459,19 +13378,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0) FAIL_STACK_ERROR @@ -13479,7 +13398,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13496,19 +13415,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fourth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0) FAIL_STACK_ERROR @@ -13516,7 +13435,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13534,12 +13453,12 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fifth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13548,13 +13467,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13564,13 +13483,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13580,13 +13499,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13596,36 +13515,36 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end if */ else { /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -13635,13 +13554,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13651,13 +13570,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13667,11 +13586,11 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end else */ @@ -13683,14 +13602,14 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13735,7 +13654,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13759,7 +13678,6 @@ static unsigned test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13794,7 +13712,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -13829,7 +13747,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Insert object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -13837,13 +13755,13 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* QAK */ #ifdef QAK /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -13864,7 +13782,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR #endif /* QAK */ /* QAK */ @@ -13876,12 +13794,12 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam TEST_ERROR /* Read in huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -13889,11 +13807,11 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -13904,14 +13822,14 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -13947,7 +13865,7 @@ error: H5E_BEGIN_TRY { H5MM_xfree(heap_id); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -13975,7 +13893,6 @@ static unsigned test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -13996,7 +13913,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14011,7 +13928,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14019,7 +13936,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14029,12 +13946,12 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14042,11 +13959,11 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14058,14 +13975,14 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14102,7 +14019,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14128,7 +14045,6 @@ static unsigned test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14150,7 +14066,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14167,7 +14083,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14175,7 +14091,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14185,19 +14101,19 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -14205,7 +14121,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14215,12 +14131,12 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14229,11 +14145,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14243,11 +14159,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14258,11 +14174,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar } /* end if */ else { /* Remove second object from heap */ - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14272,11 +14188,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14289,14 +14205,14 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14335,7 +14251,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14362,7 +14278,6 @@ static unsigned test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -14389,7 +14304,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Allocate heap ID(s) */ @@ -14416,7 +14331,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert first object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -14424,7 +14339,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14434,26 +14349,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in first huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on first huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert second object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -14461,7 +14376,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14471,26 +14386,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in second huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on second huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id2, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert third object too large for managed heap blocks */ obj_size = SMALL_STAND_SIZE + 3; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0) FAIL_STACK_ERROR @@ -14498,7 +14413,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14508,26 +14423,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in third huge object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id3, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on third huge object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id3, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fourth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0) FAIL_STACK_ERROR @@ -14535,7 +14450,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14552,26 +14467,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fourth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id4, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on fourth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id4, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert fifth object small enough to fit into 'normal' heap blocks */ obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0) FAIL_STACK_ERROR @@ -14579,7 +14494,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14597,19 +14512,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in fifth ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id5, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on fifth ('normal') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id5, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14617,7 +14532,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Insert sixth object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id6) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id6) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id6, &obj_type) < 0) FAIL_STACK_ERROR @@ -14625,7 +14540,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14635,26 +14550,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id6, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id6, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on sixth ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id6, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Insert seventh object small enough to encode in heap ID */ obj_size = tparam->actual_id_len - 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id7) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id7) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id7, &obj_type) < 0) FAIL_STACK_ERROR @@ -14662,7 +14577,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14672,19 +14587,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Read in tiny object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id7, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id7, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Check 'op' functionality on seventh ('tiny') object */ HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_op(fh, dxpl, heap_id7, op_memcpy, shared_robj_g) < 0) + if(H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -14693,13 +14608,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove first object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14709,13 +14624,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14725,13 +14640,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14741,19 +14656,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -14763,13 +14678,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove sixth object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id6) < 0) + if(H5HF_remove(fh, heap_id6) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14779,22 +14694,22 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove seventh object from heap */ - if(H5HF_remove(fh, dxpl, heap_id7) < 0) + if(H5HF_remove(fh, heap_id7) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end if */ else { /* Remove seventh object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id7) < 0) + if(H5HF_remove(fh, heap_id7) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14804,13 +14719,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove sixth object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id6) < 0) + if(H5HF_remove(fh, heap_id6) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14820,19 +14735,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove fifth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id5) < 0) + if(H5HF_remove(fh, heap_id5) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Remove fourth ('normal') object from heap */ - if(H5HF_remove(fh, dxpl, heap_id4) < 0) + if(H5HF_remove(fh, heap_id4) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Reset 'managed' object statistics after they are all removed */ @@ -14842,13 +14757,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar state.man_free_space = 0; /* Remove third object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id3) < 0) + if(H5HF_remove(fh, heap_id3) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14858,13 +14773,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove second object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -14874,11 +14789,11 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar TEST_ERROR /* Remove first object from heap */ - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end else */ @@ -14890,14 +14805,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -14946,7 +14861,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -14973,7 +14888,6 @@ static unsigned test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15001,7 +14915,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -15011,7 +14925,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Insert object small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id, &obj_type) < 0) FAIL_STACK_ERROR @@ -15019,11 +14933,11 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15044,7 +14958,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15056,12 +14970,12 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para TEST_ERROR /* Read in ('normal') object */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -15069,13 +14983,13 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para /* Delete individual objects, if we won't be deleting the entire heap later */ if(tparam->del_dir != FHEAP_DEL_HEAP) { /* Remove object from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id) < 0) + if(H5HF_remove(fh, heap_id) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Check up on heap... */ @@ -15085,14 +14999,14 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15125,7 +15039,7 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15149,7 +15063,6 @@ static unsigned test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15178,7 +15091,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Perform common test initialization operations */ @@ -15188,7 +15101,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* Insert object #1, small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id1) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id1) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id1, &obj_type) < 0) FAIL_STACK_ERROR @@ -15196,12 +15109,12 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Insert object #2, small enough to fit into direct heap block */ obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0) FAIL_STACK_ERROR if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0) FAIL_STACK_ERROR @@ -15209,7 +15122,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15230,7 +15143,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15242,23 +15155,23 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Read in ('normal') object #1 */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id1, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id1, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR /* Read in ('normal') object #2 */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR if(obj_size != robj_size) TEST_ERROR HDmemset(shared_robj_g, 0, obj_size); - if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0) + if(H5HF_read(fh, heap_id2, shared_robj_g) < 0) FAIL_STACK_ERROR if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size)) TEST_ERROR @@ -15267,13 +15180,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa if(tparam->del_dir != FHEAP_DEL_HEAP) { if(tparam->del_dir == FHEAP_DEL_FORWARD) { /* Remove object #1 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15294,13 +15207,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove object #2 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15309,7 +15222,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15330,7 +15243,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15340,13 +15253,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ else { /* Remove object #2 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id2) < 0) + if(H5HF_remove(fh, heap_id2) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15367,13 +15280,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove object #1 from heap */ - if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0) + if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0) FAIL_STACK_ERROR - if(H5HF_remove(fh, dxpl, heap_id1) < 0) + if(H5HF_remove(fh, heap_id1) < 0) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15382,7 +15295,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -15403,7 +15316,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Check up on heap... */ @@ -15414,14 +15327,14 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15454,7 +15367,7 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si error: H5E_BEGIN_TRY { if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15484,7 +15397,6 @@ static unsigned test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15518,7 +15430,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15559,11 +15471,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Increment the amount of objects added */ @@ -15598,11 +15510,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Delete objects inserted */ for(u = 0; u < keep_ids.num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end for */ @@ -15612,14 +15524,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15659,7 +15571,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15688,7 +15600,6 @@ static unsigned test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15722,7 +15633,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15775,11 +15686,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed); obj_loc = (tmp_cparam.max_man_size + 255) - obj_size; /* Insert object */ - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Increment the amount of objects added */ @@ -15814,11 +15725,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % /* Delete objects inserted */ for(u = 0; u < keep_ids.num_ids; u++) { /* Remove object from heap */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0) FAIL_STACK_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR } /* end for */ @@ -15828,14 +15739,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = % } /* end if */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; /* Check for deleting the entire heap */ if(tparam->del_dir == FHEAP_DEL_HEAP) { /* Delete heap */ - if(H5HF_delete(f, dxpl, fh_addr) < 0) + if(H5HF_delete(f, fh_addr) < 0) FAIL_STACK_ERROR } /* end if */ @@ -15876,7 +15787,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -15914,7 +15825,6 @@ static unsigned test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -15973,7 +15883,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end if */ /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -15985,16 +15895,16 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Create 'tiny' and 'huge' objects */ obj_size = id_len / 2; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, tiny_heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, tiny_heap_id) < 0) FAIL_STACK_ERROR obj_size = tmp_cparam.max_man_size + 1; - if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, huge_heap_id) < 0) + if(H5HF_insert(fh, obj_size, shared_wobj_g, huge_heap_id) < 0) FAIL_STACK_ERROR /* Verify that writing to 'huge' objects works for un-filtered heaps */ H5E_BEGIN_TRY { - ret = H5HF_write(fh, dxpl, huge_heap_id, &id_changed, shared_wobj_g); + ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY; HDassert(!id_changed); if(tparam->comp == FHEAP_TEST_COMPRESS) { @@ -16008,14 +15918,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Verify that writing to 'tiny' objects return failure (for now) */ H5E_BEGIN_TRY { - ret = H5HF_write(fh, dxpl, tiny_heap_id, &id_changed, shared_wobj_g); + ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY; HDassert(!id_changed); if(ret >= 0) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16044,7 +15954,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Initialize data to overwrite with */ @@ -16056,20 +15966,20 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) obj_size = 20; for(u = 0; u < 40; u++) { obj_loc = u; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Check for closing & re-opening the heap */ - if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + if(reopen_heap(f, &fh, fh_addr, tparam) < 0) TEST_ERROR /* Overwrite data just written */ - if(H5HF_write(fh, dxpl, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0) + if(H5HF_write(fh, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0) FAIL_STACK_ERROR HDassert(!id_changed); /* Read data back in */ - if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0) + if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0) FAIL_STACK_ERROR /* Compare data read in */ @@ -16084,7 +15994,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16111,14 +16021,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Verify changed objects */ obj_size = 20; for(u = 0; u < 40; u++) { /* Read data back in */ - if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0) + if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0) FAIL_STACK_ERROR /* Compare data read in */ @@ -16133,7 +16043,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) } /* end for */ /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16163,7 +16073,7 @@ error: H5MM_xfree(keep_ids.offs); H5MM_xfree(rewrite_obj); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -16191,7 +16101,6 @@ static unsigned test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { hid_t file = -1; /* File ID */ - hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */ char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ @@ -16212,7 +16121,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t)); /* Perform common file & heap open operations */ - if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) + if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0) TEST_ERROR /* Get information about heap ID lengths */ @@ -16224,36 +16133,36 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Insert objects */ obj_size = 44; obj_loc = 1; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 484; obj_loc = 2; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 168; obj_loc = 3; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 96; obj_loc = 4; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 568; obj_loc = 5; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR obj_size = 568; obj_loc = 6; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16276,15 +16185,15 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Remove one of the objects */ - if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * 4]) < 0) + if(H5HF_remove(fh, &keep_ids.ids[id_len * 4]) < 0) FAIL_STACK_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16306,17 +16215,17 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) FAIL_STACK_ERROR /* Re-open the heap */ - if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr))) + if(NULL == (fh = H5HF_open(f, fh_addr))) FAIL_STACK_ERROR /* Insert another object */ obj_size = 208; obj_loc = 6; - if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids)) + if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids)) TEST_ERROR /* Close the fractal heap */ - if(H5HF_close(fh, dxpl) < 0) + if(H5HF_close(fh) < 0) FAIL_STACK_ERROR fh = NULL; @@ -16341,7 +16250,7 @@ error: H5MM_xfree(keep_ids.lens); H5MM_xfree(keep_ids.offs); if(fh) - H5HF_close(fh, dxpl); + H5HF_close(fh); H5Fclose(file); } H5E_END_TRY; return(1); @@ -16379,6 +16288,7 @@ main(void) int ExpressMode; /* Express testing level */ const char *envval; /* Environment variable */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Don't run this test using certain file drivers */ envval = HDgetenv("HDF5_DRIVER"); @@ -16417,6 +16327,8 @@ main(void) /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); init_large_cparam(&large_cparam); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Allocate space for the shared objects */ shared_obj_size_g = large_cparam.max_man_size + 256; @@ -16838,6 +16750,8 @@ main(void) /* Verify symbol table messages are cached */ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -16854,11 +16768,7 @@ main(void) if(H5Pclose(pb_fapl) < 0) TEST_ERROR /* Clean up file used */ -#ifndef QAK h5_cleanup(FILENAME, def_fapl); -#else /* QAK */ -HDfprintf(stderr, "Uncomment cleanup!\n"); -#endif /* QAK */ return 0; diff --git a/test/freespace.c b/test/freespace.c index 39c5688..ebc7840 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -23,6 +23,8 @@ /* Other private headers that this test requires */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "H5Fpkg.h" + +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" #include "H5VMprivate.h" @@ -446,7 +448,6 @@ static unsigned test_fs_create(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -456,6 +457,7 @@ test_fs_create(hid_t fapl) H5FS_create_t cparam, test_cparam; /* creation parameters */ uint16_t nclasses; unsigned init_flags=0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the creation/close/reopen/deletion of the free-space manager"); @@ -477,6 +479,8 @@ test_fs_create(hid_t fapl) /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -486,13 +490,10 @@ test_fs_create(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -512,12 +513,12 @@ test_fs_create(hid_t fapl) FAIL_STACK_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -527,12 +528,12 @@ test_fs_create(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -547,10 +548,8 @@ test_fs_create(hid_t fapl) /* Verify the file is the correct size */ if(file_size != empty_size) TEST_ERROR - - /* Close the dxpl */ - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -559,9 +558,9 @@ test_fs_create(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_create() */ @@ -595,7 +594,6 @@ static unsigned test_fs_sect_add(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl_id (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -608,6 +606,7 @@ test_fs_sect_add(hid_t fapl) unsigned init_flags=0; h5_stat_size_t file_size=0, tmp_file_size=0, fr_meta_size=0; unsigned can_shrink=FALSE; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("adding a section via H5FS_sect_add() to free-space: test 1"); @@ -628,6 +627,8 @@ test_fs_sect_add(hid_t fapl) /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -636,13 +637,10 @@ test_fs_sect_add(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -654,7 +652,7 @@ test_fs_sect_add(hid_t fapl) init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -669,7 +667,7 @@ test_fs_sect_add(hid_t fapl) fr_meta_size = H5FS_HEADER_SIZE(f) + H5FS_SINFO_PREFIX_SIZE(f); /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -704,7 +702,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_GHOST_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -717,7 +715,7 @@ test_fs_sect_add(hid_t fapl) init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, 0, NULL) < 0) FAIL_STACK_ERROR @@ -732,7 +730,7 @@ test_fs_sect_add(hid_t fapl) fr_meta_size = H5FS_HEADER_SIZE(f); /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -776,7 +774,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -791,7 +789,7 @@ test_fs_sect_add(hid_t fapl) */ init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -802,12 +800,12 @@ test_fs_sect_add(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -845,7 +843,7 @@ test_fs_sect_add(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -860,7 +858,7 @@ test_fs_sect_add(hid_t fapl) */ init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_DESERIALIZING, &can_shrink) < 0) FAIL_STACK_ERROR @@ -872,7 +870,7 @@ test_fs_sect_add(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -881,20 +879,20 @@ test_fs_sect_add(hid_t fapl) sect_node = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -905,9 +903,9 @@ error: if(sect_node) TEST_sect_free((H5FS_section_info_t *)sect_node); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_add() */ @@ -937,7 +935,6 @@ static unsigned test_fs_sect_find(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -950,6 +947,7 @@ test_fs_sect_find(hid_t fapl) TEST_free_section_t *node; htri_t node_found = FALSE; unsigned init_flags=0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("H5FS_sect_find(): free-space is empty"); @@ -959,6 +957,8 @@ test_fs_sect_find(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -967,13 +967,10 @@ test_fs_sect_find(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -985,7 +982,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -995,7 +992,7 @@ test_fs_sect_find(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1004,7 +1001,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find() a section equal to requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1021,7 +1018,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1042,7 +1039,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1061,7 +1058,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1080,7 +1077,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1091,7 +1088,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1104,11 +1101,11 @@ test_fs_sect_find(hid_t fapl) TEST_ERROR /* remove sections A, C and D */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node3) < 0) FAIL_STACK_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node4) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1123,7 +1120,7 @@ test_fs_sect_find(hid_t fapl) sect_node4 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1132,7 +1129,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find() a section greater than requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1149,7 +1146,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1169,7 +1166,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1180,7 +1177,7 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1194,7 +1191,7 @@ test_fs_sect_find(hid_t fapl) node = NULL; /* remove sections A */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1203,7 +1200,7 @@ test_fs_sect_find(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; @@ -1212,7 +1209,7 @@ test_fs_sect_find(hid_t fapl) TESTING("H5FS_sect_find(): cannot find a section with requested-size from free-space"); /* reopen the free-space manager */ - if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses, + if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1229,7 +1226,7 @@ test_fs_sect_find(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1241,14 +1238,14 @@ test_fs_sect_find(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* remove sections A */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1257,20 +1254,20 @@ test_fs_sect_find(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -1285,9 +1282,9 @@ error: if(sect_node4) TEST_sect_free((H5FS_section_info_t *)sect_node4); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_find() */ @@ -1329,7 +1326,6 @@ static unsigned test_fs_sect_merge(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1342,6 +1338,7 @@ test_fs_sect_merge(hid_t fapl) unsigned init_flags=0; htri_t node_found = FALSE; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the merge of sections when H5FS_sect_add() to free-space: test 1"); @@ -1354,6 +1351,8 @@ test_fs_sect_merge(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1362,13 +1361,10 @@ test_fs_sect_merge(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1383,7 +1379,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1403,7 +1399,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1421,7 +1417,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1439,7 +1435,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1451,7 +1447,7 @@ test_fs_sect_merge(hid_t fapl) /* should be able to find the merged section of A, B, C & D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1464,12 +1460,12 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1496,7 +1492,7 @@ test_fs_sect_merge(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1511,7 +1507,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1531,7 +1527,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1544,17 +1540,17 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should not be able to find the merged section of A & B */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* remove section A from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* remove section B from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -1566,12 +1562,12 @@ test_fs_sect_merge(hid_t fapl) sect_node2 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1598,7 +1594,7 @@ test_fs_sect_merge(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = 0; /* reset */ - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1613,7 +1609,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1633,7 +1629,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1653,7 +1649,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1671,7 +1667,7 @@ test_fs_sect_merge(hid_t fapl) init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -1687,14 +1683,14 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should not be able to find a merged section of A, B, C & D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* should be able to find the merged section of B & C */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1708,7 +1704,7 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should be able to find section A */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1721,7 +1717,7 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* should be able to find section D */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1734,20 +1730,20 @@ test_fs_sect_merge(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; - /* Close the file and dxpl */ + /* Close the file */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -1760,9 +1756,9 @@ error: if(sect_node2) TEST_sect_free((H5FS_section_info_t *)sect_node2); if(frsp) - H5FS_close(f, dxpl_id, frsp); - H5Pclose(dxpl_id); + H5FS_close(f, frsp); H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_merge() */ @@ -1805,7 +1801,6 @@ static unsigned test_fs_sect_shrink(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -1819,6 +1814,7 @@ test_fs_sect_shrink(hid_t fapl) unsigned can_shrink=FALSE; htri_t node_found = FALSE; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 1"); @@ -1828,6 +1824,8 @@ test_fs_sect_shrink(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -1838,13 +1836,10 @@ test_fs_sect_shrink(hid_t fapl) TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1860,7 +1855,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE); can_shrink = FALSE; - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1873,7 +1868,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should still be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -1894,7 +1889,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); can_shrink = FALSE; - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1905,19 +1900,19 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -1945,7 +1940,7 @@ test_fs_sect_shrink(hid_t fapl) /* does not allow merging */ init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -1960,7 +1955,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1980,7 +1975,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -1989,7 +1984,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section B should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2001,7 +1996,7 @@ test_fs_sect_shrink(hid_t fapl) /* section A should still be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2014,12 +2009,12 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2045,7 +2040,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */ init_flags = 0; /* reset */ - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2060,7 +2055,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -2080,7 +2075,7 @@ test_fs_sect_shrink(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0) FAIL_STACK_ERROR @@ -2090,7 +2085,7 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section B should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR @@ -2098,27 +2093,27 @@ test_fs_sect_shrink(hid_t fapl) TEST_ERROR /* section A should not be there in free-space */ - if((node_found = H5FS_sect_find(f, dxpl_id, frsp, + if((node_found = H5FS_sect_find(f, frsp, (hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if (node_found) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2127,9 +2122,9 @@ test_fs_sect_shrink(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_shrink() */ @@ -2155,7 +2150,6 @@ static unsigned test_fs_sect_change_class(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2167,6 +2161,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL; unsigned init_flags=0; TEST_free_section_t *node; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1"); @@ -2176,6 +2171,8 @@ test_fs_sect_change_class(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2184,14 +2181,11 @@ test_fs_sect_change_class(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); init_flags = H5FS_CLS_GHOST_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2206,7 +2200,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2226,7 +2220,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2237,7 +2231,7 @@ test_fs_sect_change_class(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node1, TEST_FSPACE_SECT_TYPE_NONE) < 0) TEST_ERROR @@ -2246,7 +2240,7 @@ test_fs_sect_change_class(hid_t fapl) if(check_stats(f, frsp, &state)) TEST_ERROR - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2256,7 +2250,7 @@ test_fs_sect_change_class(hid_t fapl) if(TEST_sect_free((H5FS_section_info_t *)node) < 0) TEST_ERROR - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -2265,12 +2259,12 @@ test_fs_sect_change_class(hid_t fapl) sect_node2 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2297,7 +2291,7 @@ test_fs_sect_change_class(hid_t fapl) nclasses = NELMTS(test_classes); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2312,7 +2306,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2324,7 +2318,7 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2336,17 +2330,17 @@ test_fs_sect_change_class(hid_t fapl) init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR /* change the class of B to A's class */ - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node2, TEST_FSPACE_SECT_TYPE) < 0) TEST_ERROR /* change the class of C to A's class */ - if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3, + if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node3, TEST_FSPACE_SECT_TYPE) < 0) TEST_ERROR @@ -2356,7 +2350,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section B has changed class */ - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2367,7 +2361,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section C has changed class */ - if(H5FS_sect_find(f, dxpl_id, frsp, + if(H5FS_sect_find(f, frsp, (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR @@ -2378,7 +2372,7 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* remove section A from free-space */ - if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0) + if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0) FAIL_STACK_ERROR /* Free the section node(s) */ @@ -2387,20 +2381,20 @@ test_fs_sect_change_class(hid_t fapl) sect_node1 = NULL; /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2413,9 +2407,9 @@ error: if(sect_node2) TEST_sect_free((H5FS_section_info_t *)sect_node2); if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_change_class() */ @@ -2455,7 +2449,6 @@ static unsigned test_fs_sect_extend(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2466,6 +2459,7 @@ test_fs_sect_extend(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL; unsigned init_flags=0; htri_t status; /* Status of 'try' calls */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("a block's extension by requested-size which is = adjoining free section's size: Test 1"); @@ -2474,16 +2468,15 @@ test_fs_sect_extend(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); /* * TEST 1 @@ -2491,7 +2484,7 @@ test_fs_sect_extend(hid_t fapl) init_cparam(&cparam); nclasses = NELMTS(test_classes); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2506,7 +2499,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2526,7 +2519,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2538,7 +2531,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend a block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) FAIL_STACK_ERROR if(FALSE == status) TEST_ERROR @@ -2551,12 +2544,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2567,7 +2560,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which is > adjoining free section's size: Test 2"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2582,7 +2575,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2602,7 +2595,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2614,7 +2607,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0) FAIL_STACK_ERROR if(TRUE == status) TEST_ERROR @@ -2624,12 +2617,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2640,7 +2633,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which is < adjoining free section's size: Test 3"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2655,7 +2648,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2675,7 +2668,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2687,7 +2680,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0) TEST_ERROR if(FALSE == status) TEST_ERROR @@ -2698,12 +2691,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2714,7 +2707,7 @@ test_fs_sect_extend(hid_t fapl) */ TESTING("a block's extension by requested-size which does not adjoin any free section: Test 4"); - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2729,7 +2722,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2749,7 +2742,7 @@ test_fs_sect_extend(hid_t fapl) init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR @@ -2761,7 +2754,7 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Extend the block by requested-size */ - if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) + if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0) TEST_ERROR if(TRUE == status) TEST_ERROR @@ -2771,12 +2764,12 @@ test_fs_sect_extend(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; @@ -2785,17 +2778,17 @@ test_fs_sect_extend(hid_t fapl) /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return 0; error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_sect_extend() */ @@ -2813,7 +2806,6 @@ static unsigned test_fs_sect_iterate(hid_t fapl) { hid_t file = -1; /* File ID */ - hid_t dxpl_id = -1; /* dxpl ID (for tag) */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ H5FS_t *frsp = NULL; /* pointer to free space structure */ @@ -2826,6 +2818,7 @@ test_fs_sect_iterate(hid_t fapl) TEST_iter_ud_t udata; int i; hsize_t tot_space, nsects; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("iteration of sections in the free-space manager"); @@ -2835,6 +2828,8 @@ test_fs_sect_iterate(hid_t fapl) /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file))) @@ -2845,14 +2840,11 @@ test_fs_sect_iterate(hid_t fapl) udata.tot_size = 0; udata.tot_sect_count = 0; - /* Create the dxpl and tag it with the global free space tag */ - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) - FAIL_STACK_ERROR - if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0) - FAIL_STACK_ERROR + /* Tag with the global free space tag */ + H5AC_tag(H5AC__FREESPACE_TAG, NULL); init_flags = H5FS_CLS_SEPAR_OBJ; - if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr, + if(NULL == (frsp = H5FS_create(f, &fs_addr, &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF))) FAIL_STACK_ERROR @@ -2866,12 +2858,12 @@ test_fs_sect_iterate(hid_t fapl) sect_size = (unsigned)((i-1) % 9) + 1; init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE); - if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node, + if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node, H5FS_ADD_RETURNED_SPACE, NULL) < 0) FAIL_STACK_ERROR } /* end for */ - if(H5FS_sect_iterate(f, dxpl_id, frsp, TEST_sects_cb, &udata) < 0) + if(H5FS_sect_iterate(f, frsp, TEST_sects_cb, &udata) < 0) TEST_ERROR H5FS_sect_stats(frsp, &tot_space, &nsects); @@ -2882,20 +2874,20 @@ test_fs_sect_iterate(hid_t fapl) TEST_ERROR /* Close the free space manager */ - if(H5FS_close(f, dxpl_id, frsp) < 0) + if(H5FS_close(f, frsp) < 0) FAIL_STACK_ERROR frsp = NULL; /* Delete free space manager */ - if(H5FS_delete(f, dxpl_id, fs_addr) < 0) + if(H5FS_delete(f, fs_addr) < 0) FAIL_STACK_ERROR fs_addr = HADDR_UNDEF; /* Close the file and dxpl */ if(H5Fclose(file) < 0) FAIL_STACK_ERROR - if(H5Pclose(dxpl_id) < 0) - FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED() @@ -2904,9 +2896,9 @@ test_fs_sect_iterate(hid_t fapl) error: H5E_BEGIN_TRY { if(frsp) - H5FS_close(f, dxpl_id, frsp); + H5FS_close(f, frsp); H5Fclose(file); - H5Pclose(dxpl_id); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } /* test_fs_sect_iterate() */ diff --git a/test/gheap.c b/test/gheap.c index 7564afa..01ea385 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -22,6 +22,7 @@ #include "h5test.h" #include "H5private.h" #include "H5ACprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" #include "H5Fprivate.h" #include "H5Gprivate.h" @@ -87,6 +88,7 @@ test_1 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically increasing lengths"); @@ -98,6 +100,8 @@ test_1 (hid_t fapl) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -113,7 +117,7 @@ test_1 (hid_t fapl) size = u + 1; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert(f, size, out, obj + u); if(status < 0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -132,7 +136,7 @@ test_1 (hid_t fapl) size = u + 1; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + if(NULL == H5HG_read(f, obj + u, in, NULL)) { H5_FAILED(); puts(" Unable to read object"); nerrors++; @@ -148,6 +152,8 @@ test_1 (hid_t fapl) obj = NULL; if(H5Fclose(file) < 0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; PASSED(); @@ -156,6 +162,7 @@ test_1 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -192,6 +199,7 @@ test_2 (hid_t fapl) size_t size; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("monotonically decreasing lengths"); @@ -203,6 +211,8 @@ test_2 (hid_t fapl) h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -216,7 +226,7 @@ test_2 (hid_t fapl) size = GHEAP_TEST_NOBJS - u; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { + if (H5HG_insert (f, size, out, obj + u) < 0) { H5_FAILED(); puts(" Unable to insert object into global heap"); nerrors++; @@ -230,7 +240,7 @@ test_2 (hid_t fapl) size = GHEAP_TEST_NOBJS - u; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + if (NULL==H5HG_read (f, obj + u, in, NULL)) { H5_FAILED(); puts(" Unable to read object"); nerrors++; @@ -246,6 +256,8 @@ test_2 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -254,6 +266,7 @@ test_2 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -290,6 +303,7 @@ test_3 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("complete object removal"); @@ -301,6 +315,8 @@ test_3 (hid_t fapl) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -312,7 +328,7 @@ test_3 (hid_t fapl) size = u % 30 + 100; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert (f, size, out, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -322,7 +338,7 @@ test_3 (hid_t fapl) /* Remove everything */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); + status = H5HG_remove (f, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to remove object"); @@ -335,6 +351,8 @@ test_3 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -343,6 +361,7 @@ test_3 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -380,6 +399,7 @@ test_4 (hid_t fapl) herr_t status; int nerrors = 0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("partial object removal"); @@ -391,6 +411,8 @@ test_4 (hid_t fapl) h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -402,7 +424,7 @@ test_4 (hid_t fapl) size = u % 30 + 100; HDmemset(out, (int)('A' + u % 26), size); H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + status = H5HG_insert (f, size, out, obj + u); if (status<0) { H5_FAILED(); puts(" Unable to insert object into global heap"); @@ -416,7 +438,7 @@ test_4 (hid_t fapl) */ if(1 == (u % 3)) { H5Eclear2(H5E_DEFAULT); - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); + status = H5HG_remove (f, obj + u - 1); if (status<0) { H5_FAILED(); puts(" Unable to remove object"); @@ -431,6 +453,8 @@ test_4 (hid_t fapl) obj = NULL; if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; PASSED(); @@ -439,6 +463,7 @@ test_4 (hid_t fapl) error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); @@ -475,6 +500,7 @@ test_ooo_indices(hid_t fapl) herr_t status; int nerrors=0; char filename[1024]; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("out of order indices"); @@ -485,6 +511,8 @@ test_ooo_indices(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); puts(" Unable to create file"); @@ -499,7 +527,7 @@ test_ooo_indices(hid_t fapl) * can be deleted. */ for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) { H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, sizeof(j), &j, &obj[j]); + status = H5HG_insert(f, sizeof(j), &j, &obj[j]); if (status<0) GHEAP_REPEATED_ERR(" Unable to insert object into global heap") @@ -512,7 +540,7 @@ test_ooo_indices(hid_t fapl) if(i>0) for(j=1000*(i&1); j<1000*((i&1)+1); j++) { H5Eclear2(H5E_DEFAULT); - status = H5HG_remove(f, H5AC_ind_read_dxpl_id, &obj[j]); + status = H5HG_remove(f, &obj[j]); if (status<0) GHEAP_REPEATED_ERR(" Unable to remove object from global heap"); } /* end for */ @@ -534,7 +562,7 @@ test_ooo_indices(hid_t fapl) /* Read the objects to make sure the heap is still readable */ for(i=0; i<1000; i++) { - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, &obj[i], &j, NULL)) + if(NULL == H5HG_read(f, &obj[i], &j, NULL)) goto error; if(i != j) { H5_FAILED(); @@ -544,15 +572,20 @@ test_ooo_indices(hid_t fapl) } /* end for */ if (H5Fclose(file)<0) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if (nerrors) goto error; + HDfree(obj); obj = NULL; + PASSED(); return 0; error: H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; if(obj) HDfree(obj); diff --git a/test/lheap.c b/test/lheap.c index f5b7f77..dd8110e 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -20,6 +20,7 @@ #include "h5test.h" #include "H5srcdir.h" #include "H5ACprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5HLprivate.h" #include "H5Iprivate.h" @@ -62,6 +63,7 @@ main(void) int i, j; /* miscellaneous counters */ char buf[1024]; /* the value to store */ const char *s; /* value to read */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Reset library */ h5_reset(); @@ -75,6 +77,8 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -85,12 +89,12 @@ main(void) H5Eprint2(H5E_DEFAULT, stdout); goto error; } - if(FAIL == H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)0, &heap_addr/*out*/)) { + if(FAIL == H5HL_create(f, (size_t)0, &heap_addr/*out*/)) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; } - if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) { + if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -102,7 +106,7 @@ main(void) if(j > 4) buf[j] = '\0'; - if(UFAIL == (obj[i] = H5HL_insert(f, H5AC_ind_read_dxpl_id, heap, strlen(buf) + 1, buf))) { + if(UFAIL == (obj[i] = H5HL_insert(f, heap, strlen(buf) + 1, buf))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -115,6 +119,8 @@ main(void) } if (FAIL == H5Fclose(file)) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* @@ -125,6 +131,8 @@ main(void) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if(FAIL == (file = H5Fopen(filename, H5F_ACC_RDONLY, fapl))) goto error; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); @@ -142,7 +150,7 @@ main(void) if(j > 4) buf[j] = '\0'; - if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) { + if (NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) { H5_FAILED(); H5Eprint2(H5E_DEFAULT, stdout); goto error; @@ -171,6 +179,8 @@ main(void) if (FAIL == H5Fclose(file)) goto error; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* Check opening existing file non-default sizes of lengths and addresses */ @@ -179,6 +189,8 @@ main(void) const char *testfile = H5_get_srcdir_filename(TESTFILE); /* Corrected test file name */ hid_t dset = -1; file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(file >= 0){ if((dset = H5Dopen2(file, "/Dataset1", H5P_DEFAULT)) < 0) TEST_ERROR @@ -194,6 +206,8 @@ main(void) goto error; } /* end else */ } +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; PASSED(); /* Verify symbol table messages are cached */ @@ -208,6 +222,7 @@ main(void) HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; } diff --git a/test/links.c b/test/links.c index 7b3e37d..4e88af5 100644 --- a/test/links.c +++ b/test/links.c @@ -3521,7 +3521,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format) hid_t lapl_idA=-1, lapl_idB=-1; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][500]; + char sv[H5FD_MEM_NTYPES][64]; const char *memb_name[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; @@ -7762,7 +7762,8 @@ done: /* Traverse a hard link by opening the object */ static hid_t UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id) + const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { haddr_t addr; hid_t ret_value = -1; @@ -7998,7 +7999,8 @@ ud_hard_links(hid_t fapl) */ static hid_t UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, - const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) + const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { hid_t ret_value; @@ -8201,7 +8203,7 @@ error: static hid_t UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata, - size_t udata_size, hid_t lapl_id) + size_t udata_size, hid_t lapl_id, hid_t H5_ATTR_UNUSED dxpl_id) { const char *target = (const char *)udata; hid_t ret_value; @@ -8437,7 +8439,8 @@ error: */ static hid_t UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group, - const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id) + const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { char target[NAME_BUF_SIZE]; hid_t ret_value; @@ -8587,7 +8590,8 @@ UD_cbsucc_create(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED loc static hid_t UD_cbsucc_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, - const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id) + const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { const char *target = (const char *)udata; hid_t ret_value; diff --git a/test/mf.c b/test/mf.c index fea5ee2..d9ef8cf 100644 --- a/test/mf.c +++ b/test/mf.c @@ -33,6 +33,7 @@ #define H5F_TESTING #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5FLprivate.h" #include "H5Iprivate.h" #include "H5VMprivate.h" @@ -260,7 +261,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* nothing should be changed in meta_aggr */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); @@ -270,7 +271,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if (addr1 < (haddr_t)file_size) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* nothing should be changed in meta_aggr */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); @@ -299,8 +300,8 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -405,7 +406,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR @@ -437,7 +438,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -481,13 +482,13 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -531,7 +532,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -574,7 +575,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) + if(H5MF_try_shrink(f, type, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -686,7 +687,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR @@ -715,7 +716,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* should succeed */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); if(was_extended <= 0) TEST_ERROR @@ -764,7 +765,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if(addr < (haddr_t)file_size) TEST_ERROR @@ -774,7 +775,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_addr != ma_addr) TEST_ERROR - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); /* should not succeed */ if(was_extended > 0) @@ -917,19 +918,19 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Reading & writing with a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR H5E_BEGIN_TRY { - status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR /* Freeing a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, tmp_addr, (hsize_t)TBLOCK_SIZE30); + status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30); } H5E_END_TRY; if(status >= 0) TEST_ERROR @@ -962,7 +963,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Allocate 1/3 of the file as normal address space */ - if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)))) + if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)))) FAIL_STACK_ERROR if(H5F_IS_TMP_ADDR(f, norm_addr)) TEST_ERROR @@ -976,13 +977,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Test that pushing normal space allocation into temporary space fails */ H5E_BEGIN_TRY { - check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)); + check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)); } H5E_END_TRY; if(H5F_addr_defined(check_addr)) TEST_ERROR /* Free the normal block (so the file doesn't blow up to a huge size) */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, norm_addr, (hsize_t)(maxaddr / 3)) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, norm_addr, (hsize_t)(maxaddr / 3)) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -1032,7 +1033,7 @@ test_mf_fs_start(hid_t fapl) H5FS_stat_t state; - TESTING("H5MF_create_fstype()/H5MF_open_fstype() of free-space manager"); + TESTING("H5MF_create_fstype()/H5MF__open_fstype() of free-space manager"); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -1064,7 +1065,7 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1176,7 +1177,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1188,7 +1189,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1200,7 +1201,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space */ if(addr != TBLOCK_ADDR70) @@ -1214,7 +1215,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); state.tot_space += TBLOCK_SIZE30; state.tot_sect_count += 1; @@ -1223,7 +1224,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1253,7 +1254,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1265,7 +1266,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1277,7 +1278,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE20)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE20)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1290,7 +1291,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE20)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE20)); /* Still 1 section in free-space because of merging */ state.tot_space += TBLOCK_SIZE20; @@ -1298,7 +1299,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1328,7 +1329,7 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1340,7 +1341,7 @@ test_mf_fs_alloc_free(hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1356,7 +1357,7 @@ test_mf_fs_alloc_free(hid_t fapl) * Since free-space manager cannot fulfull the request, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is not section A in free-space */ if(addr == TBLOCK_ADDR70) @@ -1367,7 +1368,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR /* Verify that the block is section A in free-space */ @@ -1379,7 +1380,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block of size 40 to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE40)); /* * Free-space info is the same. @@ -1501,7 +1502,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1513,7 +1514,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1525,7 +1526,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1542,7 +1543,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1553,7 +1554,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); /* should succeed */ if(was_extended <= 0) @@ -1568,7 +1569,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); /* Verify that the extended block is back into free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE50); @@ -1579,7 +1580,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the extended block */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1609,7 +1610,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1621,7 +1622,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1633,7 +1634,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1650,7 +1651,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1661,7 +1662,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); /* Should not be able to extend the allocated block */ if(was_extended) @@ -1672,7 +1673,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the allocated block A to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* the returned section A is merged with section B in free-space */ /* rest of the info remains the same */ @@ -1682,7 +1683,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR @@ -1711,7 +1712,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1723,7 +1724,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1735,7 +1736,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1752,7 +1753,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1763,7 +1764,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); /* Should succeed in extending the allocated block */ if(was_extended <=0) @@ -1775,7 +1776,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); /* rest info is same, the extended section returned is merged with the section in free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE40); @@ -1784,7 +1785,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR @@ -1813,7 +1814,7 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1825,7 +1826,7 @@ test_mf_fs_extend(hid_t fapl) sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10)); /* Add section A of size=20 to free-space */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1837,7 +1838,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of size=20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1854,7 +1855,7 @@ test_mf_fs_extend(hid_t fapl) sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1865,7 +1866,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); /* Should not succeed in extending the allocated block */ if(was_extended) @@ -1876,7 +1877,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the allocated block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30-10)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30-10)); state.tot_space += (TBLOCK_SIZE30-10); state.tot_sect_count += 1; @@ -1886,13 +1887,13 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove section A from free-space manger */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR /* Remove section B from free-space manager */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(H5Fclose(file) < 0) @@ -1984,9 +1985,9 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) - FAIL_STACK_ERROR + /* Start up H5FD_MEM_SUPER free-space manager */ + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) TEST_ERROR @@ -1994,7 +1995,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2002,11 +2003,11 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048); /* Add a section to free-space that adjoins end of the aggregator */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != ma_addr) TEST_ERROR @@ -2016,7 +2017,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2041,7 +2042,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -2050,21 +2051,21 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* Allocate a section from sdata_aggr */ - saddr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Add a section to free-space that adjoins the beginning of meta_aggr */ sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30); /* When adding, meta_aggr is absorbed onto the end of the section */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if((tmp + TBLOCK_SIZE30) != ma_addr) @@ -2075,9 +2076,9 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* Remove section from sdata_aggr */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2168,7 +2169,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - if((addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) + if((addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2176,7 +2177,7 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate second block from meta_aggr */ - if((addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) + if((addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2205,9 +2206,9 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the two blocks: order matters because of H5F_FSPACE_STRATEGY_AGGR strategy */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50) < 0) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30) < 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -2308,13 +2309,13 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) @@ -2323,7 +2324,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if (ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50))) TEST_ERROR - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2353,7 +2354,7 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2465,14 +2466,14 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2483,14 +2484,14 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block, which is from file allocation not from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2058)); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE2058)); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -2500,7 +2501,7 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) if((new_ma_addr != ma_addr) || (new_ma_size != ma_size)) TEST_ERROR /* Allocate fourth block, which should be from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr4+TBLOCK_SIZE50) != ma_addr) @@ -2509,11 +2510,11 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2628,7 +2629,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); @@ -2639,19 +2640,19 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + saddr2 = H5MF_alloc(f, stype, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if(saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr3+TBLOCK_SIZE50) != sdata_addr) @@ -2660,7 +2661,7 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate second block of 2058, which is from file allocation, not from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); if(addr2 != sdata_addr) TEST_ERROR @@ -2676,11 +2677,11 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2776,14 +2777,14 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) @@ -2792,7 +2793,7 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(addr3 != ma_addr) TEST_ERROR @@ -2801,9 +2802,9 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2911,14 +2912,14 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) type = H5FD_MEM_SUPER; /* Allocate first block from meta_aggr */ - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) @@ -2928,14 +2929,14 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -2956,10 +2957,10 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3077,13 +3078,13 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr2+TBLOCK_SIZE50 != ma_addr) @@ -3093,13 +3094,13 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate the second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30)) != sdata_addr) @@ -3107,7 +3108,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) if (sdata_size != 0) TEST_ERROR /* Allocate the third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr3+TBLOCK_SIZE50) != sdata_addr) @@ -3116,7 +3117,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate the third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr3 != sdata_addr) TEST_ERROR @@ -3138,12 +3139,12 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3240,7 +3241,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -3252,7 +3253,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* Try to extend the block by an amount < (% * aggr->alloc_size) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); /* should succeed */ if(!was_extended) @@ -3265,10 +3266,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_size != (f->shared->meta_aggr.alloc_size - TBLOCK_SIZE50)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE50); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); /* should succeed */ if(!was_extended) @@ -3281,10 +3282,10 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TBLOCK_SIZE700)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE700); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE700); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); /* should succeed */ if(!was_extended) @@ -3297,7 +3298,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3331,14 +3332,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3350,7 +3351,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* should be able to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(!was_extended) TEST_ERROR @@ -3366,8 +3367,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3401,14 +3402,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3420,7 +3421,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* unable to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(was_extended) TEST_ERROR @@ -3434,8 +3435,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3531,7 +3532,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); ma_addr = new_ma_addr - TBLOCK_SIZE30; @@ -3539,7 +3540,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -3578,7 +3579,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -3586,12 +3587,12 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block B from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size); /* should succeed */ - if(H5MF_try_shrink(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, stype, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); @@ -3603,7 +3604,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != (ma_size)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3637,35 +3638,35 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate block B from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* Allocate block C from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3+TBLOCK_SIZE30+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* should not succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) > 0) + if(H5MF_try_shrink(f, type, addr2, (hsize_t)TBLOCK_SIZE50) > 0) TEST_ERROR /* aggregator info should be the same as before */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != ma_addr) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3792,7 +3793,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from file allocation */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -3816,7 +3817,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; accum += (mis_align + TBLOCK_SIZE50); - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -3833,8 +3834,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3868,7 +3869,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* allocate a block of 50 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if (addr1 % alignment) TEST_ERROR @@ -3889,7 +3890,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* shrink the block */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -3923,7 +3924,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* allocate a block of 50 */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if(addr1 % alignment) TEST_ERROR @@ -3944,7 +3945,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); if(was_extended <=0) TEST_ERROR @@ -4044,7 +4045,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4056,7 +4057,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4068,7 +4069,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 50 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is section A in free-space */ if(addr != (haddr_t)alignment) TEST_ERROR @@ -4082,7 +4083,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE50); state.tot_space += TBLOCK_SIZE50; state.tot_sect_count += 1; @@ -4107,7 +4108,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4119,7 +4120,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4131,7 +4132,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 600 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE600); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE600); /* Verify that the allocated block is aligned */ if (addr % alignment) TEST_ERROR @@ -4145,7 +4146,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); if(was_extended <=0) TEST_ERROR @@ -4156,7 +4157,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); /* only 1 section in free-space because of merging */ state.tot_space += (TBLOCK_SIZE600+TBLOCK_SIZE200); @@ -4190,7 +4191,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4202,7 +4203,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4217,7 +4218,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * Since free-space manager cannot fulfull the request because of alignment, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is aligned */ if(addr % alignment) @@ -4415,7 +4416,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4439,7 +4440,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4461,7 +4462,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if ((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -4484,7 +4485,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1970 from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); /* Verify that the allocated block is aligned */ if(addr4 % alignment) TEST_ERROR @@ -4505,10 +4506,10 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(check_stats(f, f->shared->fs_man[type], &state)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -4671,7 +4672,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4694,7 +4695,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4730,7 +4731,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* fragment for alignment of block 30 for sdata_aggr is freed to free-space */ if(mis_align) { @@ -4763,7 +4764,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (addr3 % alignment) TEST_ERROR @@ -4791,10 +4792,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -5010,7 +5011,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5033,7 +5034,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5068,7 +5069,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5089,7 +5090,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(saddr2 % alignment) TEST_ERROR @@ -5110,7 +5111,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(saddr3 % alignment) TEST_ERROR @@ -5132,7 +5133,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1034 for meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1034); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -5315,7 +5316,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5338,7 +5339,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5363,7 +5364,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 5 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5); /* fragment for alignment of block 5 is freed to free-space */ if(mis_align) { @@ -5526,7 +5527,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5550,7 +5551,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5571,7 +5572,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -5790,7 +5791,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (addr1 % alignment) TEST_ERROR @@ -5814,7 +5815,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (saddr1 % alignment) TEST_ERROR @@ -5835,7 +5836,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (saddr2 % alignment) TEST_ERROR @@ -5856,7 +5857,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (saddr3 % alignment) TEST_ERROR @@ -5878,7 +5879,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -6034,7 +6035,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * aggregator that extends to the end of the file, with * block_size / 2 bytes remaining, and the end of the file aligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr1 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6043,7 +6044,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * aggregator to extend to the end of the file, with 0 bytes remaining, and * the end of the file aligned */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr2 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6055,7 +6056,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * force the aggregator to extend to the end of the file, with 0 bytes * remaining, and the end of the file unaligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, block_size + (hsize_t)1); + addr1 = H5MF_alloc(f, type, block_size + (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6067,7 +6068,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Allocate a block of size 1. This should extend the aggregator from * the previous allocation, and align the new block */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)1); + addr2 = H5MF_alloc(f, type, (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6160,36 +6161,36 @@ test_mf_fs_persist_split(void) /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6208,7 +6209,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6222,7 +6223,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6233,7 +6234,7 @@ test_mf_fs_persist_split(void) /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6247,13 +6248,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR @@ -6262,19 +6263,19 @@ test_mf_fs_persist_split(void) /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8))) + if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE8))) FAIL_STACK_ERROR /* Put block #5 & #7 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, btype, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) + if(H5MF_xfree(f, btype, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6297,7 +6298,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6309,13 +6310,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #7 from H5FD_MEM_BTREE free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR if(tmp_addr != baddr7) TEST_ERROR @@ -6337,7 +6338,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6477,36 +6478,36 @@ test_mf_fs_persist_multi(void) /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6525,7 +6526,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6539,7 +6540,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6549,7 +6550,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6563,32 +6564,32 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1 & #3 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, btype, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, btype, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6607,7 +6608,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6619,7 +6620,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR @@ -6633,7 +6634,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_BTREE free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)btype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)btype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6648,13 +6649,13 @@ test_mf_fs_persist_multi(void) /* Allocate 2 blocks of type H5FD_MEM_GHEAP */ gtype = H5FD_MEM_GHEAP; - if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR /* Put block #2 into H5FD_MEM_GHEAP free-space manager */ - if(H5MF_xfree(f, gtype, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, gtype, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6671,15 +6672,15 @@ test_mf_fs_persist_multi(void) /* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */ if(H5F_addr_defined(f->shared->fs_addr[type])) { /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE1, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE3, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR @@ -6690,7 +6691,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_GHEAP free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)gtype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)gtype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6782,25 +6783,25 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6827,12 +6828,12 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) */ if((f->shared->first_alloc_dealloc) && (SUCCEED != - H5MF_tidy_self_referential_fsm_hack(f, H5AC_ind_read_dxpl_id))) + H5MF_tidy_self_referential_fsm_hack(f))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[tt])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)tt) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)tt) < 0) FAIL_STACK_ERROR /* Get info for free-space manager */ @@ -6847,13 +6848,13 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6874,7 +6875,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #5 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR if(tmp_addr != addr5) TEST_ERROR @@ -6962,25 +6963,25 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Allocate 4 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Retrieve block #1, #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -7001,7 +7002,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Put block #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -7025,14 +7026,14 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) * assertion failures on the first file space alloc / dealloc. */ if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) + if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f)) FAIL_STACK_ERROR ran_H5MF_tidy_self_referential_fsm_hack = TRUE; } /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)fs_type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)fs_type) < 0) FAIL_STACK_ERROR /* Get info for H5FD_MEM_SUPER free-space manager */ @@ -7051,7 +7052,7 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Put block #4 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR /* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */ @@ -7167,25 +7168,25 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR @@ -7339,17 +7340,17 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); @@ -7361,9 +7362,9 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format } /* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE3 + TBLOCK_SIZE5; @@ -7374,17 +7375,17 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TEST_ERROR /* section #2 is less than threshold but is merged into section #3 */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE2; if(check_stats(f, f->shared->fs_man[tt], &fs_state)) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr6, (hsize_t)TBLOCK_SIZE6) < 0) + if(H5MF_xfree(f, type, addr6, (hsize_t)TBLOCK_SIZE6) < 0) FAIL_STACK_ERROR /* For paged aggregation, the sections in the page at EOF for small meta fs are merged but are not shrunk away */ @@ -7398,7 +7399,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TEST_ERROR /* section #1 is less than threshold but is shrunk away */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR /* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */ @@ -7496,29 +7497,29 @@ test_dichotomy(hid_t fapl) /* Allocate the first block of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_SUPER */ - H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Allocate the first block of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Free the first block of type H5FD_MEM_SUPER */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_DRAW */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that saddr1 is not addr1 */ if(saddr2 == addr1) TEST_ERROR /* Free the first block of type H5FD_MEM_DRAW */ - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the third block of type H5FD_MEM_SUPER */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that addr3 is not saddr1 */ if(addr3 == saddr1) TEST_ERROR @@ -7655,52 +7656,52 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE1034); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE1034); if(!fs_persist) { H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != addr2) TEST_ERROR } /* end if */ /* Allocate 2 small raw data blocks: saddr1, saddr2 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE1034); /* Free the block with saddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); if(!fs_persist) { /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR } /* end if */ /* Allocate 2 large data blocks: gaddr1, gaddr2 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Free the block with gaddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(!fs_persist) { H5MF_alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR @@ -7739,17 +7740,17 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) * assertion failures on the first file space alloc / dealloc. */ if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) + if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f)) FAIL_STACK_ERROR } /* Set up to use the small meta data manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != (addr3+TBLOCK_SIZE50)) @@ -7761,11 +7762,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Set up to use the small raw data manager */ if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, H5F_MEM_PAGE_DRAW) < 0) + if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0) TEST_ERROR /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR @@ -7774,11 +7775,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(!(f->shared->fs_man[fs_type])) /* Set up to use the large data manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR @@ -7866,40 +7867,40 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with addr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with saddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the small raw data free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Try to shrink the block with gaddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the large-sized free-space manager */ if(status == TRUE) TEST_ERROR /* Free the block with saddr1--merge to become 1 page, then return to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50); /* Merge all 3 sections and shrunk */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_OHDR, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -7987,16 +7988,16 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE98); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98); /* Try extending the block with addr1 at EOF not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */ - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE150); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150); /* The block with addr2 should be page aligned */ /* The block with addr3 resides right next to the block with addr2 */ @@ -8006,60 +8007,60 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE100); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE100); /* Try extending the block with addr1 that will cross to the next page where the freed block with addr2 resides */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); /* Shouldn't succeed--should not cross page boundary */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with addr1 into the free-space section that is big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Free the block with addr1 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE3248); + H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248); /* Allocate a new meta data block with addr1 */ /* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */ /* The block is right next to the threshold */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3286); + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286); /* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block into the threshold with size < H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Free the block with addr3--will merge with the remaining sections to become a page and then free the page */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE150); + H5MF_xfree(f, H5FD_MEM_OHDR, addr3, (hsize_t)TBLOCK_SIZE150); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4086); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE4086); /* Try extending the block crossing the page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* The extended block is now "large" in size */ /* Try extending the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Try extending the large-sized block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); /* Should not succeed because the mis-aligned fragment in the page is in the large-sized free-space manager */ if(was_extended == TRUE) TEST_ERROR @@ -8141,66 +8142,66 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Extending the block with gaddr1 at EOF to become 2 pages */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Allocate a large data block with gaddr2 */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr1 */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr3 */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr3 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2--there is no free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2 */ /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr4 */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) TEST_ERROR /* Free the block with gaddr3--will merge with remaining free space to become 2 pages + section (size 2) in previous page */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr3, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr3, (hsize_t)TBLOCK_SIZE8000); /* Try extending the block with gaddr2 crossing page boundary--there is free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR @@ -8284,7 +8285,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr1 */ /* 1 page + 1904 bytes; 2192 bytes in free-space manager */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8292,20 +8293,20 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr2--should be on another page */ /* Allocate 1 page + 3904 bytes; 192 bytes in free-space manager */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a large data block with gaddr3--should be on another page */ /* Allocate 2 pages + 3808 bytes; 288 bytes in free-space manager */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE12000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE12000); if(!H5F_addr_defined(gaddr3)) TEST_ERROR /* Free the block with gaddr2 */ /* Merged sections: 2192 + 8000 + 192 = 10384 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr2, (hsize_t)TBLOCK_SIZE8000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8319,7 +8320,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr4--there is a free-space section able to fulfill the request */ /* Free-space sections: 2192 + 3192 + 288 = 5672 bytes */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) @@ -8337,8 +8338,8 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the two blocks with gaddr1 and gaddr4 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE6000); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr4, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE6000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr4, (hsize_t)TBLOCK_SIZE5000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8439,17 +8440,17 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Allocate 2 small meta data blocks: addr1, addr2 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); /* Should be on the second page and page aligned */ if(saddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a small raw data block with saddr2 */ - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should not be page aligned */ if(!(saddr2 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8458,13 +8459,13 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */ - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4020); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020); /* Should be on the third page and page aligned */ if(addr3 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */ - addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Should not be page aligned */ if(!(addr4 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8473,7 +8474,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */ - addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE40); + addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40); /* Should not be page aligned */ if(!(addr5 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8484,20 +8485,20 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */ if(family) - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3080); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080); else - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3088); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088); /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE36); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36); /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); + addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Free the block with saddr1 and saddr2--merge with remaining section to become a page which will be returned to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr2, (hsize_t)TBLOCK_SIZE50); /* Verify that the large manager does contain a section with file space page size (default is 4096) */ if(!f->shared->fs_man[H5F_MEM_PAGE_GENERIC]) @@ -8508,14 +8509,14 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */ - addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3900); + addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900); /* The block should be next to the block with addr9 */ if(addr10 != (addr9 + TBLOCK_SIZE80)) TEST_ERROR /* Allocate a small meta data block with addr11 */ /* The current free-space section is unable to fulfill the request; obtain a page from the large manager */ - addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* The address of the block should be the same the freed block with saddr1 */ if(addr11 != saddr1) TEST_ERROR @@ -8683,8 +8684,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be on the second page and page aligned on 4096 (default file space page size) */ if(saddr1 % TBLOCK_SIZE4096) @@ -8695,8 +8696,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 large raw data blocks */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be on the 3rd page and page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8735,8 +8736,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small meta data blocks */ - addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(addr1 % TEST_ALIGN16 || addr2 % TEST_ALIGN16) @@ -8748,8 +8749,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE80); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE100); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16 || saddr2 % TEST_ALIGN16) @@ -8796,8 +8797,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16) @@ -8811,7 +8812,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a large raw data block */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be aligned on 16 */ if(gaddr1 % TEST_ALIGN16) @@ -8861,6 +8862,7 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -8870,6 +8872,8 @@ main(void) h5_reset(); fapl = h5_fileaccess(); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Make a copy of the FAPL before adjusting the alignment */ if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -8983,6 +8987,8 @@ main(void) if(H5Pclose(new_fapl) < 0) FAIL_STACK_ERROR h5_cleanup(FILENAME, fapl); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; if(nerrors) goto error; @@ -8995,6 +9001,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(new_fapl); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return(1); } /* main() */ diff --git a/test/ohdr.c b/test/ohdr.c index 3915b38..f924058 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -31,6 +31,8 @@ #define H5G_FRIEND /*suppress error about including H5Gpkg */ #include "H5Gpkg.h" +#include "H5CXprivate.h" /* API Contexts */ + const char *FILENAME[] = { "ohdr", NULL @@ -67,6 +69,7 @@ test_cont(char *filename, hid_t fapl) const char *short_name = "T"; const char *long_name = "This is the message"; size_t nchunks; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("object header continuation block"); @@ -76,6 +79,8 @@ test_cont(char *filename, hid_t fapl) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if (H5AC_ignore_tags(f) < 0) { @@ -84,51 +89,51 @@ test_cont(char *filename, hid_t fapl) goto error; } /* end if */ - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0) + if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0) FAIL_STACK_ERROR - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0) + if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0) FAIL_STACK_ERROR time_new = 11111111; - if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name) < 0) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_locA, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_locA, 1)) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_locB, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_locB, 1)) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5O_expunge_chunks_test(&oh_locA, H5AC_ind_read_dxpl_id) < 0) + if(H5O_expunge_chunks_test(&oh_locA) < 0) FAIL_STACK_ERROR - if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0) FAIL_STACK_ERROR nchunks = hdr_info.nchunks; /* remove the 1st H5O_NAME_ID message */ - if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE) < 0) FAIL_STACK_ERROR - if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.nchunks >= nchunks) @@ -140,6 +145,7 @@ test_cont(char *filename, hid_t fapl) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR PASSED(); @@ -151,6 +157,7 @@ error: H5O_close(&oh_locA, NULL); H5O_close(&oh_locB, NULL); H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return FAIL; @@ -169,7 +176,6 @@ test_ohdr_cache(char *filename, hid_t fapl) { hid_t file = -1; /* File ID */ hid_t my_fapl; /* FAPL ID */ - hid_t my_dxpl; /* DXPL ID */ H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */ H5F_t *f = NULL; /* File handle */ H5HL_t *lheap, *lheap2, *lheap3; /* Pointer to local heaps */ @@ -195,10 +201,6 @@ test_ohdr_cache(char *filename, hid_t fapl) if(H5Pset_mdc_config(my_fapl, &mdc_config) < 0) FAIL_STACK_ERROR - /* Make a copy of the default DXPL */ - if((my_dxpl = H5Pcopy(H5AC_ind_read_dxpl_id)) < 0) - FAIL_STACK_ERROR - /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) FAIL_STACK_ERROR @@ -210,31 +212,31 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap = H5HL_protect(f, lheap_addr, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Create an object header */ HDmemset(&oh_loc, 0, sizeof(oh_loc)); - if(H5O_create(f, my_dxpl, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) + if(H5O_create(f, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) FAIL_STACK_ERROR /* Query object header information */ rc = 0; - if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0) + if(H5O_get_rc(&oh_loc, &rc) < 0) FAIL_STACK_ERROR if(0 != rc) TEST_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr2) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr2) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap2 = H5HL_protect(f, lheap_addr2, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -243,15 +245,15 @@ test_ohdr_cache(char *filename, hid_t fapl) /* Create object header message in new object header */ time_new = 11111111; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, my_dxpl) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR /* Create object (local heap) that occupies most of cache */ - if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr3) < 0) + if(H5HL_create(f, (31 * 1024), &lheap_addr3) < 0) FAIL_STACK_ERROR /* Protect local heap (which actually pins it in the cache) */ - if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC__READ_ONLY_FLAG))) + if(NULL == (lheap3 = H5HL_protect(f, lheap_addr3, H5AC__READ_ONLY_FLAG))) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -265,13 +267,13 @@ test_ohdr_cache(char *filename, hid_t fapl) * a non-invasive way -QAK) */ rc = 0; - if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0) + if(H5O_get_rc(&oh_loc, &rc) < 0) FAIL_STACK_ERROR if(0 != rc) TEST_ERROR /* Decrement reference count o object header */ - if(H5O_dec_rc_by_loc(&oh_loc, my_dxpl) < 0) + if(H5O_dec_rc_by_loc(&oh_loc) < 0) FAIL_STACK_ERROR /* Close object header created */ @@ -282,8 +284,6 @@ test_ohdr_cache(char *filename, hid_t fapl) if(H5HL_unprotect(lheap) < 0) FAIL_STACK_ERROR - if(H5Pclose(my_dxpl) < 0) - FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -763,6 +763,7 @@ main(void) time_t time_new, ro; int i; /* Local index variable */ unsigned b; /* Index for "new format" loop */ +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; /* Generic return value */ /* Reset library */ @@ -789,6 +790,8 @@ main(void) /* Create the file to operate on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(file))) FAIL_STACK_ERROR if(H5AC_ignore_tags(f) < 0) { @@ -803,22 +806,22 @@ main(void) */ TESTING("object header creation"); HDmemset(&oh_loc, 0, sizeof(oh_loc)); - if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) + if(H5O_create(f, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0) FAIL_STACK_ERROR PASSED(); /* create a new message */ TESTING("message creation"); time_new = 11111111; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(1 != H5O_link(&oh_loc, 1, H5AC_ind_read_dxpl_id)) + if(1 != H5O_link(&oh_loc, 1)) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR @@ -829,19 +832,19 @@ main(void) */ TESTING("message modification"); time_new = 33333333; - if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR /* Make certain that chunk #0 in the object header can be encoded with a 1-byte size */ - if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.space.total >=256) TEST_ERROR @@ -859,16 +862,16 @@ main(void) TESTING("object header overflow in memory"); for(i = 0; i < 40; i++) { time_new = (i + 1) * 1000 + 1000000; - if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR } /* end for */ - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR /* Make certain that chunk #0 in the object header will be encoded with a 2-byte size */ - if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0) + if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0) FAIL_STACK_ERROR if(hdr_info.space.total < 256) TEST_ERROR @@ -903,11 +906,11 @@ main(void) TESTING("object header overflow on disk"); for(i = 0; i < 10; i++) { time_new = (i + 1) * 1000 + 10; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR } /* end for */ PASSED(); @@ -916,13 +919,13 @@ main(void) * Delete all time messages. */ TESTING("message deletion"); - if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR - if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR - if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR - if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro, H5AC_ind_read_dxpl_id)) + if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro)) FAIL_STACK_ERROR PASSED(); @@ -933,23 +936,23 @@ main(void) */ TESTING("constant message handling"); time_new = 22222222; - if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new) < 0) FAIL_STACK_ERROR - if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0) + if(H5AC_flush(f) < 0) FAIL_STACK_ERROR - if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0) FAIL_STACK_ERROR - if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id)) + if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro)) FAIL_STACK_ERROR if(ro != time_new) TEST_ERROR time_new = 33333333; H5E_BEGIN_TRY { - ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id); + ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new); } H5E_END_TRY; if(ret >= 0) TEST_ERROR - if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0) + if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0) FAIL_STACK_ERROR PASSED(); @@ -977,6 +980,7 @@ main(void) /* Test object header creation metadata cache issues */ if(test_ohdr_cache(filename, fapl) < 0) TEST_ERROR +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR } /* end for */ /* Verify symbol table messages are cached */ @@ -994,6 +998,7 @@ error: puts("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Fclose(file); +if(api_ctx_pushed) H5CX_pop(); } H5E_END_TRY; return 1; diff --git a/test/page_buffer.c b/test/page_buffer.c index 853ef93..9901304 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -21,9 +21,6 @@ #include "h5test.h" -#include "H5PBprivate.h" -#include "H5Iprivate.h" - /* * This file needs to access private information from the H5F package. */ @@ -34,6 +31,10 @@ #define H5F_TESTING #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Iprivate.h" +#include "H5PBprivate.h" + #define FILENAME_LEN 1024 #define NUM_DSETS 5 @@ -570,15 +571,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) hid_t file_id = -1; /* File ID */ hid_t fcpl = -1; hid_t fapl = -1; - H5FD_io_info_t fdio_info; - H5P_genplist_t *meta_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id); - H5P_genplist_t *raw_plist = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id); size_t base_page_cnt; size_t page_count = 0; int i, num_elements = 2000; haddr_t addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Raw Data Handling"); @@ -604,6 +603,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -618,13 +619,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* allocate space for a 2000 elements */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count + base_page_cnt) @@ -656,7 +657,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) existing pages in the page buffer. */ for(i=0 ; i<200 ; i++) data[i] = i+100; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; @@ -665,7 +666,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* Changes: 450 - 600; 150 */ for(i=0 ; i<150 ; i++) data[i] = i+450; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; @@ -673,13 +674,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* Do a full page write to block 600-800 - should bypass the PB */ for(i=0 ; i<200 ; i++) data[i] = i+600; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) FAIL_STACK_ERROR; /* read elements 800 - 1200, this should not affect the PB, and should read -1s */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 400; i++) { if(data[i] != -1) { @@ -693,7 +694,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 1200 - 1201, this should read -1 and bring in an * entire page of addr 1200 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 1; i++) { if(data[i] != -1) { @@ -708,7 +709,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 175 - 225, this should use the PB existing pages */ /* Changes: 350 - 450 */ /* read elements 175 - 225, this should use the PB existing pages */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 100; i++) { if(data[i] != i+350) { @@ -721,10 +722,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 800 using the VFD.. this should result in -1s except for the writes that went through the PB (100-300 & 600-800) */ - fdio_info.file = f->shared->lf; - fdio_info.meta_dxpl = meta_plist; - fdio_info.raw_dxpl = raw_plist; - if(H5FD_read(&fdio_info, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) + if(H5FD_read(f->shared->lf, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; i = 0; while (i < 800) { @@ -746,7 +744,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 800 using the PB.. this should result in all * what we have written so far and should get the updates from the PB */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) TEST_ERROR; @@ -763,7 +761,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) */ for(i=0 ; i<1000 ; i++) data[i] = 0; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; page_count -= 2; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt) @@ -772,7 +770,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 0 - 1000.. this should go to disk then update the * buffer result 200-400 with existing pages */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; i=0; while (i < 1000) { @@ -799,6 +797,8 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -809,6 +809,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -861,6 +862,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) haddr_t search_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("LRU Processing"); @@ -894,6 +896,8 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* opening the file inserts one or more pages into the page buffer. * Get the number of pages inserted, and verify that it is the @@ -904,14 +908,14 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* allocate space for a 2000 elements */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) FAIL_STACK_ERROR; @@ -972,7 +976,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* read elements 600 - 601, this should read -1 and bring in an entire page of addr 600, and evict page 200 */ /* Changes: 1200 - 1201; 1200, 400 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 1; i++) { if(data[i] != -1) { @@ -999,7 +1003,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; /* read elements 175 - 225, this should move 100 to the top, evict 600 and bring in 200 */ /* Changes: 350 - 450; 200, 1200, 400 */ - if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; for (i=0; i < 100; i++) { if(data[i] != i+350) { @@ -1030,7 +1034,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) /* Changes: 400 - 1400; 400 */ for(i=0 ; i<1000 ; i++) data[i] = 0; - if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0) FAIL_STACK_ERROR; page_count -= 1; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1052,6 +1056,8 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); PASSED() @@ -1062,6 +1068,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1117,6 +1124,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Minimum Metadata threshold Processing"); HDprintf("\n"); @@ -1149,6 +1157,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* create the file */ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -1178,10 +1188,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 0) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* write all raw data, this would end up in page buffer since there @@ -1192,19 +1202,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; i<100 ; i++) data[i] = i; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; page_count += 5; @@ -1216,19 +1226,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* write all meta data, this would end up in page buffer */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1244,19 +1254,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) * page buffer since the minimum metadata is actually the entire * page buffer */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1312,10 +1322,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 5) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) TEST_ERROR; /* write all meta data, this would end up in page buffer since there @@ -1324,19 +1334,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; i<100 ; i++) data[i] = i; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; page_count += 5; @@ -1347,19 +1357,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* write/read all raw data, this would end up in page buffer */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1375,19 +1385,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) * page buffer since the minimum metadata is actually the entire * page buffer */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1439,39 +1449,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 2) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) @@ -1504,10 +1514,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* adding more meta entires should replace meta entries since raw data * is at its minimum */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 3) @@ -1517,13 +1527,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* bring existing raw entires up the LRU */ - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; /* adding 2 raw entries (even with 1 call) should only evict 1 meta * entry and another raw entry */ - if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 2) @@ -1533,10 +1543,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* adding 2 meta entries should replace 2 entires at the bottom of the LRU */ - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(f->shared->page_buf->meta_count != 2) @@ -1566,39 +1576,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(page_buf->min_raw_count != 0) TEST_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; /* intialize all the elements to have a value of -1 */ for(i=0 ; ishared->page_buf->slist_ptr) != page_count) @@ -1623,17 +1633,17 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) TEST_ERROR; /* bring the rest of the raw entries up the LRU */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; /* write one more raw entry which replace one meta entry */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1648,7 +1658,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write one more raw entry which should replace another raw entry * keeping min threshold of meta entries */ - if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1663,7 +1673,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* write a metadata entry that should replace the metadata entry * at the bottom of the LRU */ - if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0) + if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0) FAIL_STACK_ERROR; if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count) @@ -1683,6 +1693,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); @@ -1696,6 +1708,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; @@ -1750,6 +1763,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) haddr_t raw_addr = HADDR_UNDEF; int *data = NULL; H5F_t *f = NULL; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ TESTING("Statistics Collection"); @@ -1779,6 +1793,8 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR; +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ if(NULL == (f = (H5F_t *)H5I_object(file_id))) @@ -1805,10 +1821,10 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) if(H5Freset_page_buffering_stats(file_id) < 0) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; - if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements))) + if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements))) FAIL_STACK_ERROR; @@ -1816,88 +1832,88 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) for(i=0 ; ishared->page_buf->accesses[0] != 8) @@ -1989,6 +2005,8 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if(H5Pclose(fapl) < 0) FAIL_STACK_ERROR; +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; HDfree(data); @@ -2000,6 +2018,7 @@ error: H5Pclose(fapl); H5Pclose(fcpl); H5Fclose(file_id); +if(api_ctx_pushed) H5CX_pop(); if(data) HDfree(data); } H5E_END_TRY; diff --git a/test/stab.c b/test/stab.c index 97abc16..331c68d 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1141,7 +1141,7 @@ error: } H5E_END_TRY; return 1; -} /* end old_api() */ +} /* end corrupt_stab_msg() */ /*------------------------------------------------------------------------- diff --git a/test/tattr.c b/test/tattr.c index 2d333e9..04bafc4 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -8163,8 +8163,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8177,13 +8177,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8191,9 +8191,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8215,8 +8215,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8229,13 +8229,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8243,9 +8243,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8494,8 +8494,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8508,13 +8508,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8522,9 +8522,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8546,8 +8546,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8560,13 +8560,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8574,9 +8574,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8607,18 +8607,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8631,18 +8631,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8663,18 +8663,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8687,18 +8687,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8940,8 +8940,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -8954,13 +8954,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -8968,9 +8968,9 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -8992,8 +8992,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9006,13 +9006,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9020,8 +9020,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); } /* end else */ @@ -9056,18 +9056,18 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9309,8 +9309,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9323,13 +9323,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* ChecFk that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9337,9 +9337,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9361,8 +9361,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); /* Write data into the attribute */ attr_value = u + 1; @@ -9375,13 +9375,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(attr, FAIL, "H5Acreate2"); /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); /* Write data into the attribute */ big_value[0] = u + 1; @@ -9389,9 +9389,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Awrite"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ @@ -9435,18 +9435,18 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) if(u % 2) { /* Check that attribute is not shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, FALSE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, FALSE, "H5A__is_shared_test"); } /* end if */ else { /* Check that attribute is shared */ - is_shared = H5A_is_shared_test(attr); - VERIFY(is_shared, TRUE, "H5A_is_shared_test"); + is_shared = H5A__is_shared_test(attr); + VERIFY(is_shared, TRUE, "H5A__is_shared_test"); /* Check refcount for attribute */ - ret = H5A_get_shared_rc_test(attr, &shared_refcount); - CHECK(ret, FAIL, "H5A_get_shared_rc_test"); - VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); + ret = H5A__get_shared_rc_test(attr, &shared_refcount); + CHECK(ret, FAIL, "H5A__get_shared_rc_test"); + VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test"); } /* end else */ /* Close attribute */ diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 5b68002..b0b5085 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -48,7 +48,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Low-level I/O minor: Read failed #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed - major: Data filters + major: Dataset minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 889d64b..f88e77d 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -89,7 +89,7 @@ void tts_error(void) expected[2].maj_num = H5E_LINK; expected[2].min_num = H5E_CANTINIT; - expected[3].maj_num = H5E_SYM; + expected[3].maj_num = H5E_LINK; expected[3].min_num = H5E_CANTINSERT; expected[4].maj_num = H5E_SYM; @@ -98,7 +98,7 @@ void tts_error(void) expected[5].maj_num = H5E_SYM; expected[5].min_num = H5E_CALLBACK; - expected[6].maj_num = H5E_SYM; + expected[6].maj_num = H5E_LINK; expected[6].min_num = H5E_EXISTS; /* set up mutex for global count of errors */ diff --git a/test/unregister.c b/test/unregister.c index a4bf24e..4d7c902 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -16,6 +16,7 @@ * Purpose: Tests H5Zunregister function */ #include "h5test.h" +#include "H5CXprivate.h" /* API Contexts */ const char *FILENAME[] = { "unregister_filter_1", @@ -230,10 +231,13 @@ main(void) { hid_t fapl; int nerrors = 0; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); +if(H5CX_push() < 0) FAIL_STACK_ERROR +api_ctx_pushed = TRUE; /* Test unregistering filter in its own file */ nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); @@ -242,6 +246,8 @@ main(void) goto error; printf("All filter unregistration tests passed.\n"); h5_cleanup(FILENAME, fapl); +if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR +api_ctx_pushed = FALSE; return 0; @@ -249,6 +255,7 @@ error: nerrors = MAX(1, nerrors); printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); +if(api_ctx_pushed) H5CX_pop(); return 1; } diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 700e993..0a19167 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3061,7 +3061,7 @@ expunge_entry(H5F_t * file_ptr, if ( nerrors == 0 ) { - result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), + result = H5AC_expunge_entry(file_ptr, &(types[0]), entry_ptr->header.addr, H5AC__NO_FLAGS_SET); if ( result < 0 ) { @@ -3148,7 +3148,7 @@ insert_entry(H5C_t * cache_ptr, (entry_ptr->ver)++; entry_ptr->dirty = TRUE; - result = H5AC_insert_entry(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), + result = H5AC_insert_entry(file_ptr, &(types[0]), entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || @@ -3547,7 +3547,6 @@ lock_entry(H5F_t * file_ptr, HDassert( ! (entry_ptr->locked) ); cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, - H5AC_ind_read_dxpl_id, &(types[0]), entry_ptr->base_addr, &entry_ptr->base_addr, H5AC__NO_FLAGS_SET); @@ -3844,7 +3843,7 @@ move_entry(H5F_t * file_ptr, new_entry_ptr->local_len = tmp_len; } /* end if */ - result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr, H5AC_ind_read_dxpl_id); + result = H5AC_move_entry(file_ptr, &(types[0]), old_addr, new_addr); if ( ( result < 0 ) || ( old_entry_ptr->header.addr != new_addr ) ) { @@ -4227,7 +4226,7 @@ setup_cache_for_test(hid_t * fid_ptr, */ if ( success ) { /* allocate space for test entries */ - actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(max_addr + BASE_ADDR)); if ( actual_base_addr == HADDR_UNDEF ) { @@ -5047,7 +5046,7 @@ unlock_entry(H5F_t * file_ptr, entry_ptr->dirty = TRUE; } - result = H5AC_unprotect(file_ptr, H5AC_ind_read_dxpl_id, &(types[0]), + result = H5AC_unprotect(file_ptr, &(types[0]), entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || diff --git a/testpar/t_file.c b/testpar/t_file.c index 1b6978f..f8bf7b3 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -17,21 +17,22 @@ #include "testphdf5.h" -#include "H5PBprivate.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" +#include "H5PBprivate.h" /* * This file needs to access private information from the H5F package. */ -#define H5C_FRIEND /*suppress error about including H5Cpkg */ -#include "H5Cpkg.h" #define H5AC_FRIEND /*suppress error about including H5ACpkg */ #include "H5ACpkg.h" -#define H5MF_FRIEND /*suppress error about including H5MFpkg */ -#include "H5MFpkg.h" +#define H5C_FRIEND /*suppress error about including H5Cpkg */ +#include "H5Cpkg.h" #define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" +#define H5MF_FRIEND /*suppress error about including H5MFpkg */ +#include "H5MFpkg.h" #define NUM_DSETS 5 @@ -120,7 +121,6 @@ test_page_buffer_access(void) { hid_t file_id = -1; /* File ID */ hid_t fcpl, fapl, fapl_self; - hid_t dxpl_id = H5P_DATASET_XFER_DEFAULT; size_t page_count = 0; int i, num_elements = 200; haddr_t raw_addr, meta_addr; @@ -128,6 +128,7 @@ test_page_buffer_access(void) H5F_t *f = NULL; herr_t ret; /* generic return value */ const char *filename; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -193,6 +194,9 @@ test_page_buffer_access(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_self); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -200,19 +204,19 @@ test_page_buffer_access(void) VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process"); /* allocate space for 200 raw elements */ - raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements); VRFY((raw_addr != HADDR_UNDEF), ""); /* allocate space for 200 metadata elements */ - meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements); VRFY((meta_addr != HADDR_UNDEF), ""); page_count = 0; - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -220,10 +224,10 @@ test_page_buffer_access(void) /* update the first 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); H5Eprint2(H5E_DEFAULT, stderr); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); page_count += 2; VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -231,43 +235,43 @@ test_page_buffer_access(void) /* update the second 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i+50; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update 100 - 200 */ for(i=0 ; i<100 ; i++) data[i] = i+100; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); - ret = H5PB_flush(f, dxpl_id, FALSE); + ret = H5PB_flush(f, FALSE); VRFY((ret == 0), ""); /* read elements 0 - 200 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) @@ -278,6 +282,7 @@ test_page_buffer_access(void) VRFY((ret >= 0), "H5Fclose succeeded"); ret = H5Pclose(fapl_self); VRFY((ret>=0), "H5Pclose succeeded"); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } } #endif @@ -292,6 +297,9 @@ test_page_buffer_access(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; /* Get a pointer to the internal file object */ f = (H5F_t *)H5I_object(file_id); @@ -299,17 +307,17 @@ test_page_buffer_access(void) VRFY((f->shared->page_buf != NULL), "Page Buffer created with 1 process"); /* allocate space for 200 raw elements */ - raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements); VRFY((raw_addr != HADDR_UNDEF), ""); /* allocate space for 200 metadata elements */ - meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements); + meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements); VRFY((meta_addr != HADDR_UNDEF), ""); page_count = 0; - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -317,27 +325,27 @@ test_page_buffer_access(void) /* update the first 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update the second 50 elements */ for(i=0 ; i<50 ; i++) data[i] = i+50; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*50), sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* update 100 - 200 */ for(i=0 ; i<100 ; i++) data[i] = i+100; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*100, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -345,24 +353,24 @@ test_page_buffer_access(void) VRFY((ret == 0), ""); /* read elements 0 - 200 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*200, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 200; i++) VRFY((data[i] == i), "Read different values than written"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == i), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); page_count += 1; VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); @@ -373,20 +381,20 @@ test_page_buffer_access(void) /* reset the first 50 elements to -1*/ for(i=0 ; i<50 ; i++) data[i] = -1; - ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); - ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); /* read elements 0 - 50 */ - ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, H5AC_rawdata_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) VRFY((data[i] == -1), "Read different values than written"); - ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, H5AC_ind_read_dxpl_id, data); + ret = H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*50, data); VRFY((ret == 0), ""); VRFY((H5SL_count(f->shared->page_buf->slist_ptr) == page_count), "Wrong number of pages in PB"); for (i=0; i < 50; i++) @@ -401,6 +409,7 @@ test_page_buffer_access(void) VRFY((ret>=0), "H5Pclose succeeded"); ret = H5Pclose(fcpl); VRFY((ret>=0), "H5Pclose succeeded"); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } HDfree(data); data = NULL; @@ -424,6 +433,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -431,6 +441,9 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; f = (H5F_t *)H5I_object(file_id); VRFY((f != NULL), ""); @@ -548,6 +561,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } MPI_Barrier(MPI_COMM_WORLD); HDfree(data_array); @@ -572,6 +586,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, H5F_t *f = NULL; H5C_t *cache_ptr = NULL; H5AC_cache_config_t config; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; config.version = H5AC__CURR_CACHE_CONFIG_VERSION; @@ -586,6 +601,9 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); H5Eprint2(H5E_DEFAULT, stderr); VRFY((file_id >= 0), ""); +ret = H5CX_push(); +VRFY((ret == 0), "H5CX_push()"); +api_ctx_pushed = TRUE; ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL); VRFY((ret == 0), ""); @@ -677,7 +695,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, HDassert(entry_ptr->is_dirty == FALSE); if(!entry_ptr->is_pinned && !entry_ptr->is_protected) { - ret = H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, entry_ptr->type, entry_ptr->addr, 0); + ret = H5AC_expunge_entry(f, entry_ptr->type, entry_ptr->addr, 0); VRFY((ret == 0), ""); } @@ -699,6 +717,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, VRFY((ret == 0), ""); ret = H5Sclose(mem_dataspace); VRFY((ret == 0), ""); +if(api_ctx_pushed) { ret = H5CX_pop(); VRFY((ret == 0), "H5CX_pop()"); api_ctx_pushed = FALSE; } HDfree(data_array); return nerrors; diff --git a/testpar/t_pread.c b/testpar/t_pread.c index a527503..5b75d6c 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -102,7 +102,7 @@ generate_test_file( MPI_Comm comm, int mpi_rank, int group_id ) FILE *header = NULL; const char *fcn_name = "generate_test_file()"; const char *failure_mssg = NULL; - char *group_filename = NULL; + const char *group_filename = NULL; char data_filename[FILENAME_BUF_SIZE]; char reloc_data_filename[FILENAME_BUF_SIZE]; char prolog_filename[FILENAME_BUF_SIZE]; diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 1052a69..9913225 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -24,8 +24,8 @@ #include "hdf5.h" #include "H5private.h" -#include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ +#include "testphdf5.h" /* On Lustre (and perhaps other parallel file systems?), we have severe diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index a42df95..8fe1c8d 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -32,8 +32,14 @@ */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ + +/* Define this macro to indicate that the testing APIs should be available */ +#define H5S_TESTING + #include "hdf5.h" #include "H5private.h" +#include "H5Spkg.h" /* Dataspaces */ #include "testphdf5.h" diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 72f826e..7e00b4f 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -38,6 +38,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5B2pkg.h" /* v2 B-trees */ +#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ @@ -247,13 +248,14 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; H5E_auto2_t func; void *edata; +hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; if(argc == 1) { @@ -274,7 +276,6 @@ main(int argc, char *argv[]) /* * Open the file and get the file descriptor. */ - dxpl = H5AC_ind_read_dxpl_id; if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); @@ -288,6 +289,11 @@ main(int argc, char *argv[]) HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ +if(H5CX_push() < 0) { + HDfprintf(stderr, "cannot set API context\n"); + HDexit(1); +} +api_ctx_pushed = TRUE; if(NULL == (f = (H5F_t *)H5I_object(fid))) { HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); @@ -317,7 +323,7 @@ main(int argc, char *argv[]) * Read the signature at the specified file position. */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); - if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) { + if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) { HDfprintf(stderr, "cannot read signature\n"); HDexit(3); } @@ -331,13 +337,13 @@ main(int argc, char *argv[]) /* * Debug a local heap. */ - status = H5HL_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HL_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a global heap collection. */ - status = H5HG_debug (f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HG_debug (f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -351,7 +357,7 @@ main(int argc, char *argv[]) HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ - status = H5G_node_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); } else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -373,7 +379,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5G_node_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra); + status = H5G_node_debug(f, addr, stdout, 0, VCOL, extra); break; case H5B_CHUNK_ID: @@ -411,7 +417,7 @@ main(int argc, char *argv[]) /* Set the last dimension (the element size) to zero */ dim[ndims] = 0; - status = H5D_btree_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, ndims, dim); + status = H5D_btree_debug(f, addr, stdout, 0, VCOL, ndims, dim); break; case H5B_NUM_BTREE_ID: @@ -434,7 +440,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, (haddr_t)extra); + status = H5B2__hdr_debug(f, addr, stdout, 0, VCOL, cls, (haddr_t)extra); } else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -461,7 +467,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__int_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); + status = H5B2__int_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (unsigned)extra3, (haddr_t)extra4); } else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -486,13 +492,13 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5B2__leaf_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); + status = H5B2__leaf_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, (haddr_t)extra3); } else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a fractal heap header. */ - status = H5HF_hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5HF_hdr_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -507,7 +513,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5HF_dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, (size_t)extra2); + status = H5HF_dblock_debug(f, addr, stdout, 0, VCOL, extra, (size_t)extra2); } else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -522,14 +528,14 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5HF_iblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, (unsigned)extra2); + status = H5HF_iblock_debug(f, addr, stdout, 0, VCOL, extra, (unsigned)extra2); } else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug a free space header. */ - status = H5FS_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5FS_debug(f, addr, stdout, 0, VCOL); } else if(!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -544,14 +550,14 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FS_sects_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, extra, extra2); + status = H5FS_sects_debug(f, addr, stdout, 0, VCOL, extra, extra2); } else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug shared message master table. */ - status = H5SM_table_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL); + status = H5SM_table_debug(f, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL); } else if(!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -566,7 +572,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5SM_list_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, (haddr_t)extra); + status = H5SM_list_debug(f, addr, stdout, 0, VCOL, (haddr_t)extra); } else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -583,7 +589,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra); + status = H5EA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); } else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -600,7 +606,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__iblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, extra2); + status = H5EA__iblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2); } else if(!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -617,7 +623,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__sblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3); + status = H5EA__sblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (unsigned)extra2, extra3); } else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -634,7 +640,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5EA__dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, (size_t)extra2, extra3); + status = H5EA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, (size_t)extra2, extra3); } else if(!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -651,7 +657,7 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FA__hdr_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra); + status = H5FA__hdr_debug(f, addr, stdout, 0, VCOL, cls, extra); } else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* @@ -668,21 +674,21 @@ main(int argc, char *argv[]) HDexit(4); } /* end if */ - status = H5FA__dblock_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL, cls, extra, extra2); + status = H5FA__dblock_debug(f, addr, stdout, 0, VCOL, cls, extra, extra2); } else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) { /* * Debug v2 object header (which have signatures). */ - status = H5O_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5O_debug(f, addr, stdout, 0, VCOL); } else if(sig[0] == H5O_VERSION_1) { /* * This could be a v1 object header. Since they don't have a signature * it's a somewhat "ify" detection. */ - status = H5O_debug(f, H5AC_ind_read_dxpl_id, addr, stdout, 0, VCOL); + status = H5O_debug(f, addr, stdout, 0, VCOL); } else { /* @@ -713,6 +719,7 @@ main(int argc, char *argv[]) H5Pclose(fapl); H5Fclose(fid); +if(api_ctx_pushed) H5CX_pop(); H5Eset_auto2(H5E_DEFAULT, func, edata); diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 459a37e..163d4e1 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -110,11 +110,14 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define SPACE1_DIM2 0 /* A UD link traversal function. Shouldn't actually be called. */ -static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) +static hid_t +UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, + H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id, + H5_ATTR_UNUSED hid_t dxpl_id) { return -1; } + const H5L_class_t UD_link_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ (H5L_type_t)MY_LINKCLASS, /* Link type id number */ diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index 5276ab0..a785ea7 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -9,7 +9,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): major: Low-level I/O minor: Read failed #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed - major: Data filters + major: Dataset minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-1.err +++ b/tools/test/h5dump/errfiles/tall-1.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2A.err +++ b/tools/test/h5dump/errfiles/tall-2A.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2A0.err +++ b/tools/test/h5dump/errfiles/tall-2A0.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err index ab9dbe3..2f9ef71 100644 --- a/tools/test/h5dump/errfiles/tall-2B.err +++ b/tools/test/h5dump/errfiles/tall-2B.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile', temp_file_name = 'somefile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tarray1_big.err b/tools/test/h5dump/errfiles/tarray1_big.err index 7a0fd7b..be77711 100644 --- a/tools/test/h5dump/errfiles/tarray1_big.err +++ b/tools/test/h5dump/errfiles/tarray1_big.err @@ -1,22 +1,22 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tattr-3.err b/tools/test/h5dump/errfiles/tattr-3.err index ce8ddda..3a34314 100644 --- a/tools/test/h5dump/errfiles/tattr-3.err +++ b/tools/test/h5dump/errfiles/tattr-3.err @@ -1,8 +1,11 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' major: Attribute - minor: Unable to initialize object - #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' + minor: Can't open object + #001: (file name) line (number) in H5A__open(): unable to load attribute info from object header for attribute: 'attr' + major: Attribute + minor: Can't open object + #002: (file name) line (number) in H5O__attr_open_by_name(): can't locate attribute: 'attr' major: Attribute minor: Object not found h5dump error: unable to open attribute "attr" diff --git a/tools/test/h5dump/errfiles/tattrregR.err b/tools/test/h5dump/errfiles/tattrregR.err index 9449a6d..d84d5ec 100644 --- a/tools/test/h5dump/errfiles/tattrregR.err +++ b/tools/test/h5dump/errfiles/tattrregR.err @@ -1,15 +1,15 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tcomp-3.err b/tools/test/h5dump/errfiles/tcomp-3.err index ee47ee5..e41e97a 100644 --- a/tools/test/h5dump/errfiles/tcomp-3.err +++ b/tools/test/h5dump/errfiles/tcomp-3.err @@ -1,16 +1,19 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in H5Topen2(): not found + #000: (file name) line (number) in H5Topen2(): unable to open named datatype + major: Datatype + minor: Can't open object + #001: (file name) line (number) in H5T__open_name(): not found major: Datatype minor: Object not found - #001: (file name) line (number) in H5G_loc_find(): can't find object + #002: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5G_loc_find_cb(): object '#6632' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object '#6632' doesn't exist major: Symbol table minor: Object not found diff --git a/tools/test/h5dump/errfiles/tdataregR.err b/tools/test/h5dump/errfiles/tdataregR.err index 9449a6d..d84d5ec 100644 --- a/tools/test/h5dump/errfiles/tdataregR.err +++ b/tools/test/h5dump/errfiles/tdataregR.err @@ -1,15 +1,15 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Rdereference2(): unable to dereference object major: References - minor: Unable to initialize object - #001: (file name) line (number) in H5R_dereference(): Undefined reference pointer + minor: Can't open object + #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer major: Invalid arguments to routine minor: Bad value H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): diff --git a/tools/test/h5dump/errfiles/tdset-2.err b/tools/test/h5dump/errfiles/tdset-2.err index e594c1b..d00a92b 100644 --- a/tools/test/h5dump/errfiles/tdset-2.err +++ b/tools/test/h5dump/errfiles/tdset-2.err @@ -11,26 +11,29 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'dset3' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Lget_info(): unable to get link info major: Links - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table + minor: Can't get value + #001: (file name) line (number) in H5L__get_info(): unable to get link info for: 'dset3' + major: Links + minor: Can't get value + #002: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Links minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table + #005: (file name) line (number) in H5L__get_info_cb(): name doesn't exist + major: Links minor: Object not found h5dump error: unable to get link info from "dset3" diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err index 95556db..665517d 100644 --- a/tools/test/h5dump/errfiles/textlink.err +++ b/tools/test/h5dump/errfiles/textlink.err @@ -2,49 +2,55 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' major: Links minor: Unable to open file HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/textlinkfar.err b/tools/test/h5dump/errfiles/textlinkfar.err index 5aa7f87..a888ba9 100644 --- a/tools/test/h5dump/errfiles/textlinkfar.err +++ b/tools/test/h5dump/errfiles/textlinkfar.err @@ -2,49 +2,52 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #008: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object - #008: (file name) line (number) in H5O_open_name(): object not found + #009: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #009: (file name) line (number) in H5G_loc_find(): can't find object + #010: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + #011: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #012: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + #013: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #014: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #015: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #016: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): @@ -54,17 +57,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -75,17 +78,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -96,17 +99,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -117,17 +120,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -138,7 +141,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links @@ -151,17 +154,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -172,17 +175,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -193,17 +196,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -214,17 +217,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -235,7 +238,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links diff --git a/tools/test/h5dump/errfiles/textlinksrc.err b/tools/test/h5dump/errfiles/textlinksrc.err index 5aa7f87..a888ba9 100644 --- a/tools/test/h5dump/errfiles/textlinksrc.err +++ b/tools/test/h5dump/errfiles/textlinksrc.err @@ -2,49 +2,52 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #008: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object - #008: (file name) line (number) in H5O_open_name(): object not found + #009: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #009: (file name) line (number) in H5G_loc_find(): can't find object + #010: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #010: (file name) line (number) in H5G_traverse(): internal path traversal failed + #011: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #011: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #012: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + #013: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #013: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #014: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #014: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #015: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #015: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #016: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): @@ -54,17 +57,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -75,17 +78,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -96,17 +99,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -117,17 +120,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -138,7 +141,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links @@ -151,17 +154,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #002: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #002: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #003: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #004: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #004: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #005: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #005: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #006: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -172,17 +175,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #008: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #009: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #009: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #010: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #011: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #011: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #012: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #012: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #013: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -193,17 +196,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #015: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #016: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #016: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #017: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #018: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #018: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #019: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #019: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #020: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -214,17 +217,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #022: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #023: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #023: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #024: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #025: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #025: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #026: (file name) line (number) in H5L_extern_traverse(): unable to open object - major: Symbol table + #026: (file name) line (number) in H5L__extern_traverse(): unable to open object + major: Links minor: Can't open object #027: (file name) line (number) in H5O_open_name(): object not found major: Object header @@ -235,7 +238,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #029: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #030: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #030: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #031: (file name) line (number) in H5G__traverse_special(): too many links diff --git a/tools/test/h5dump/errfiles/tgroup-2.err b/tools/test/h5dump/errfiles/tgroup-2.err index 3659b5c..715f2d2 100644 --- a/tools/test/h5dump/errfiles/tgroup-2.err +++ b/tools/test/h5dump/errfiles/tgroup-2.err @@ -11,10 +11,10 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'y' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'y' doesn't exist major: Symbol table minor: Object not found h5dump error: unable to open group "/y" diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err index e665f03..fba8822 100644 --- a/tools/test/h5dump/errfiles/torderlinks1.err +++ b/tools/test/h5dump/errfiles/torderlinks1.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err index e665f03..fba8822 100644 --- a/tools/test/h5dump/errfiles/torderlinks2.err +++ b/tools/test/h5dump/errfiles/torderlinks2.err @@ -2,24 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Oopen(): unable to open object major: Object header minor: Can't open object - #001: (file name) line (number) in H5O_open_name(): object not found + #001: (file name) line (number) in H5O__open_name(): unable to open object + major: Object header + minor: Can't open object + #002: (file name) line (number) in H5O_open_name(): object not found major: Object header minor: Object not found - #002: (file name) line (number) in H5G_loc_find(): can't find object + #003: (file name) line (number) in H5G_loc_find(): can't find object major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #005: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure - #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + #006: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + #007: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID major: Symbol table minor: Unable to find atom information (already closed?) - #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' + #008: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname', temp_file_name = 'fname' major: Links minor: Unable to open file diff --git a/tools/test/h5dump/errfiles/tperror.err b/tools/test/h5dump/errfiles/tperror.err index b469029..55aeb4a 100644 --- a/tools/test/h5dump/errfiles/tperror.err +++ b/tools/test/h5dump/errfiles/tperror.err @@ -11,26 +11,29 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #005: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + #005: (file name) line (number) in H5G__loc_find_cb(): object 'bogus' doesn't exist major: Symbol table minor: Object not found HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Lget_info(): unable to get link info major: Links - minor: Object not found - #001: (file name) line (number) in H5L_get_info(): name doesn't exist - major: Symbol table + minor: Can't get value + #001: (file name) line (number) in H5L__get_info(): unable to get link info for: 'bogus' + major: Links + minor: Can't get value + #002: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Links minor: Object already exists - #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist - major: Symbol table + #005: (file name) line (number) in H5L__get_info_cb(): name doesn't exist + major: Links minor: Object not found h5dump error: unable to get link info from "bogus" diff --git a/tools/test/h5dump/errfiles/tslink-D.err b/tools/test/h5dump/errfiles/tslink-D.err index 924e9cf..de0705e 100644 --- a/tools/test/h5dump/errfiles/tslink-D.err +++ b/tools/test/h5dump/errfiles/tslink-D.err @@ -11,18 +11,18 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed major: Links minor: Link traversal failure #005: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed major: Links minor: Link traversal failure - #006: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + #006: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link major: Symbol table minor: Object not found - #007: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #008: (file name) line (number) in H5G_traverse_slink_cb(): component not found + #008: (file name) line (number) in H5G__traverse_slink_cb(): component not found major: Symbol table minor: Object not found diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 0eaa2d0..9358fbb 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -172,7 +172,8 @@ const H5Z_class2_t H5Z_DYNLIBUD[1] = {{ /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(H5_ATTR_UNUSED const char * link_name, H5_ATTR_UNUSED hid_t cur_group, - H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id) + H5_ATTR_UNUSED const void * udata, H5_ATTR_UNUSED size_t udata_size, H5_ATTR_UNUSED hid_t lapl_id, + H5_ATTR_UNUSED hid_t dxpl_id) { return -1; } diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index 9f3d000..bd07fb4 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -87,7 +87,8 @@ typedef struct s1_t { /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(const char H5_ATTR_UNUSED * link_name, hid_t H5_ATTR_UNUSED cur_group, - const void H5_ATTR_UNUSED * udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id) + const void H5_ATTR_UNUSED * udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id, + hid_t H5_ATTR_UNUSED dxpl_id) { return -1; } diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst index 95cc4c6..069fb3b 100644 --- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst +++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst @@ -8,17 +8,17 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #002: (file name) line (number) in H5L_link_object(): unable to create new link to object major: Links minor: Unable to initialize object - #003: (file name) line (number) in H5L_create_real(): can't insert link - major: Symbol table + #003: (file name) line (number) in H5L__create_real(): can't insert link + major: Links minor: Unable to insert object #004: (file name) line (number) in H5G_traverse(): internal path traversal failed major: Symbol table minor: Object not found - #005: (file name) line (number) in H5G_traverse_real(): traversal operator failed + #005: (file name) line (number) in H5G__traverse_real(): traversal operator failed major: Symbol table minor: Callback failed - #006: (file name) line (number) in H5L_link_cb(): unable to create object - major: Object header + #006: (file name) line (number) in H5L__link_cb(): unable to create object + major: Links minor: Unable to initialize object #007: (file name) line (number) in H5O_obj_create(): unable to open object major: Object header -- cgit v0.12